com.jhlabs.image

Class SwimFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class SwimFilter
extends TransformFilter

A filter which distorts an image as if it were underwater.

Field Summary

Fields inherited from class com.jhlabs.image.TransformFilter

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

Constructor Summary

SwimFilter()

Method Summary

float
getAmount()
Get the amount of swim.
float
getAngle()
Returns the angle of the effect.
float
getScale()
Returns the scale of the distortion.
float
getStretch()
Returns the stretch factor of the distortion.
float
getTime()
Returns the time.
float
getTurbulence()
Returns the turbulence of the effect.
void
setAmount(float amount)
Set the amount of swim.
void
setAngle(float angle)
Specifies the angle of the effect.
void
setScale(float scale)
Specifies the scale of the distortion.
void
setStretch(float stretch)
Specifies the stretch factor of the distortion.
void
setTime(float time)
Specifies the time.
void
setTurbulence(float turbulence)
Specifies the turbulence of the texture.
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

SwimFilter

public SwimFilter()

Method Details

getAmount

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

getAngle

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

getScale

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

getStretch

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

getTime

public float getTime()
Returns the time.
Returns:
the time.

getTurbulence

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

setAmount

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

setAngle

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

setScale

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

setStretch

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

setTime

public void setTime(float time)
Specifies the time. Use this to animate the effect.
Parameters:
time - the time.

setTurbulence

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

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