Package com.jhlabs.image
Class NoiseFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.PointFilter
com.jhlabs.image.NoiseFilter
- All Implemented Interfaces:
BufferedImageOp
,Cloneable
A filter which adds random noise into an image.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Gaussian distribution for the noise.static final int
Uniform distribution for the noise.Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
filterRGB
(int x, int y, int rgb) int
Get the amount of noise.float
Get the density of the noise.int
Get the distribution of the noise.boolean
Get whether to use monochrome noise.void
setAmount
(int amount) Set the amount of effect.void
setDensity
(float density) Set the density of the noise.void
setDistribution
(int distribution) Set the distribution of the noise.void
setMonochrome
(boolean monochrome) Set whether to use monochrome noise.toString()
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
-
Field Details
-
GAUSSIAN
public static final int GAUSSIANGaussian distribution for the noise.- See Also:
-
UNIFORM
public static final int UNIFORMUniform distribution for the noise.- See Also:
-
-
Constructor Details
-
NoiseFilter
public NoiseFilter()
-
-
Method Details
-
setAmount
public void setAmount(int amount) Set the amount of effect.- Parameters:
amount
- the amount- See Also:
-
getAmount
public int getAmount()Get the amount of noise.- Returns:
- the amount
- See Also:
-
setDistribution
public void setDistribution(int distribution) Set the distribution of the noise.- Parameters:
distribution
- the distribution- See Also:
-
getDistribution
public int getDistribution()Get the distribution of the noise.- Returns:
- the distribution
- See Also:
-
setMonochrome
public void setMonochrome(boolean monochrome) Set whether to use monochrome noise.- Parameters:
monochrome
- true for monochrome noise- See Also:
-
getMonochrome
public boolean getMonochrome()Get whether to use monochrome noise.- Returns:
- true for monochrome noise
- See Also:
-
setDensity
public void setDensity(float density) Set the density of the noise.- Parameters:
density
- the density- See Also:
-
getDensity
public float getDensity()Get the density of the noise.- Returns:
- the density
- See Also:
-
filterRGB
public int filterRGB(int x, int y, int rgb) - Specified by:
filterRGB
in classPointFilter
-
toString
-