Package com.jhlabs.image
Class CausticsFilter
- java.lang.Object
- 
- com.jhlabs.image.AbstractBufferedImageOp
- 
- com.jhlabs.image.WholeImageFilter
- 
- com.jhlabs.image.CausticsFilter
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.BufferedImageOp,- java.lang.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.
- 
- 
Field Summary- 
Fields inherited from class com.jhlabs.image.WholeImageFilteroriginalSpace, transformedSpace
 
- 
 - 
Constructor SummaryConstructors Constructor Description CausticsFilter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int[]filterPixels(int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)Actually filter the pixels.floatgetAmount()Get the amount of effect.intgetBgColor()Get the background color.intgetBrightness()Get the brightness.floatgetDispersion()Get the dispersion.intgetSamples()Get the number of samples per pixel.floatgetScale()Returns the scale of the texture.floatgetTime()Set the time.floatgetTurbulence()Returns the turbulence of the effect.voidsetAmount(float amount)Set the amount of effect.voidsetBgColor(int c)Set the background color.voidsetBrightness(int brightness)Set the brightness.voidsetDispersion(float dispersion)Set the dispersion.voidsetSamples(int samples)Set the number of samples per pixel.voidsetScale(float scale)Specifies the scale of the texture.voidsetTime(float time)Set the time.voidsetTurbulence(float turbulence)Specifies the turbulence of the texture.java.lang.StringtoString()- 
Methods inherited from class com.jhlabs.image.WholeImageFilterfilter, transformSpace
 - 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOpclone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
 
- 
 
- 
- 
- 
Method Detail- 
setScalepublic void setScale(float scale) Specifies the scale of the texture.- Parameters:
- scale- the scale of the texture, min-value 1, max-value 300+
- See Also:
- getScale()
 
 - 
getScalepublic float getScale() Returns the scale of the texture.- Returns:
- the scale of the texture.
- See Also:
- setScale(float)
 
 - 
setBrightnesspublic void setBrightness(int brightness) Set the brightness.- Parameters:
- brightness- the brightness, min-value 0, max-value 1
- See Also:
- getBrightness()
 
 - 
getBrightnesspublic int getBrightness() Get the brightness.- Returns:
- the brightness.
- See Also:
- setBrightness(int)
 
 - 
setTurbulencepublic void setTurbulence(float turbulence) Specifies the turbulence of the texture.- Parameters:
- turbulence- the turbulence of the texture, min-value 0, max-value 1
- See Also:
- getTurbulence()
 
 - 
getTurbulencepublic float getTurbulence() Returns the turbulence of the effect.- Returns:
- the turbulence of the effect.
- See Also:
- setTurbulence(float)
 
 - 
setAmountpublic void setAmount(float amount) Set the amount of effect.- Parameters:
- amount- the amount, min-value 0, max-value 1
- See Also:
- getAmount()
 
 - 
getAmountpublic float getAmount() Get the amount of effect.- Returns:
- the amount
- See Also:
- setAmount(float)
 
 - 
setDispersionpublic void setDispersion(float dispersion) Set the dispersion.- Parameters:
- dispersion- the dispersion, min-value 0, max-value 1
- See Also:
- getDispersion()
 
 - 
getDispersionpublic float getDispersion() Get the dispersion.- Returns:
- the dispersion
- See Also:
- setDispersion(float)
 
 - 
setTimepublic void setTime(float time) Set the time. Use this to animate the effect.- Parameters:
- time- the time
- See Also:
- getTime()
 
 - 
getTimepublic float getTime() Set the time.- Returns:
- the time
- See Also:
- setTime(float)
 
 - 
setSamplespublic 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()
 
 - 
getSamplespublic int getSamples() Get the number of samples per pixel.- Returns:
- the number of samples
- See Also:
- setSamples(int)
 
 - 
setBgColorpublic void setBgColor(int c) Set the background color.- Parameters:
- c- the color
- See Also:
- getBgColor()
 
 - 
getBgColorpublic int getBgColor() Get the background color.- Returns:
- the color
- See Also:
- setBgColor(int)
 
 - 
filterPixelsprotected int[] filterPixels(int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)Description copied from class:WholeImageFilterActually filter the pixels.- Specified by:
- filterPixelsin class- WholeImageFilter
- Parameters:
- width- the image width
- height- the image height
- inPixels- the image pixels
- transformedSpace- the output bounds
- Returns:
- the output pixels
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-