The ColorMatrixFilter object lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values. It allows saturation changes, hue rotation, luminance to alpha, and various other effects. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject object), such as TextField, as well as to BitmapData objects.

Note: For RGBA values, the most significant byte represents the red channel value, followed by green, blue, and then alpha.


To create a new color matrix filter, use the syntax new ColorMatrixFilter(). The use of filters depends on the object to which you apply the filter:


To apply filters use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property.

To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result.

If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you remove all filters, the original value of cacheAsBitmap is restored.


A filter is not applied if the resulting image exceeds the maximum dimensions.


Can be created with method new:

Lib.Media.Filters.ColorMatrixFilter.new(matrix)

Initializes a new ColorMatrixFilter instance with the specified parameters.

matrix - (default = nil) - An array of 20 items arranged as a 4 x 5 matrix.


Created ColorMatrixFilter object has properties:

matrix

An array of 20 items for 4 x 5 color transform.


methods:

clone()

Returns a copy of this filter object.


Created with the Personal Edition of HelpNDoc: Easily create EBooks