Class SwimFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp, java.lang.Cloneable

    public class SwimFilter
    extends TransformFilter
    A filter which distorts an image as if it were underwater.
    • Constructor Detail

      • SwimFilter

        public SwimFilter()
    • Method Detail

      • setAmount

        public void setAmount​(float amount)
        Set the amount of swim.
        Parameters:
        amount - the amount of swim. Minimum value: 0, maximum value: 100+
        See Also:
        getAmount()
      • getAmount

        public float getAmount()
        Get the amount of swim.
        Returns:
        the amount swim
        See Also:
        setAmount(float)
      • setScale

        public void setScale​(float scale)
        Specifies the scale of the distortion.
        Parameters:
        scale - the scale of the distortion. Minimum value: 1, maximum value: 300+
        See Also:
        getScale()
      • getScale

        public float getScale()
        Returns the scale of the distortion.
        Returns:
        the scale of the distortion.
        See Also:
        setScale(float)
      • setStretch

        public void setStretch​(float stretch)
        Specifies the stretch factor of the distortion.
        Parameters:
        stretch - the stretch factor of the distortion. Minimum value: 1, maximum value: 50+
        See Also:
        getStretch()
      • getStretch

        public float getStretch()
        Returns the stretch factor of the distortion.
        Returns:
        the stretch factor of the distortion.
        See Also:
        setStretch(float)
      • setAngle

        public void setAngle​(float angle)
        Specifies the angle of the effect.
        Parameters:
        angle - the angle of the effect.
        See Also:
        getAngle()
      • getAngle

        public float getAngle()
        Returns the angle of the effect.
        Returns:
        the angle of the effect.
        See Also:
        setAngle(float)
      • setTurbulence

        public void setTurbulence​(float turbulence)
        Specifies the turbulence of the texture.
        Parameters:
        turbulence - the turbulence of the texture. Minimum value: 0, maximum value: 1
        See Also:
        getTurbulence()
      • getTurbulence

        public float getTurbulence()
        Returns the turbulence of the effect.
        Returns:
        the turbulence of the effect.
        See Also:
        setTurbulence(float)
      • setTime

        public void setTime​(float time)
        Specifies the time. Use this to animate the effect.
        Parameters:
        time - the time.
        See Also:
        getTime()
      • getTime

        public float getTime()
        Returns the time.
        Returns:
        the time.
        See Also:
        setTime(float)
      • 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