com.jhlabs.image
Class ThresholdFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by com.jhlabs.image.PointFilter
          extended by 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
ThresholdFilter()
          Construct a ThresholdFilter.
ThresholdFilter(int t)
          Construct a ThresholdFilter.
 
Method Summary
 int filterRGB(int x, int y, int rgb)
           
 int getBlack()
          Set the color to be used for pixels below the lower threshold.
 int getLowerThreshold()
          Get the lower threshold value.
 int getUpperThreshold()
          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.
 java.lang.String 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThresholdFilter

public ThresholdFilter()
Construct a ThresholdFilter.


ThresholdFilter

public ThresholdFilter(int t)
Construct a ThresholdFilter.

Parameters:
t - the threshold value
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()

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)

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Specified by:
filterRGB in class PointFilter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object