Packagecom.flashdynamix.motion.effects
Classpublic dynamic class PerlinDisplacementEffect
InheritancePerlinDisplacementEffect Inheritance DisplacementEffect Inheritance FilterEffect Inheritance flash.utils.Proxy
ImplementsIEffect

Applies a DisplacementMapFilter using Perlin noise to a BitmapData



Public Properties
 PropertyDefined by
  baseX : int = 30
Frequency to use in the x direction.
For example, to generate a noise that is sized for a 64 x 128 image, pass the pixel width of 64 for the baseX value.
PerlinDisplacementEffect
  baseY : int = 40
Frequency to use in the y direction.
For example, to generate a noise that is sized for a 64 x 128 image, pass the pixel height of 128 for the baseY value.
PerlinDisplacementEffect
  channelOptions : uint = 1.0
The Channels which are rendered with the perlin noise :
  • BitmapDataChannel.ALPHA
  • BitmapDataChannel.BLUE
  • BitmapDataChannel.GREEN
  • BitmapDataChannel.RED
PerlinDisplacementEffect
 Inheritedfilter : BitmapFilter
The BitmapFilter to apply onto the BitmapData.
FilterEffect
  fractalNoise : Boolean = false
If the value is true, the method generates fractal noise; otherwise, it generates turbulence.
PerlinDisplacementEffect
  grayScale : Boolean = false
Sets the perlin noise to render in grayscale.
PerlinDisplacementEffect
 InheritedmapBmd : BitmapData
The displacement BitmapData to be used.
DisplacementEffect
 InheritedmapPoint : Point
The position of the displacement mapBmd.
DisplacementEffect
  movement : String
[write-only] Sets the movement type which will be applied on the displacement
These options include :
  • DIRECTION
  • ORBIT
PerlinDisplacementEffect
 Inheritedpt : Point
The Point from which to apply the BitmapFilter
FilterEffect
  radiusX : Number = 3
The radiusX in pixels to be applied on to the displacement when the movement type is ORBIT.
PerlinDisplacementEffect
  radiusY : Number = 3
The radiusY in pixels to be applied on to the displacement when the movement type is ORBIT.
PerlinDisplacementEffect
  seed : int = 1
The random seed number to generate the perlin noise.
PerlinDisplacementEffect
  speedX : Number = 0.01
The x speed direction the displacement is offsetted by on each render.
The direction depends on the movement type.
When the movement type is ORBIT it effects the speed of rotation in the x direction.
When the movement type is DIRECTION it effects the offset speed in the x direction.
PerlinDisplacementEffect
  speedY : Number = 0.01
The y speed direction the displacement is offsetted by on each render.
PerlinDisplacementEffect
  stitch : Boolean = true
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.
PerlinDisplacementEffect
Public Methods
 MethodDefined by
  
PerlinDisplacementEffect(width:int = 500, height:int = 500, scaleX:Number = 3, scaleY:Number = 3, octives:int = 2)
PerlinDisplacementEffect
  
render(bmd:BitmapData):void
Renders the PerlinDisplacementEffect on to the specified BitmapData.
PerlinDisplacementEffect
Protected Methods
 MethodDefined by
 Inherited
getProperty(name:*):*
FilterEffect
 Inherited
setProperty(name:*, value:*):void
FilterEffect
Public Constants
 ConstantDefined by
  DIRECTION : String = "direction"
[static] An option for the movement option on the displacement
This will move the displacement in the x,y direction specified by the speedX and speedY.
PerlinDisplacementEffect
  ORBIT : String = "orbit"
[static] An option for the movement option on the displacement.
This will move the displacement in an orbit path along the radiusX and radiusY.
Rotating in an x direction and y direction specified by the speedX and speedY.
PerlinDisplacementEffect
Property detail
baseXproperty
public var baseX:int = 30

Frequency to use in the x direction.
For example, to generate a noise that is sized for a 64 x 128 image, pass the pixel width of 64 for the baseX value.

baseYproperty 
public var baseY:int = 40

Frequency to use in the y direction.
For example, to generate a noise that is sized for a 64 x 128 image, pass the pixel height of 128 for the baseY value.

channelOptionsproperty 
public var channelOptions:uint = 1.0

The Channels which are rendered with the perlin noise :

fractalNoiseproperty 
public var fractalNoise:Boolean = false

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.

grayScaleproperty 
public var grayScale:Boolean = false

Sets the perlin noise to render in grayscale.

movementproperty 
movement:String  [write-only]

Sets the movement type which will be applied on the displacement
These options include :

Implementation
    public function set movement(value:String):void
radiusXproperty 
public var radiusX:Number = 3

The radiusX in pixels to be applied on to the displacement when the movement type is ORBIT.

radiusYproperty 
public var radiusY:Number = 3

The radiusY in pixels to be applied on to the displacement when the movement type is ORBIT.

seedproperty 
public var seed:int = 1

The random seed number to generate the perlin noise.

speedXproperty 
public var speedX:Number = 0.01

The x speed direction the displacement is offsetted by on each render.
The direction depends on the movement type.
When the movement type is ORBIT it effects the speed of rotation in the x direction.
When the movement type is DIRECTION it effects the offset speed in the x direction.

speedYproperty 
public var speedY:Number = 0.01

The y speed direction the displacement is offsetted by on each render. The direction depends on the movement type.
When the movement type is ORBIT it effects the speed of rotation in the y direction.
When the movement type is DIRECTION it effects the offset speed in the y direction.

stitchproperty 
public var stitch:Boolean = true

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.

Constructor detail
PerlinDisplacementEffect()constructor
public function PerlinDisplacementEffect(width:int = 500, height:int = 500, scaleX:Number = 3, scaleY:Number = 3, octives:int = 2)

Parameters
width:int (default = 500) — The width in pixels to render the perlin noise.
 
height:int (default = 500) — The height in pixels to render the perlin noise.
 
scaleX:Number (default = 3) — The multiplier to use to scale the x displacement result from the map calculation.
 
scaleY:Number (default = 3) — The multiplier to use to scale the y displacement result from the map calculation.
 
octives:int (default = 2) — Number of octaves or individual noise functions to combine to create this noise.
Method detail
render()method
public override function render(bmd:BitmapData):void

Renders the PerlinDisplacementEffect on to the specified BitmapData.

Parameters
bmd:BitmapData
Constant detail
DIRECTIONconstant
public static const DIRECTION:String = "direction"

An option for the movement option on the displacement
This will move the displacement in the x,y direction specified by the speedX and speedY.

ORBITconstant 
public static const ORBIT:String = "orbit"

An option for the movement option on the displacement.
This will move the displacement in an orbit path along the radiusX and radiusY.
Rotating in an x direction and y direction specified by the speedX and speedY.