Packagede.popforge.imageprocessing.filters.convolution
Classpublic final class QuickNormalMap
InheritanceQuickNormalMap Inheritance Convolution Inheritance NativeFilter

The QuickNormalMap class is a filter that uses a convolution matrix to create a normal map out of a given bump map.

Instead of having to calculate this on a pixel level there is a solution using a ConvolutionMatrix for the x direction and another one for the y direction. Using the ConvolutionMatrix replaces a lot of getPixel() calls and makes it possible to use this filter at runtime.

This approach comes from Ralph Hauwert.

Supported formats:


Example
  
  var filter: QuickNormalMap = new QuickNormalMap();
  var image: Image = Image.fromBitmapData( bumpMap, ImageFormat.RGB );
  
  filter.apply( image );
  

See also

Ralph Hauwert´s blog
de.popforge.imageprocessing.filters.distortion.QuickBumpMap


Protected Properties
 PropertyDefined by
 Inheritedfilter : BitmapFilter
The native filter that will be overridden by a subclass of NativeFilter.
NativeFilter
Public Methods
 MethodDefined by
  
Creates a new QuickNormalMap object.
QuickNormalMap
  
apply(image:Image):void
Applies the filter to the given Image object.
QuickNormalMap
  
toString():String
Builds and returns a string containing the name of the class.
QuickNormalMap
Public Constants
 ConstantDefined by
  COMPONENT_X : int = 1
[static] The value that a displacement map should use as the x component.
QuickNormalMap
  COMPONENT_Y : int = 2
[static] The value that a displacement map should use as the y component.
QuickNormalMap
Constructor detail
QuickNormalMap()constructor
public function QuickNormalMap()

Creates a new QuickNormalMap object.

Method detail
apply()method
public override function apply(image:Image):void

Applies the filter to the given Image object.

Parameters
image:Image — The image that will be manipulated.
toString()method 
public override function toString():String

Builds and returns a string containing the name of the class.

Returns
String — A string containing the name of the class.
Constant detail
COMPONENT_Xconstant
public static const COMPONENT_X:int = 1

The value that a displacement map should use as the x component.

COMPONENT_Yconstant 
public static const COMPONENT_Y:int = 2

The value that a displacement map should use as the y component.