Package com.jhlabs.image
Class ThresholdFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.PointFilter
-
- com.jhlabs.image.ThresholdFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp,java.lang.Cloneable
public class ThresholdFilter extends PointFilter
A filter which performs a threshold operation on an image.
-
-
Field Summary
-
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
-
Constructor Summary
Constructors Constructor Description ThresholdFilter()Construct a ThresholdFilter.ThresholdFilter(int t)Construct a ThresholdFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfilterRGB(int x, int y, int rgb)intgetBlack()Set the color to be used for pixels below the lower threshold.intgetLowerThreshold()Get the lower threshold value.intgetUpperThreshold()Get the upper threshold value.intgetWhite()Get the color to be used for pixels above the upper threshold.voidsetBlack(int black)Set the color to be used for pixels below the lower threshold.voidsetBlack(java.lang.String black)Set the color to be used for pixels below the lower threshold as a string specification.voidsetLowerThreshold(int lowerThreshold)Set the lower threshold value.voidsetUpperThreshold(int upperThreshold)Set the upper threshold value.voidsetWhite(int white)Set the color to be used for pixels above the upper threshold.voidsetWhite(java.lang.String white)Set the color to be used for pixels above the upper threshold as a string specification.java.lang.StringtoString()-
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, stringToColor
-
-
-
-
Method Detail
-
setLowerThreshold
public void setLowerThreshold(int lowerThreshold)
Set the lower threshold value.- Parameters:
lowerThreshold- the threshold value- See Also:
getLowerThreshold()
-
getLowerThreshold
public int getLowerThreshold()
Get the lower threshold value.- Returns:
- the threshold value
- See Also:
setLowerThreshold(int)
-
setUpperThreshold
public void setUpperThreshold(int upperThreshold)
Set the upper threshold value.- Parameters:
upperThreshold- the threshold value- See Also:
getUpperThreshold()
-
getUpperThreshold
public int getUpperThreshold()
Get the upper threshold value.- Returns:
- the threshold value
- See Also:
setUpperThreshold(int)
-
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()
-
setWhite
public void setWhite(java.lang.String white)
Set the color to be used for pixels above the upper threshold as a string specification.- Parameters:
white- The color specification.- See Also:
getBlack()
-
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()
-
setBlack
public void setBlack(java.lang.String black)
Set the color to be used for pixels below the lower threshold as a string specification.- Parameters:
black- The color specification.- 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)
-
filterRGB
public int filterRGB(int x, int y, int rgb)- Specified by:
filterRGBin classPointFilter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-