Class HalftoneFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp, java.lang.Cloneable

    public class HalftoneFilter
    extends AbstractBufferedImageOp
    A filter which uses a another image as a ask to produce a halftoning effect.
    • Constructor Detail

      • HalftoneFilter

        public HalftoneFilter()
    • Method Detail

      • setSoftness

        public void setSoftness​(float softness)
        Set the softness of the effect in the range 0..1.
        Parameters:
        softness - the softness. min-value: 0, max-value: 1
        See Also:
        getSoftness()
      • getSoftness

        public float getSoftness()
        Get the softness of the effect.
        Returns:
        the softness
        See Also:
        setSoftness(float)
      • setMask

        public void setMask​(java.awt.image.BufferedImage mask)
        Set the halftone mask.
        Parameters:
        mask - the mask
        See Also:
        getMask()
      • getMask

        public java.awt.image.BufferedImage getMask()
        Get the halftone mask.
        Returns:
        the mask
        See Also:
        setMask(BufferedImage)
      • setInvert

        public void setInvert​(boolean invert)
      • getInvert

        public boolean getInvert()
      • setMonochrome

        public void setMonochrome​(boolean monochrome)
        Set whether to do monochrome halftoning.
        Parameters:
        monochrome - true for monochrome halftoning
        See Also:
        getMonochrome()
      • getMonochrome

        public boolean getMonochrome()
        Get whether to do monochrome halftoning.
        Returns:
        true for monochrome halftoning
        See Also:
        setMonochrome(boolean)
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
      • toString

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