Class NoiseFilter

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

    public class NoiseFilter
    extends PointFilter
    A filter which adds random noise into an image.
    • Field Detail

      • GAUSSIAN

        public static final int GAUSSIAN
        Gaussian distribution for the noise.
        See Also:
        Constant Field Values
      • UNIFORM

        public static final int UNIFORM
        Uniform distribution for the noise.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NoiseFilter

        public NoiseFilter()
    • Method Detail

      • setAmount

        public void setAmount​(int amount)
        Set the amount of effect.
        Parameters:
        amount - the amount The minimum value is 0.0, the maximum is 1.0
        See Also:
        getAmount()
      • getAmount

        public int getAmount()
        Get the amount of noise.
        Returns:
        the amount
        See Also:
        setAmount(int)
      • setDistribution

        public void setDistribution​(int distribution)
        Set the distribution of the noise.
        Parameters:
        distribution - the distribution
        See Also:
        getDistribution()
      • getDistribution

        public int getDistribution()
        Get the distribution of the noise.
        Returns:
        the distribution
        See Also:
        setDistribution(int)
      • setMonochrome

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

        public boolean getMonochrome()
        Get whether to use monochrome noise.
        Returns:
        true for monochrome noise
        See Also:
        setMonochrome(boolean)
      • setDensity

        public void setDensity​(float density)
        Set the density of the noise.
        Parameters:
        density - the density
        See Also:
        getDensity()
      • getDensity

        public float getDensity()
        Get the density of the noise.
        Returns:
        the density
        See Also:
        setDensity(float)
      • 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