Class RippleFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class RippleFilter extends TransformFilter
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 Details

    • SINE

      public static final int SINE
      See Also:
    • SAWTOOTH

      public static final int SAWTOOTH
      See Also:
    • TRIANGLE

      public static final int TRIANGLE
      See Also:
    • NOISE

      public static final int NOISE
      See Also:
    • xAmplitude

      public float xAmplitude
    • yAmplitude

      public float yAmplitude
    • xWavelength

      public float xWavelength
    • yWavelength

      public float yWavelength
  • 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).
    • getXAmplitude

      public float getXAmplitude()
      Get the amplitude of ripple in the X direction.
      Returns:
      the amplitude (in pixels).
    • setXWavelength

      public void setXWavelength(float xWavelength)
      Set the wavelength of ripple in the X direction.
      Parameters:
      xWavelength - the wavelength (in pixels).
    • getXWavelength

      public float getXWavelength()
      Get the wavelength of ripple in the X direction.
      Returns:
      the wavelength (in pixels).
    • setYAmplitude

      public void setYAmplitude(float yAmplitude)
      Set the amplitude of ripple in the Y direction.
      Parameters:
      yAmplitude - the amplitude (in pixels).
    • getYAmplitude

      public float getYAmplitude()
      Get the amplitude of ripple in the Y direction.
      Returns:
      the amplitude (in pixels).
    • setYWavelength

      public void setYWavelength(float yWavelength)
      Set the wavelength of ripple in the Y direction.
      Parameters:
      yWavelength - the wavelength (in pixels).
    • getYWavelength

      public float getYWavelength()
      Get the wavelength of ripple in the Y direction.
      Returns:
      the wavelength (in pixels).
    • setWaveType

      public void setWaveType(int waveType)
    • getWaveType

      public int getWaveType()
    • transformSpace

      protected void transformSpace(Rectangle r)
      Overrides:
      transformSpace in class TransformFilter
    • transformInverse

      protected void transformInverse(int x, int y, float[] out)
      Specified by:
      transformInverse in class TransformFilter
    • toString

      public String toString()
      Overrides:
      toString in class Object