Class ThresholdFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class ThresholdFilter extends PointFilter
A filter which performs a threshold operation on an image.
  • 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 class PointFilter
    • toString

      public String toString()
      Overrides:
      toString in class Object