TurbulencePrimitive Class
A primitive that fills its subregion with Perlin noise: feTurbulence of SVG.
public sealed class TurbulencePrimitive : FilterPrimitiveRemarks
The noise is the one of the reference code of "Filter Effects Module Level 1", transcribed: the same random numbers from the seed, the same lattice, the same gradients, the same octaves, with a separate noise for the red, the green, the blue and the alpha. A pixel takes the noise at the point of the drawing of its top left corner. The values are straight colors, clamped to the range from 0 to 1, in the colors of the primitive (linear light by default).
With TurbulencePrimitive.StitchTiles, the frequencies are adjusted so that the noise repeats with the size of the subregion (its FilterPrimitive.Subregion, or the region of the filter), and the lattice wraps there. The noise only involves additions, multiplications, divisions and square roots: it is the same on every platform. At most 32 octaves are computed: the others add less than 2^-32.
- Inheritance
FilterPrimitiveTurbulencePrimitive
Constructors
| Name | Description |
|---|---|
| TurbulencePrimitive(FilterTurbulenceType, double, double, int, int) | Initializes a new instance of the TurbulencePrimitive class. |
TurbulencePrimitive(FilterTurbulenceType, double, double, int, int)
TurbulencePrimitive.csInitializes a new instance of the TurbulencePrimitive class.
public TurbulencePrimitive(FilterTurbulenceType type, double baseFrequencyX, double baseFrequencyY, int octaves, int seed)Parameters
typeFilterTurbulenceType- The noise.
baseFrequencyXdouble- The frequency of the first octave along x, in cycles per unit of the drawing:
baseFrequency. baseFrequencyYdouble- The frequency of the first octave along y.
octavesint- The number of octaves:
numOctaves. Must be zero or positive. seedint- The seed of the random numbers:
seed, truncated to an integer.
Exceptions
ArgumentOutOfRangeExceptiontypeis not defined, a frequency is negative or not a finite number, oroctavesis negative.
Properties
| Name | Description |
|---|---|
| BaseFrequencyX | Gets the frequency of the first octave along x. |
| BaseFrequencyY | Gets the frequency of the first octave along y. |
| Octaves | Gets the number of octaves. |
| Seed | Gets the seed of the random numbers. |
| StitchTiles | Gets a value indicating whether the noise repeats with the size of the subregion: stitchTiles="stitch". |
| Type | Gets the noise. |