public class NoiseFilter extends PointFilter
Modifier and Type | Field and Description |
---|---|
private int |
amount |
private float |
density |
private int |
distribution |
static int |
GAUSSIAN
Gaussian distribution for the noise.
|
private boolean |
monochrome |
private Random |
randomNumbers |
static int |
UNIFORM
Uniform distribution for the noise.
|
canFilterIndexColorModel
Constructor and Description |
---|
NoiseFilter() |
Modifier and Type | Method and Description |
---|---|
int |
filterRGB(int x,
int y,
int rgb) |
int |
getAmount()
Get the amount of noise.
|
float |
getDensity()
Get the density of the noise.
|
int |
getDistribution()
Get the distribution of the noise.
|
boolean |
getMonochrome()
Get whether to use monochrome noise.
|
private int |
random(int x) |
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.
|
String |
toString() |
filter, setDimensions
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
public static final int GAUSSIAN
public static final int UNIFORM
private int amount
private int distribution
private boolean monochrome
private float density
private Random randomNumbers
public NoiseFilter()
public void setAmount(int amount)
amount
- the amountgetAmount()
public int getAmount()
setAmount(int)
public void setDistribution(int distribution)
distribution
- the distributiongetDistribution()
public int getDistribution()
setDistribution(int)
public void setMonochrome(boolean monochrome)
monochrome
- true for monochrome noisegetMonochrome()
public boolean getMonochrome()
setMonochrome(boolean)
public void setDensity(float density)
density
- the densitygetDensity()
public float getDensity()
setDensity(float)
private int random(int x)
public int filterRGB(int x, int y, int rgb)
filterRGB
in class PointFilter
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses