com.jhlabs.image

Class NoiseFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class NoiseFilter
extends PointFilter

A filter which adds random noise into an image.

Field Summary

static int
GAUSSIAN
Gaussian distribution for the noise.
static int
UNIFORM
Uniform distribution for the noise.

Fields inherited from class com.jhlabs.image.PointFilter

canFilterIndexColorModel

Constructor Summary

NoiseFilter()

Method Summary

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.
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()

Methods inherited from class com.jhlabs.image.PointFilter

filter, filterRGB, setDimensions

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Field Details

GAUSSIAN

public static final int GAUSSIAN
Gaussian distribution for the noise.
Field Value:
0

UNIFORM

public static final int UNIFORM
Uniform distribution for the noise.
Field Value:
1

Constructor Details

NoiseFilter

public NoiseFilter()

Method Details

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Overrides:
filterRGB in interface PointFilter

getAmount

public int getAmount()
Get the amount of noise.
Returns:
the amount

getDensity

public float getDensity()
Get the density of the noise.
Returns:
the density

getDistribution

public int getDistribution()
Get the distribution of the noise.
Returns:
the distribution

getMonochrome

public boolean getMonochrome()
Get whether to use monochrome noise.
Returns:
true for monochrome noise

setAmount

public void setAmount(int amount)
Set the amount of effect.
Parameters:
amount - the amount

setDensity

public void setDensity(float density)
Set the density of the noise.
Parameters:
density - the density

setDistribution

public void setDistribution(int distribution)
Set the distribution of the noise.
Parameters:
distribution - the distribution

setMonochrome

public void setMonochrome(boolean monochrome)
Set whether to use monochrome noise.
Parameters:
monochrome - true for monochrome noise

toString

public String toString()