com.jhlabs.image

Class MarbleFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class MarbleFilter
extends TransformFilter

This filter applies a marbling effect to an image, displacing pixels by random amounts.

Field Summary

Fields inherited from class com.jhlabs.image.TransformFilter

BILINEAR, CLAMP, NEAREST_NEIGHBOUR, RGB_CLAMP, WRAP, ZERO, edgeAction, interpolation, originalSpace, transformedSpace

Constructor Summary

MarbleFilter()

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
float
getAmount()
Get the amount of effect.
float
getTurbulence()
Returns the turbulence of the effect.
float
getXScale()
Get the X scale of the effect.
float
getYScale()
Get the Y scale of the effect.
void
setAmount(float amount)
Set the amount of effect.
void
setTurbulence(float turbulence)
Specifies the turbulence of the effect.
void
setXScale(float xScale)
Set the X scale of the effect.
void
setYScale(float yScale)
Set the Y scale of the effect.
String
toString()
protected void
transformInverse(int x, int y, float[] out)
Inverse transform a point.

Methods inherited from class com.jhlabs.image.TransformFilter

filter, filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation, transformInverse, transformSpace

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

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

Constructor Details

MarbleFilter

public MarbleFilter()

Method Details

filter

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

getAmount

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

getTurbulence

public float getTurbulence()
Returns the turbulence of the effect.
Returns:
the turbulence of the effect.

getXScale

public float getXScale()
Get the X scale of the effect.
Returns:
the scale.

getYScale

public float getYScale()
Get the Y scale of the effect.
Returns:
the scale.

setAmount

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

setTurbulence

public void setTurbulence(float turbulence)
Specifies the turbulence of the effect.
Parameters:
turbulence - the turbulence of the effect.

setXScale

public void setXScale(float xScale)
Set the X scale of the effect.
Parameters:
xScale - the scale.

setYScale

public void setYScale(float yScale)
Set the Y scale of the effect.
Parameters:
yScale - the scale.

toString

public String toString()

transformInverse

protected void transformInverse(int x,
                                int y,
                                float[] out)
Inverse transform a point. This method needs to be overriden by all subclasses.
Overrides:
transformInverse in interface TransformFilter
Parameters:
x - the X position of the pixel in the output image
y - the Y position of the pixel in the output image
out - the position of the pixel in the input image