com.jhlabs.image

Class FBMFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class FBMFilter
extends PointFilter
implements Cloneable

A filter which produces textures from fractal Brownian motion.

Field Summary

static int
CELLULAR
static int
NOISE
static int
RIDGED
static int
SCNOISE
static int
VLNOISE
protected Random
random

Fields inherited from class com.jhlabs.image.PointFilter

canFilterIndexColorModel

Constructor Summary

FBMFilter()

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
int
filterRGB(int x, int y, int rgb)
float
getAmount()
Get the amount of texture.
float
getAngle()
Returns the angle of the texture.
Function2D
getBasis()
int
getBasisType()
float
getBias()
Colormap
getColormap()
Get the colormap to be used for the filter.
float
getGain()
float
getH()
float
getLacunarity()
float
getOctaves()
int
getOperation()
float
getScale()
Returns the scale of the texture.
float
getStretch()
Returns the stretch factor of the texture.
protected FBM
makeFBM(float H, float lacunarity, float octaves)
void
setAmount(float amount)
Set the amount of effect.
void
setAngle(float angle)
Specifies the angle of the texture.
void
setBasis(Function2D basis)
void
setBasisType(int basisType)
void
setBias(float bias)
void
setColormap(Colormap colormap)
Set the colormap to be used for the filter.
void
setGain(float gain)
void
setH(float H)
void
setLacunarity(float lacunarity)
void
setOctaves(float octaves)
void
setOperation(int operation)
void
setScale(float scale)
Specifies the scale of the texture.
void
setStretch(float stretch)
Specifies the stretch factor of the texture.
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

CELLULAR

public static final int CELLULAR
Field Value:
4

NOISE

public static final int NOISE
Field Value:
0

RIDGED

public static final int RIDGED
Field Value:
1

SCNOISE

public static final int SCNOISE
Field Value:
3

VLNOISE

public static final int VLNOISE
Field Value:
2

random

protected Random random

Constructor Details

FBMFilter

public FBMFilter()

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)
Overrides:
filter in interface PointFilter

filterRGB

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

getAmount

public float getAmount()
Get the amount of texture.
Returns:
the amount

getAngle

public float getAngle()
Returns the angle of the texture.
Returns:
the angle of the texture.

getBasis

public Function2D getBasis()

getBasisType

public int getBasisType()

getBias

public float getBias()

getColormap

public Colormap getColormap()
Get the colormap to be used for the filter.
Returns:
the colormap

getGain

public float getGain()

getH

public float getH()

getLacunarity

public float getLacunarity()

getOctaves

public float getOctaves()

getOperation

public int getOperation()

getScale

public float getScale()
Returns the scale of the texture.
Returns:
the scale of the texture.

getStretch

public float getStretch()
Returns the stretch factor of the texture.
Returns:
the stretch factor of the texture.

makeFBM

protected FBM makeFBM(float H,
                      float lacunarity,
                      float octaves)

setAmount

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

setAngle

public void setAngle(float angle)
Specifies the angle of the texture.
Parameters:
angle - the angle of the texture.

setBasis

public void setBasis(Function2D basis)

setBasisType

public void setBasisType(int basisType)

setBias

public void setBias(float bias)

setColormap

public void setColormap(Colormap colormap)
Set the colormap to be used for the filter.
Parameters:
colormap - the colormap
See Also:
getColormap()

setGain

public void setGain(float gain)

setH

public void setH(float H)

setLacunarity

public void setLacunarity(float lacunarity)

setOctaves

public void setOctaves(float octaves)

setOperation

public void setOperation(int operation)

setScale

public void setScale(float scale)
Specifies the scale of the texture.
Parameters:
scale - the scale of the texture.

setStretch

public void setStretch(float stretch)
Specifies the stretch factor of the texture.
Parameters:
stretch - the stretch factor of the texture.

toString

public String toString()