org.apache.batik.refimpl.gvt.filter
Class TurbulencePatternGenerator
java.lang.Object
|
+--org.apache.batik.refimpl.gvt.filter.TurbulencePatternGenerator
- public final class TurbulencePatternGenerator
- extends java.lang.Object
This class creates a noise pattern conform to the one defined for
the feTurbulence filter of the SVG specification. It can be used by
classes implementing specific interfaces, such as the TurbulenceOp
and TurbulencePaintContext classes.
Constructor Summary |
TurbulencePatternGenerator(double baseFrequencyX,
double baseFrequencyY,
int numOctaves,
int seed,
boolean stitchTiles,
boolean isFractalNoise,
boolean isLinearRGB,
java.awt.geom.Rectangle2D tile,
boolean[] channels)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TurbulencePatternGenerator
public TurbulencePatternGenerator(double baseFrequencyX,
double baseFrequencyY,
int numOctaves,
int seed,
boolean stitchTiles,
boolean isFractalNoise,
boolean isLinearRGB,
java.awt.geom.Rectangle2D tile,
boolean[] channels)
- Parameters:
baseFrequencyX
- x-axis base frequency for the noise function along the x-axisbaseFrequencyY
- y-axis base frequency for the noise function along the x-axisnumOctaves
- number of octaves in the noise function. Positive integral value.seed
- starting number for the pseudo random number generatorstitchTiles
- defines whether frequencies should be adjusted so as to avoid
discontinuities.isFractalNoise
- defines whether the filter performs a fractal noise or a turbulence function.isLinearRGB
- defines whether the filter computes sRGB or linear RGB values.tile
- defines the tile size. May be null if stitchTiles is false. Otherwise, should
not be null.channels
- boolean array defining which of the sRGB channels should contain noise. 0 is red,
1 is green, 2 is blue and 3 is alpha.
getBaseFrequencyX
public double getBaseFrequencyX()
getBaseFrequencyY
public double getBaseFrequencyY()
getNumOctaves
public int getNumOctaves()
getSeed
public int getSeed()
isStitchTiles
public boolean isStitchTiles()
getTile
public java.awt.geom.Rectangle2D getTile()
isFractalNoise
public boolean isFractalNoise()
isLinearRGB
public boolean isLinearRGB()
getChannels
public boolean[] getChannels()
setupSeed
public final int setupSeed(int seed)
random
public final int random(int seed)
generatePattern
public void generatePattern(java.awt.image.WritableRaster dest,
java.awt.geom.AffineTransform txf)
- Generates a Perlin noise pattern into dest Raster.
- Parameters:
txf
- image space to noise space transform. The 'noise space' is the
space where the spatial characteristics of the noise are defined.des
- Raster where the pattern should be generated.
Copyright © 2000 Apache Software Foundation. All Rights Reserved.