Packagede.popforge.imageprocessing.filters.color
Classpublic final class Extract
InheritanceExtract Inheritance LUTFilter

The Extract class is a filter that extracts a given color. This is a look-up table based filter.

The formula of this filter is new = ( old == color ) ? color : 0x00.

Supported formats:


Example
  
  var filter: Extract = new Extract( 0xffffff, true );
  
  var video: WebCam = new WebCam( 160, 120 );
  var image: Image = new Image( 160, 120, ImageFormat.RGB );
  
  image.loadBitmapData( video.getCurrentFrame(), true );
  
  filter.apply( image );
  



Public Properties
 PropertyDefined by
  color : int
The color you want to extract This property has no effect if you set cache to true.
Extract
Protected Properties
 PropertyDefined by
 Inheritedcache : Boolean
The caching value.
LUTFilter
 Inheritedtables : Array
The look-up tables stored in an array.
LUTFilter
Public Methods
 MethodDefined by
  
Extract(color:int = 0xffffff, cache:Boolean = true)
Creates a new Extract object.
Extract
  
apply(image:Image):void
Applies the filter to the given Image object.
Extract
  
toString():String
Builds and returns a string containing the name of the class.
Extract
Protected Methods
 MethodDefined by
 Inherited
buildTables(image:Image):void
This function creates the amount of necessary look-up tables.
LUTFilter
 Inherited
getArray():Array
Creates a new look-up table.
LUTFilter
Property detail
colorproperty
public var color:int

The color you want to extract This property has no effect if you set cache to true.

Constructor detail
Extract()constructor
public function Extract(color:int = 0xffffff, cache:Boolean = true)

Creates a new Extract object.

Parameters
color:int (default = 0xffffff) — Set to true if you want to cache the look-up table.
 
cache:Boolean (default = true) — The color you want to extract. 24-BIT integer for RGB images, 32-BIT for RGBA and 8-BIT for grayscale.
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.