com.jhlabs.image

Class WaterFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class WaterFilter
extends TransformFilter

A filter which produces a water ripple distortion.

Field Summary

Fields inherited from class com.jhlabs.image.TransformFilter

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

Constructor Summary

WaterFilter()

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
float
getAmplitude()
Get the amplitude of the ripples.
Point2D
getCentre()
Get the centre of the effect as a proportion of the image size.
float
getCentreX()
Get the centre of the effect in the X direction as a proportion of the image size.
float
getCentreY()
Get the centre of the effect in the Y direction as a proportion of the image size.
float
getPhase()
Get the phase of the ripples.
float
getRadius()
Get the radius of the effect.
float
getWavelength()
Get the wavelength of the ripples.
void
setAmplitude(float amplitude)
Set the amplitude of the ripples.
void
setCentre(Point2D centre)
Set the centre of the effect as a proportion of the image size.
void
setCentreX(float centreX)
Set the centre of the effect in the X direction as a proportion of the image size.
void
setCentreY(float centreY)
Set the centre of the effect in the Y direction as a proportion of the image size.
void
setPhase(float phase)
Set the phase of the ripples.
void
setRadius(float radius)
Set the radius of the effect.
void
setWavelength(float wavelength)
Set the wavelength of the ripples.
String
toString()
protected void
transformInverse(int x, int y, float[] out)

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

WaterFilter

public WaterFilter()

Method Details

filter

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

getAmplitude

public float getAmplitude()
Get the amplitude of the ripples.
Returns:
the amplitude

getCentre

public Point2D getCentre()
Get the centre of the effect as a proportion of the image size.
Returns:
the center

getCentreX

public float getCentreX()
Get the centre of the effect in the X direction as a proportion of the image size.
Returns:
the center

getCentreY

public float getCentreY()
Get the centre of the effect in the Y direction as a proportion of the image size.
Returns:
the center

getPhase

public float getPhase()
Get the phase of the ripples.
Returns:
the phase

getRadius

public float getRadius()
Get the radius of the effect.
Returns:
the radius

getWavelength

public float getWavelength()
Get the wavelength of the ripples.
Returns:
the wavelength

setAmplitude

public void setAmplitude(float amplitude)
Set the amplitude of the ripples.
Parameters:
amplitude - the amplitude

setCentre

public void setCentre(Point2D centre)
Set the centre of the effect as a proportion of the image size.
Parameters:
centre - the center

setCentreX

public void setCentreX(float centreX)
Set the centre of the effect in the X direction as a proportion of the image size.
Parameters:
centreX - the center

setCentreY

public void setCentreY(float centreY)
Set the centre of the effect in the Y direction as a proportion of the image size.
Parameters:
centreY - the center

setPhase

public void setPhase(float phase)
Set the phase of the ripples.
Parameters:
phase - the phase

setRadius

public void setRadius(float radius)
Set the radius of the effect.
Parameters:
radius - the radius

setWavelength

public void setWavelength(float wavelength)
Set the wavelength of the ripples.
Parameters:
wavelength - the wavelength

toString

public String toString()

transformInverse

protected void transformInverse(int x,
                                int y,
                                float[] out)
Overrides:
transformInverse in interface TransformFilter