Class CausticsFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class CausticsFilter extends WholeImageFilter
A filter which simulates underwater caustics. This can be animated to get a bottom-of-the-swimming-pool effect.
  • Constructor Details

    • CausticsFilter

      public CausticsFilter()
  • Method Details

    • setScale

      public void setScale(float scale)
      Specifies the scale of the texture.
      Parameters:
      scale - the scale of the texture.
      See Also:
    • getScale

      public float getScale()
      Returns the scale of the texture.
      Returns:
      the scale of the texture.
      See Also:
    • setBrightness

      public void setBrightness(int brightness)
      Set the brightness.
      Parameters:
      brightness - the brightness.
      See Also:
    • getBrightness

      public int getBrightness()
      Get the brightness.
      Returns:
      the brightness.
      See Also:
    • setTurbulence

      public void setTurbulence(float turbulence)
      Specifies the turbulence of the texture.
      Parameters:
      turbulence - the turbulence of the texture.
      See Also:
    • getTurbulence

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

      public void setAmount(float amount)
      Set the amount of effect.
      Parameters:
      amount - the amount
      See Also:
    • getAmount

      public float getAmount()
      Get the amount of effect.
      Returns:
      the amount
      See Also:
    • setDispersion

      public void setDispersion(float dispersion)
      Set the dispersion.
      Parameters:
      dispersion - the dispersion
      See Also:
    • getDispersion

      public float getDispersion()
      Get the dispersion.
      Returns:
      the dispersion
      See Also:
    • setTime

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

      public float getTime()
      Set the time.
      Returns:
      the time
      See Also:
    • setSamples

      public void setSamples(int samples)
      Set the number of samples per pixel. More samples means better quality, but slower rendering.
      Parameters:
      samples - the number of samples
      See Also:
    • getSamples

      public int getSamples()
      Get the number of samples per pixel.
      Returns:
      the number of samples
      See Also:
    • setBgColor

      public void setBgColor(int c)
      Set the background color.
      Parameters:
      c - the color
      See Also:
    • getBgColor

      public int getBgColor()
      Get the background color.
      Returns:
      the color
      See Also:
    • filterPixels

      protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
      Description copied from class: WholeImageFilter
      Actually filter the pixels.
      Specified by:
      filterPixels in class WholeImageFilter
      Parameters:
      width - the image width
      height - the image height
      inPixels - the image pixels
      transformedSpace - the output bounds
      Returns:
      the output pixels
    • toString

      public String toString()
      Overrides:
      toString in class Object