com.jhlabs.image

Class ThresholdFilter

Implemented Interfaces:
BufferedImageOp, 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.
String
toString()

Methods inherited from class com.jhlabs.image.PointFilter

filter, filterRGB, setDimensions

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Constructor Details

ThresholdFilter

public ThresholdFilter()
Construct a ThresholdFilter.

ThresholdFilter

public ThresholdFilter(int t)
Construct a ThresholdFilter.
Parameters:
t - the threshold value

Method Details

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Overrides:
filterRGB in interface PointFilter

getBlack

public int getBlack()
Set the color to be used for pixels below the lower threshold.
Returns:
the color

getLowerThreshold

public int getLowerThreshold()
Get the lower threshold value.
Returns:
the threshold value

getUpperThreshold

public int getUpperThreshold()
Get the upper threshold value.
Returns:
the threshold value

getWhite

public int getWhite()
Get the color to be used for pixels above the upper threshold.
Returns:
the color

setBlack

public void setBlack(int black)
Set the color to be used for pixels below the lower threshold.
Parameters:
black - the color

setLowerThreshold

public void setLowerThreshold(int lowerThreshold)
Set the lower threshold value.
Parameters:
lowerThreshold - the threshold value

setUpperThreshold

public void setUpperThreshold(int upperThreshold)
Set the upper threshold value.
Parameters:
upperThreshold - the threshold value

setWhite

public void setWhite(int white)
Set the color to be used for pixels above the upper threshold.
Parameters:
white - the color

toString

public String toString()