| Package | graphics.display |
| Class | public class PerlinNoiseBitmapData |
| Inheritance | PerlinNoiseBitmapData flash.display.BitmapData |
The Perlin noise generation algorithm interpolates and combines individual random noise functions (called octaves) into a single function that generates more natural-seeming random noise. Like musical octaves, each octave function is twice the frequency of the one before it. Perlin noise has been described as a "fractal sum of noise" because it combines multiple sets of noise data with different levels of detail.
| Property | Defined By | ||
|---|---|---|---|
| baseX : Number
Frequency to use in the x direction. | PerlinNoiseBitmapData | ||
| baseY : Number
Frequency to use in the y direction. | PerlinNoiseBitmapData | ||
| channels : uint = 7
A number that can be a combination of any of the four color channel values ( BitmapDataChannel.RED , BitmapDataChannel.BLUE , BitmapDataChannel.GREEN , and BitmapDataChannel.ALPHA ). | PerlinNoiseBitmapData | ||
| density : Number
Set the density of the frequency to use in the x and y direction. | PerlinNoiseBitmapData | ||
| fractal : Boolean = true
A Boolean value. | PerlinNoiseBitmapData | ||
| greyScale : Boolean
A Boolean value. | PerlinNoiseBitmapData | ||
| octaves : uint
Number of octaves or individual noise functions to combine to create this noise. | PerlinNoiseBitmapData | ||
| seed : int
The random seed number to use. | PerlinNoiseBitmapData | ||
| stitch : Boolean
A Boolean value. | PerlinNoiseBitmapData | ||
| Method | Defined By | ||
|---|---|---|---|
PerlinNoiseBitmapData(width:int, height:int, transparent:Boolean = true, fillColor:uint = 0xFFFFFFFF)
Creates a new PerlinNoiseBitmapData instance. | PerlinNoiseBitmapData | ||
move(x:Number, y:Number, octave:int = -1):void
Move the frequency of all octaves. | PerlinNoiseBitmapData | ||
render():void
Render the perlin noise effect. | PerlinNoiseBitmapData | ||
| baseX | property |
public var baseX:NumberFrequency to use in the x direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 64 for the baseX value.
| baseY | property |
public var baseY:NumberFrequency to use in the y direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 128 for the baseY value.
| channels | property |
public var channels:uint = 7A number that can be a combination of any of the four color channel values ( BitmapDataChannel.RED , BitmapDataChannel.BLUE , BitmapDataChannel.GREEN , and BitmapDataChannel.ALPHA ). You can use the logical OR operator ( | ) to combine channel values.
| density | property |
density:NumberSet the density of the frequency to use in the x and y direction.
public function get density():Number public function set density(value:Number):void| fractal | property |
public var fractal:Boolean = trueA Boolean value. If the value is true , the method generates fractal noise; otherwise, it generates turbulence. An image with turbulence has visible discontinuities in the gradient that can make it better approximate sharper visual effects like flames and ocean waves.
| greyScale | property |
public var greyScale:BooleanA Boolean value. If the value is true, a grayscale image is created by setting each of the red, green, and blue color channels to identical values. The alpha channel value is not affected if this value is set to true .
| octaves | property |
octaves:uintNumber of octaves or individual noise functions to combine to create this noise.
Larger numbers of octaves create images with greater detail. Larger numbers of octaves also require more processing time.
public function get octaves():uint public function set octaves(value:uint):void| seed | property |
public var seed:intThe random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The Perlin noise function is a mapping function, not a true random-number generation function, so it creates the same results each time from the same random seed.
| stitch | property |
public var stitch:BooleanA Boolean value. If the value is true , the method attempts to smooth the transition edges of the image to create seamless textures for tiling as a bitmap fill.
| PerlinNoiseBitmapData | () | Constructor |
public function PerlinNoiseBitmapData(width:int, height:int, transparent:Boolean = true, fillColor:uint = 0xFFFFFFFF)Creates a new PerlinNoiseBitmapData instance.
Parameterswidth:int — The width of the bitmap image in pixels.
| |
height:int — The height of the bitmap image in pixels.
| |
transparent:Boolean (default = true) — Specifies whether the bitmap image supports per-pixel transparency. The default value is true (transparent). To create a fully transparent bitmap, set the value of the transparent parameter to true and the value of the fillColor parameter to 0x00000000 (or to 0). Setting the transparent property to false can result in minor improvements in rendering performance.
| |
fillColor:uint (default = 0xFFFFFFFF) — A 32-bit ARGB color value that you use to fill the bitmap image area. The default value is 0xFFFFFFFF (solid white).
|
ArgumentError — width and/or height exceed the maximum dimensions.
|
| move | () | method |
public function move(x:Number, y:Number, octave:int = -1):voidMove the frequency of all octaves.
Parameters
x:Number | |
y:Number | |
octave:int (default = -1) |
| render | () | method |
public function render():voidRender the perlin noise effect.