Class FBMFilter

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

    public class FBMFilter
    extends PointFilter
    implements java.lang.Cloneable
    A filter which produces textures from fractal Brownian motion.
    • Constructor Detail

      • FBMFilter

        public FBMFilter()
    • Method Detail

      • setAmount

        public void setAmount​(float amount)
        Set the amount of effect.
        Parameters:
        amount - the amount, min-value 0, max-value 1
        See Also:
        getAmount()
      • getAmount

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

        public void setOperation​(int operation)
      • getOperation

        public int getOperation()
      • setScale

        public 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()
      • getScale

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

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

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

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

        public float getAngle()
        Returns the angle of the texture.
        Returns:
        the angle of the texture.
        See Also:
        setAngle(float)
      • setOctaves

        public void setOctaves​(float octaves)
      • getOctaves

        public float getOctaves()
      • setH

        public void setH​(float H)
      • getH

        public float getH()
      • setLacunarity

        public void setLacunarity​(float lacunarity)
      • getLacunarity

        public float getLacunarity()
      • setGain

        public void setGain​(float gain)
      • getGain

        public float getGain()
      • setBias

        public void setBias​(float bias)
      • getBias

        public float getBias()
      • setColormap

        public void setColormap​(Colormap colormap)
        Set the colormap to be used for the filter.
        Parameters:
        colormap - the colormap
        See Also:
        getColormap()
      • setBasisType

        public void setBasisType​(int basisType)
      • getBasisType

        public int getBasisType()
      • setBasis

        public void setBasis​(Function2D basis)
      • makeFBM

        protected FBM makeFBM​(float H,
                              float lacunarity,
                              float octaves)
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
        Specified by:
        filter in interface java.awt.image.BufferedImageOp
        Overrides:
        filter in class PointFilter
      • filterRGB

        public int filterRGB​(int x,
                             int y,
                             int rgb)
        Specified by:
        filterRGB in class PointFilter
      • toString

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