Class RippleFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp, java.lang.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.
    • Constructor Detail

      • RippleFilter

        public RippleFilter()
        Construct a RippleFilter.
    • Method Detail

      • setXAmplitude

        public void setXAmplitude​(float xAmplitude)
        Set the amplitude of ripple in the X direction.
        Parameters:
        xAmplitude - the amplitude (in pixels).
        See Also:
        getXAmplitude()
      • getXAmplitude

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

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

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

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

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

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

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

        public void setWaveType​(int waveType)
        Set the wave type.
        Parameters:
        waveType - the type.
        See Also:
        getWaveType()
      • getWaveType

        public int getWaveType()
        Get the wave type.
        Returns:
        the type.
        See Also:
        setWaveType(int)
      • transformSpace

        protected void transformSpace​(java.awt.Rectangle r)
        Description copied from class: TransformFilter
        Forward transform a rectangle. Used to determine the size of the output image.
        Overrides:
        transformSpace in class TransformFilter
        Parameters:
        r - the rectangle to transform
      • transformInverse

        protected void transformInverse​(int x,
                                        int y,
                                        float[] out)
        Description copied from class: TransformFilter
        Inverse transform a point. This method needs to be overriden by all subclasses.
        Specified by:
        transformInverse in class 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object