Class CellularFilter

    • Field Detail

      • scale

        protected float scale
      • stretch

        protected float stretch
      • angle

        protected float angle
      • amount

        public float amount
      • turbulence

        public float turbulence
      • gain

        public float gain
      • bias

        public float bias
      • distancePower

        public float distancePower
      • useColor

        public boolean useColor
      • coefficients

        protected float[] coefficients
      • angleCoefficient

        protected float angleCoefficient
      • random

        protected java.util.Random random
      • m00

        protected float m00
      • m01

        protected float m01
      • m10

        protected float m10
      • m11

        protected float m11
      • randomness

        protected float randomness
      • gridType

        protected int gridType
    • Constructor Detail

      • CellularFilter

        public CellularFilter()
    • Method Detail

      • 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)
      • setCoefficient

        public void setCoefficient​(int i,
                                   float v)
      • getCoefficient

        public float getCoefficient​(int i)
      • setAngleCoefficient

        public void setAngleCoefficient​(float angleCoefficient)
      • getAngleCoefficient

        public float getAngleCoefficient()
      • setGradientCoefficient

        public void setGradientCoefficient​(float gradientCoefficient)
      • getGradientCoefficient

        public float getGradientCoefficient()
      • setF1

        public void setF1​(float v)
      • getF1

        public float getF1()
      • setF2

        public void setF2​(float v)
      • getF2

        public float getF2()
      • setF3

        public void setF3​(float v)
      • getF3

        public float getF3()
      • setF4

        public void setF4​(float v)
      • getF4

        public float getF4()
      • setColormap

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

        public void setRandomness​(float randomness)
      • getRandomness

        public float getRandomness()
      • setGridType

        public void setGridType​(int gridType)
      • getGridType

        public int getGridType()
      • setDistancePower

        public void setDistancePower​(float distancePower)
      • getDistancePower

        public float getDistancePower()
      • setTurbulence

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

        public float getTurbulence()
        Returns the turbulence of the effect.
        Returns:
        the turbulence of the effect.
        See Also:
        setTurbulence(float)
      • 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)
      • evaluate

        public float evaluate​(float x,
                              float y)
        Specified by:
        evaluate in interface Function2D
      • turbulence2

        public float turbulence2​(float x,
                                 float y,
                                 float freq)
      • getPixel

        public int getPixel​(int x,
                            int y,
                            int[] inPixels,
                            int width,
                            int height)
      • filterPixels

        protected int[] filterPixels​(int width,
                                     int height,
                                     int[] inPixels,
                                     java.awt.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object