org.apache.batik.ext.awt.image.rendered
Class TurbulencePatternGenerator

java.lang.Object
  |
  +--org.apache.batik.ext.awt.image.rendered.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, java.awt.geom.Rectangle2D tile, boolean[] channels)
           
 
Method Summary
 void generatePattern(java.awt.image.WritableRaster dest, java.awt.geom.AffineTransform txf)
          Generates a Perlin noise pattern into dest Raster.
 double getBaseFrequencyX()
           
 double getBaseFrequencyY()
           
 boolean[] getChannels()
           
 int getNumOctaves()
           
 int getSeed()
           
 java.awt.geom.Rectangle2D getTile()
           
 boolean isFractalNoise()
           
 boolean isStitchTiles()
           
 int random(int seed)
           
 int setupSeed(int seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TurbulencePatternGenerator

public TurbulencePatternGenerator(double baseFrequencyX,
                                  double baseFrequencyY,
                                  int numOctaves,
                                  int seed,
                                  boolean stitchTiles,
                                  boolean isFractalNoise,
                                  java.awt.geom.Rectangle2D tile,
                                  boolean[] channels)
Parameters:
baseFrequencyX - x-axis base frequency for the noise function along the x-axis
baseFrequencyY - y-axis base frequency for the noise function along the x-axis
numOctaves - number of octaves in the noise function. Positive integral value.
seed - starting number for the pseudo random number generator
stitchTiles - defines whether frequencies should be adjusted so as to avoid discontinuities.
isFractalNoise - defines whether the filter performs a fractal noise or a turbulence function.
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.
Method Detail

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()

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 © 2001 Apache Software Foundation. All Rights Reserved.