Package com.jhlabs.image
Class CellularFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.WholeImageFilter
com.jhlabs.image.CellularFilter
- All Implemented Interfaces:
Function2D,BufferedImageOp,Cloneable
- Direct Known Subclasses:
CrystallizeFilter,PointillizeFilter
A filter which produces an image with a cellular texture.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatprotected floatprotected floatfloatprotected float[]protected Colormapfloatfloatprotected intstatic final intprotected floatprotected floatprotected floatprotected floatstatic final intprotected Randomstatic final intprotected floatprotected CellularFilter.Point[]protected floatstatic final intprotected floatstatic final intfloatbooleanFields inherited from class com.jhlabs.image.WholeImageFilter
originalSpace, transformedSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()floatevaluate(float x, float y) protected int[]filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) Actually filter the pixels.floatGet the amount of texture.floatgetAngle()Returns the angle of the texture.floatfloatgetCoefficient(int i) Get the colormap to be used for the filter.floatfloatgetF1()floatgetF2()floatgetF3()floatgetF4()floatintintgetPixel(int x, int y, int[] inPixels, int width, int height) floatfloatgetScale()Returns the scale of the texture.floatReturns the stretch factor of the texture.floatReturns the turbulence of the effect.voidsetAmount(float amount) Set the amount of effect.voidsetAngle(float angle) Specifies the angle of the texture.voidsetAngleCoefficient(float angleCoefficient) voidsetCoefficient(int i, float v) voidsetColormap(Colormap colormap) Set the colormap to be used for the filter.voidsetDistancePower(float distancePower) voidsetF1(float v) voidsetF2(float v) voidsetF3(float v) voidsetF4(float v) voidsetGradientCoefficient(float gradientCoefficient) voidsetGridType(int gridType) voidsetRandomness(float randomness) voidsetScale(float scale) Specifies the scale of the texture.voidsetStretch(float stretch) Specifies the stretch factor of the texture.voidsetTurbulence(float turbulence) Specifies the turbulence of the texture.toString()floatturbulence2(float x, float y, float freq) Methods inherited from class com.jhlabs.image.WholeImageFilter
filter, transformSpaceMethods inherited from class com.jhlabs.image.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Field Details
-
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 -
colormap
-
coefficients
protected float[] coefficients -
angleCoefficient
protected float angleCoefficient -
random
-
m00
protected float m00 -
m01
protected float m01 -
m10
protected float m10 -
m11
protected float m11 -
results
-
randomness
protected float randomness -
gridType
protected int gridType -
RANDOM
public static final int RANDOM- See Also:
-
SQUARE
public static final int SQUARE- See Also:
-
HEXAGONAL
public static final int HEXAGONAL- See Also:
-
OCTAGONAL
public static final int OCTAGONAL- See Also:
-
TRIANGULAR
public static final int TRIANGULAR- See Also:
-
-
Constructor Details
-
CellularFilter
public CellularFilter()
-
-
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:
-
setStretch
public void setStretch(float stretch) Specifies the stretch factor of the texture.- Parameters:
stretch- the stretch factor of the texture.- See Also:
-
getStretch
public float getStretch()Returns the stretch factor of the texture.- Returns:
- the stretch factor of the texture.
- See Also:
-
setAngle
public void setAngle(float angle) Specifies the angle of the texture.- Parameters:
angle- the angle of the texture.- See Also:
-
getAngle
public float getAngle()Returns the angle of the texture.- Returns:
- the angle of the texture.
- See Also:
-
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
Set the colormap to be used for the filter.- Parameters:
colormap- the colormap- See Also:
-
getColormap
Get the colormap to be used for the filter.- Returns:
- the colormap
- See Also:
-
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.- 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 texture.- Returns:
- the amount
- See Also:
-
evaluate
public float evaluate(float x, float y) - Specified by:
evaluatein interfaceFunction2D
-
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
Description copied from class:WholeImageFilterActually filter the pixels.- Specified by:
filterPixelsin classWholeImageFilter- Parameters:
width- the image widthheight- the image heightinPixels- the image pixelstransformedSpace- the output bounds- Returns:
- the output pixels
-
clone
- Overrides:
clonein classAbstractBufferedImageOp
-
toString
-