Packagede.popforge.imageprocessing.filters.color
Classpublic final class ContrastCorrection
InheritanceContrastCorrection Inheritance LUTFilter

The ContrastCorrection class is a filter that levels the contrast in an image. This is a look-up table based filter but can not be cached.

The formula of this filter is new = contrast * ( old - mean ) + mean.

Supported formats:


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

See also

de.popforge.imageprocessing.filters.color.QuickContrastCorrection


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
  
ContrastCorrection(contrast:Number = 1.2)
Creates a new ContrastCorrection object with given contrast value.
ContrastCorrection
  
apply(image:Image):void
Applies the filter to the given Image object.
ContrastCorrection
  
toString():String
Builds and returns a string containing the name of the class.
ContrastCorrection
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
Constructor detail
ContrastCorrection()constructor
public function ContrastCorrection(contrast:Number = 1.2)

Creates a new ContrastCorrection object with given contrast value.

Parameters
contrast:Number (default = 1.2) — The contrast value. Values greater 1 add contrast, values lower 1 remove contrast.
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.