Class 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.
    • 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()
      • 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:
        filterRGB in class PointFilter
      • toString

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