Package com.jhlabs.image
Class LightFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.WholeImageFilter
com.jhlabs.image.LightFilter
- All Implemented Interfaces:
BufferedImageOp
,Cloneable
- Direct Known Subclasses:
ChromeFilter
A filter which produces lighting and embossing effects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
static class
A class representing a light.static class
A class representing material properties.class
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
Use a custom function as the bump map.static final int
Use the input image brightness as the bump map.static final int
Use the input image alpha as the bump map.static final int
Use a separate image alpha channel as the bump map.static final int
Use constant material color.static final int
Take the output colors from the input image.static final int
static final int
protected static final float
static final int
Fields inherited from class com.jhlabs.image.WholeImageFilter
originalSpace, transformedSpace
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLight
(LightFilter.Light light) protected int[]
filterPixels
(int width, int height, int[] inPixels, Rectangle transformedSpace) Actually filter the pixels.float
float
int
int
int
float
protected Color4f
phongShade
(Vector3f position, Vector3f viewpoint, Vector3f normal, Color4f diffuseColor, Color4f specularColor, LightFilter.Material material, LightFilter.Light[] lightsArray) void
removeLight
(LightFilter.Light light) void
setBumpFunction
(Function2D bumpFunction) void
setBumpHeight
(float bumpHeight) void
setBumpSoftness
(float bumpSoftness) void
setBumpSource
(int bumpSource) void
setColorSource
(int colorSource) void
setDiffuseColor
(int diffuseColor) void
setEnvironmentMap
(BufferedImage environmentMap) protected void
setFromRGB
(Color4f c, int argb) void
setMaterial
(LightFilter.Material material) void
setViewDistance
(float viewDistance) toString()
Methods inherited from class com.jhlabs.image.WholeImageFilter
filter, transformSpace
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Field Details
-
COLORS_FROM_IMAGE
public static final int COLORS_FROM_IMAGETake the output colors from the input image.- See Also:
-
COLORS_CONSTANT
public static final int COLORS_CONSTANTUse constant material color.- See Also:
-
BUMPS_FROM_IMAGE
public static final int BUMPS_FROM_IMAGEUse the input image brightness as the bump map.- See Also:
-
BUMPS_FROM_IMAGE_ALPHA
public static final int BUMPS_FROM_IMAGE_ALPHAUse the input image alpha as the bump map.- See Also:
-
BUMPS_FROM_MAP
public static final int BUMPS_FROM_MAPUse a separate image alpha channel as the bump map.- See Also:
-
BUMPS_FROM_BEVEL
public static final int BUMPS_FROM_BEVELUse a custom function as the bump map.- See Also:
-
r255
protected static final float r255- See Also:
-
AMBIENT
public static final int AMBIENT- See Also:
-
DISTANT
public static final int DISTANT- See Also:
-
POINT
public static final int POINT- See Also:
-
SPOT
public static final int SPOT- See Also:
-
-
Constructor Details
-
LightFilter
public LightFilter()
-
-
Method Details
-
setMaterial
-
getMaterial
-
setBumpFunction
-
getBumpFunction
-
setBumpHeight
public void setBumpHeight(float bumpHeight) -
getBumpHeight
public float getBumpHeight() -
setBumpSoftness
public void setBumpSoftness(float bumpSoftness) -
getBumpSoftness
public float getBumpSoftness() -
setViewDistance
public void setViewDistance(float viewDistance) -
getViewDistance
public float getViewDistance() -
setEnvironmentMap
-
getEnvironmentMap
-
setColorSource
public void setColorSource(int colorSource) -
getColorSource
public int getColorSource() -
setBumpSource
public void setBumpSource(int bumpSource) -
getBumpSource
public int getBumpSource() -
setDiffuseColor
public void setDiffuseColor(int diffuseColor) -
getDiffuseColor
public int getDiffuseColor() -
addLight
-
removeLight
-
getLights
-
setFromRGB
-
filterPixels
Description copied from class:WholeImageFilter
Actually filter the pixels.- Specified by:
filterPixels
in classWholeImageFilter
- Parameters:
width
- the image widthheight
- the image heightinPixels
- the image pixelstransformedSpace
- the output bounds- Returns:
- the output pixels
-
phongShade
protected Color4f phongShade(Vector3f position, Vector3f viewpoint, Vector3f normal, Color4f diffuseColor, Color4f specularColor, LightFilter.Material material, LightFilter.Light[] lightsArray) -
toString
-