This class creates a RenderedImage in conformance to the one defined for the feTurbulence filter of the SVG specification. What follows is my high-level description of how the noise is generated. This is not contained in the SVG spec, just the algorithm for doing it. This is provided in the hope that someone will figure out a clever way to accelerate parts of the function. gradient contains a long list of random unit vectors. For each point we are to generate noise for we do two things. first we use the latticeSelector to 'co-mingle' the integer portions of x and y (this allows us to have a one-dimensional array of gradients that appears 2 dimensional, by using the co-mingled index). We do this for [x,y], [x+1,y], [x,y+1], and [x+1, y+1], this gives us the four gradient vectors that surround the point (b00, b10, ...) Next we construct the four vectors from the grid points (where the gradient vectors are defined) [these are rx0, rx1, ry0, ry1]. We then take the dot product between the gradient vectors and the grid point vectors (this gives the portion of the grid point vector that projects along the gradient vector for each grid point). These four dot projects are then combined with linear interpolation. The weight factor for the linear combination is the result of applying the 's' curve function to the fractional part of x and y (rx0, ry0). The S curve function get's it's name because it looks a bit like as 'S' from 0->1.
@author
Vincent Hardy
@author
Thomas DeWeese
@version $Id: TurbulencePatternRed.java,v 1.4 2004/10/30 18:38:05 deweese Exp $