Package com.jhlabs.image
Class TritoneFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.PointFilter
-
- com.jhlabs.image.TritoneFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp,java.lang.Cloneable
public class TritoneFilter extends PointFilter
A filter which performs a tritone conversion on an image. Given three colors for shadows, midtones and highlights, it converts the image to grayscale and then applies a color mapping based on the colors.
-
-
Field Summary
-
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
-
Constructor Summary
Constructors Constructor Description TritoneFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)intfilterRGB(int x, int y, int rgb)intgetHighColor()Get the high color.intgetMidColor()Get the mid color.intgetShadowColor()Get the shadow color.voidsetHighColor(int highColor)Set the high color.voidsetMidColor(int midColor)Set the mid color.voidsetShadowColor(int shadowColor)Set the shadow color.java.lang.StringtoString()-
Methods inherited from class com.jhlabs.image.PointFilter
setDimensions
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Method Detail
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)- Specified by:
filterin interfacejava.awt.image.BufferedImageOp- Overrides:
filterin classPointFilter
-
filterRGB
public int filterRGB(int x, int y, int rgb)- Specified by:
filterRGBin classPointFilter
-
setShadowColor
public void setShadowColor(int shadowColor)
Set the shadow color.- Parameters:
shadowColor- the shadow color- See Also:
getShadowColor()
-
getShadowColor
public int getShadowColor()
Get the shadow color.- Returns:
- the shadow color
- See Also:
setShadowColor(int)
-
setMidColor
public void setMidColor(int midColor)
Set the mid color.- Parameters:
midColor- the mid color- See Also:
getMidColor()
-
getMidColor
public int getMidColor()
Get the mid color.- Returns:
- the mid color
- See Also:
setMidColor(int)
-
setHighColor
public void setHighColor(int highColor)
Set the high color.- Parameters:
highColor- the high color- See Also:
getHighColor()
-
getHighColor
public int getHighColor()
Get the high color.- Returns:
- the high color
- See Also:
setHighColor(int)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-