Packagede.popforge.imageprocessing.filters.color
Classpublic final class BrightnessCorrection
InheritanceBrightnessCorrection Inheritance LUTFilter

The BrightnessCorrection class is a filter that adds or removes brightness from an image. This is a look-up table based filter.

The formula of this filter is new = clamp( old + brightness ).

Supported formats:


Example
  
  var filter: BrightnessCorrection = new BrightnessCorrection( 0x40, 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
  brightness : int
The brightness value from 0x00 to 0xff.
BrightnessCorrection
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
  
BrightnessCorrection(brightness:int = 0x40, cache:Boolean = true)
Creates a new BrightnessCorrection object with given brightness value.
BrightnessCorrection
  
apply(image:Image):void
Applies the filter to the given Image object.
BrightnessCorrection
  
toString():String
Builds and returns a string containing the name of the class.
BrightnessCorrection
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
brightnessproperty
public var brightness:int

The brightness value from 0x00 to 0xff. This value has no effect if you set cache to true.

Constructor detail
BrightnessCorrection()constructor
public function BrightnessCorrection(brightness:int = 0x40, cache:Boolean = true)

Creates a new BrightnessCorrection object with given brightness value.

Parameters
brightness:int (default = 0x40) — Set to true if you want to cache the look-up table.
 
cache:Boolean (default = true) — The brightness value you want to add or substract (0x00 to 0xff).
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.