Package com.jhlabs.image
Class NoiseFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.PointFilter
-
- com.jhlabs.image.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 Summary
Fields Modifier and Type Field Description static intGAUSSIANGaussian distribution for the noise.static intUNIFORMUniform distribution for the noise.-
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
-
Constructor Summary
Constructors Constructor Description NoiseFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfilterRGB(int x, int y, int rgb)intgetAmount()Get the amount of noise.floatgetDensity()Get the density of the noise.intgetDistribution()Get the distribution of the noise.booleangetMonochrome()Get whether to use monochrome noise.voidsetAmount(int amount)Set the amount of effect.voidsetDensity(float density)Set the density of the noise.voidsetDistribution(int distribution)Set the distribution of the noise.voidsetMonochrome(boolean monochrome)Set whether to use monochrome noise.java.lang.StringtoString()-
Methods inherited from class com.jhlabs.image.PointFilter
filter, setDimensions
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
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
-
-
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:
filterRGBin classPointFilter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-