Package com.jhlabs.image
Class RippleFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.TransformFilter
com.jhlabs.image.RippleFilter
- All Implemented Interfaces:
BufferedImageOp,Cloneable
A filter which distorts an image by rippling it in the X or Y directions.
The amplitude and wavelength of rippling can be specified as well as whether
pixels going off the edges are wrapped or not.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNoise ripples.static final intSawtooth wave ripples.static final intSine wave ripples.static final intTriangle wave ripples.Fields inherited from class com.jhlabs.image.TransformFilter
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the wave type.floatGet the amplitude of ripple in the X direction.floatGet the wavelength of ripple in the X direction.floatGet the amplitude of ripple in the Y direction.floatGet the wavelength of ripple in the Y direction.voidsetWaveType(int waveType) Set the wave type.voidsetXAmplitude(float xAmplitude) Set the amplitude of ripple in the X direction.voidsetXWavelength(float xWavelength) Set the wavelength of ripple in the X direction.voidsetYAmplitude(float yAmplitude) Set the amplitude of ripple in the Y direction.voidsetYWavelength(float yWavelength) Set the wavelength of ripple in the Y direction.toString()protected voidtransformInverse(int x, int y, float[] out) Inverse transform a point.protected voidForward transform a rectangle.Methods inherited from class com.jhlabs.image.TransformFilter
filter, filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolationMethods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Field Details
-
SINE
public static final int SINESine wave ripples.- See Also:
-
SAWTOOTH
public static final int SAWTOOTHSawtooth wave ripples.- See Also:
-
TRIANGLE
public static final int TRIANGLETriangle wave ripples.- See Also:
-
NOISE
public static final int NOISENoise ripples.- See Also:
-
-
Constructor Details
-
RippleFilter
public RippleFilter()Construct a RippleFilter.
-
-
Method Details
-
setXAmplitude
public void setXAmplitude(float xAmplitude) Set the amplitude of ripple in the X direction.- Parameters:
xAmplitude- the amplitude (in pixels).- See Also:
-
getXAmplitude
public float getXAmplitude()Get the amplitude of ripple in the X direction.- Returns:
- the amplitude (in pixels).
- See Also:
-
setXWavelength
public void setXWavelength(float xWavelength) Set the wavelength of ripple in the X direction.- Parameters:
xWavelength- the wavelength (in pixels).- See Also:
-
getXWavelength
public float getXWavelength()Get the wavelength of ripple in the X direction.- Returns:
- the wavelength (in pixels).
- See Also:
-
setYAmplitude
public void setYAmplitude(float yAmplitude) Set the amplitude of ripple in the Y direction.- Parameters:
yAmplitude- the amplitude (in pixels).- See Also:
-
getYAmplitude
public float getYAmplitude()Get the amplitude of ripple in the Y direction.- Returns:
- the amplitude (in pixels).
- See Also:
-
setYWavelength
public void setYWavelength(float yWavelength) Set the wavelength of ripple in the Y direction.- Parameters:
yWavelength- the wavelength (in pixels).- See Also:
-
getYWavelength
public float getYWavelength()Get the wavelength of ripple in the Y direction.- Returns:
- the wavelength (in pixels).
- See Also:
-
setWaveType
public void setWaveType(int waveType) Set the wave type.- Parameters:
waveType- the type.- See Also:
-
getWaveType
public int getWaveType()Get the wave type.- Returns:
- the type.
- See Also:
-
transformSpace
Description copied from class:TransformFilterForward transform a rectangle. Used to determine the size of the output image.- Overrides:
transformSpacein classTransformFilter- Parameters:
r- the rectangle to transform
-
transformInverse
protected void transformInverse(int x, int y, float[] out) Description copied from class:TransformFilterInverse transform a point. This method needs to be overriden by all subclasses.- Specified by:
transformInversein classTransformFilter- Parameters:
x- the X position of the pixel in the output imagey- the Y position of the pixel in the output imageout- the position of the pixel in the input image
-
toString
-