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 TypeClassDescriptionclassclassstatic classA class representing a light.static classA class representing material properties.classclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intUse a custom function as the bump map.static final intUse the input image brightness as the bump map.static final intUse the input image alpha as the bump map.static final intUse a separate image alpha channel as the bump map.static final intUse constant material color.static final intTake the output colors from the input image.static final intstatic final intprotected static final floatstatic final intFields inherited from class com.jhlabs.image.WholeImageFilter
originalSpace, transformedSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLight(LightFilter.Light light) protected int[]filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) Actually filter the pixels.floatfloatintintintfloatprotected Color4fphongShade(Vector3f position, Vector3f viewpoint, Vector3f normal, Color4f diffuseColor, Color4f specularColor, LightFilter.Material material, LightFilter.Light[] lightsArray) voidremoveLight(LightFilter.Light light) voidsetBumpFunction(Function2D bumpFunction) voidsetBumpHeight(float bumpHeight) voidsetBumpSoftness(float bumpSoftness) voidsetBumpSource(int bumpSource) voidsetColorSource(int colorSource) voidsetDiffuseColor(int diffuseColor) voidsetEnvironmentMap(BufferedImage environmentMap) protected voidsetFromRGB(Color4f c, int argb) voidsetMaterial(LightFilter.Material material) voidsetViewDistance(float viewDistance) toString()Methods inherited from class com.jhlabs.image.WholeImageFilter
filter, transformSpaceMethods 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:WholeImageFilterActually filter the pixels.- Specified by:
filterPixelsin 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
-