Package com.jhlabs.image
Class ThresholdFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.PointFilter
com.jhlabs.image.ThresholdFilter
- All Implemented Interfaces:
BufferedImageOp
,Cloneable
A filter which performs a threshold operation on an image.
-
Field Summary
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a ThresholdFilter.ThresholdFilter
(int t) Construct a ThresholdFilter. -
Method Summary
Modifier and TypeMethodDescriptionint
filterRGB
(int x, int y, int rgb) int
getBlack()
Set the color to be used for pixels below the lower threshold.int
Get the lower threshold value.int
Get the upper 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
setLowerThreshold
(int lowerThreshold) Set the lower threshold value.void
setUpperThreshold
(int upperThreshold) Set the upper threshold value.void
setWhite
(int white) Set the color to be used for pixels above the upper threshold.toString()
Methods inherited from class com.jhlabs.image.PointFilter
filter, setDimensions
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Constructor Details
-
ThresholdFilter
public ThresholdFilter()Construct a ThresholdFilter. -
ThresholdFilter
public ThresholdFilter(int t) Construct a ThresholdFilter.- Parameters:
t
- the threshold value
-
-
Method Details
-
setLowerThreshold
public void setLowerThreshold(int lowerThreshold) Set the lower threshold value.- Parameters:
lowerThreshold
- the threshold value- See Also:
-
getLowerThreshold
public int getLowerThreshold()Get the lower threshold value.- Returns:
- the threshold value
- See Also:
-
setUpperThreshold
public void setUpperThreshold(int upperThreshold) Set the upper threshold value.- Parameters:
upperThreshold
- the threshold value- See Also:
-
getUpperThreshold
public int getUpperThreshold()Get the upper threshold value.- Returns:
- the threshold value
- See Also:
-
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
public int getWhite()Get the color to be used for pixels above the upper threshold.- Returns:
- the color
- See Also:
-
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
public int getBlack()Set the color to be used for pixels below the lower threshold.- Returns:
- the color
- See Also:
-
filterRGB
public int filterRGB(int x, int y, int rgb) - Specified by:
filterRGB
in classPointFilter
-
toString
-