Class BinaryMask

  • All Implemented Interfaces:
    CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, ImageTransformer<BufferedImageContainer>, FlowContextHandler, Serializable, Comparable

    public class BinaryMask
    extends AbstractBufferedImageTransformer
    Generates a binary image from the input and uses this mask to determine which pixels get replaced by the specified replacement color.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -threshold <int> (property: threshold)
        The threshold that determines whether a grayscale pixel will become black 
        (below) or white (equal to or above).
        default: 128
        minimum: 0
        maximum: 255
     
    -replacement-type <REPLACE_WHITE_PIXELS|REPLACE_BLACK_PIXELS> (property: replacementType)
        The type of replacement to perform.
        default: REPLACE_WHITE_PIXELS
     
    -replacement-color <java.awt.Color> (property: replacementColor)
        The color to replace pixels selected by the replacement type with.
        default: #ffffff
     
    Version:
    $Revision: 7706 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Threshold

        protected int m_Threshold
        the (grayscale) threshold to use.
      • m_ReplacementColor

        protected Color m_ReplacementColor
        the color to replace the pixels with.
    • Constructor Detail

      • BinaryMask

        public BinaryMask()
    • Method Detail

      • setThreshold

        public void setThreshold​(int value)
        Sets the threshold.
        Parameters:
        value - the threshold
      • getThreshold

        public int getThreshold()
        Returns the threshold.
        Returns:
        the threshold
      • thresholdTipText

        public String thresholdTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setReplacementType

        public void setReplacementType​(BinaryMask.ReplacementType value)
        Sets the type of replacement to perform.
        Parameters:
        value - the type
      • getReplacementType

        public BinaryMask.ReplacementType getReplacementType()
        Returns the type of replacement to perform.
        Returns:
        the type
      • replacementTypeTipText

        public String replacementTypeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setReplacementColor

        public void setReplacementColor​(Color value)
        Sets the color to replace the selected pixels with.
        Parameters:
        value - the color
      • getReplacementColor

        public Color getReplacementColor()
        Returns the color to replace the selected pixels with.
        Returns:
        the color
      • replacementColorTipText

        public String replacementColorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui