Package com.jhlabs.image
Class StampFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.PointFilter
-
- com.jhlabs.image.StampFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.Cloneable
public class StampFilter extends PointFilter
A filter which produces a rubber-stamp type of effect by performing a thresholded blur.
-
-
Field Summary
-
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
-
Constructor Summary
Constructors Constructor Description StampFilter()
Construct a StampFilter.StampFilter(float threshold)
Construct a StampFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
int
filterRGB(int x, int y, int rgb)
int
getBlack()
Set the color to be used for pixels below the lower threshold.float
getRadius()
Get the radius of the effect.float
getSoftness()
Get the softness of the effect.float
getThreshold()
Get the threshold value.int
getWhite()
Get the color to be used for pixels above the upper threshold.void
setBlack(int black)
Set the color to be used for pixels below the lower threshold.void
setRadius(float radius)
Set the radius of the effect.void
setSoftness(float softness)
Set the softness of the effect in the range 0..1.void
setThreshold(float threshold)
Set the threshold value.void
setWhite(int white)
Set the color to be used for pixels above the upper threshold.java.lang.String
toString()
-
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
-
setRadius
public void setRadius(float radius)
Set the radius of the effect.- Parameters:
radius
- the radius min-value: 0- See Also:
getRadius()
-
getRadius
public float getRadius()
Get the radius of the effect.- Returns:
- the radius
- See Also:
setRadius(float)
-
setThreshold
public void setThreshold(float threshold)
Set the threshold value.- Parameters:
threshold
- the threshold value- See Also:
getThreshold()
-
getThreshold
public float getThreshold()
Get the threshold value.- Returns:
- the threshold value
- See Also:
setThreshold(float)
-
setSoftness
public void setSoftness(float softness)
Set the softness of the effect in the range 0..1.- Parameters:
softness
- the softness, minimum value: 0, maximum value: 1- See Also:
getSoftness()
-
getSoftness
public float getSoftness()
Get the softness of the effect.- Returns:
- the softness
- See Also:
setSoftness(float)
-
setWhite
public void setWhite(int white)
Set the color to be used for pixels above the upper threshold.- Parameters:
white
- the color- See Also:
getWhite()
-
getWhite
public int getWhite()
Get the color to be used for pixels above the upper threshold.- Returns:
- the color
- See Also:
setWhite(int)
-
setBlack
public void setBlack(int black)
Set the color to be used for pixels below the lower threshold.- Parameters:
black
- the color- See Also:
getBlack()
-
getBlack
public int getBlack()
Set the color to be used for pixels below the lower threshold.- Returns:
- the color
- See Also:
setBlack(int)
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
- Specified by:
filter
in interfacejava.awt.image.BufferedImageOp
- Overrides:
filter
in classPointFilter
-
filterRGB
public int filterRGB(int x, int y, int rgb)
- Specified by:
filterRGB
in classPointFilter
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-