EventDispatcher |
ColorMatrix |
The ‘ColorMatrix’ class presents a useful API for transforming color values using traditional methods such as brightness, contrast, hue, and saturation. <p> The general mindset behind the calculations for a color matrix are as follows: <p> redResult = (a[0] * srcR) + (a[1] * srcG) + (a[2] * srcB) + (a[3] * srcA) + a[4] <br> greenResult = (a[5] * srcR) + (a[6] * srcG) + (a[7] * srcB) + (a[8] * srcA) + a[9] <br> blueResult = (a[10] * srcR) + (a[11] * srcG) + (a[12] * srcB) + (a[13] * srcA) + a[14] <br> alphaResult = (a[15] * srcR) + (a[16] * srcG) + (a[17] * srcB) + (a[18] * srcA) + a[19] <p> For more information on the formulas used in this class, see: <p> http://www.graficaobscura.com/matrix/index.html
ColorMatrix | The ‘ColorMatrix’ class presents a useful API for transforming color values using traditional methods such as brightness, contrast, hue, and saturation. |
Constants | |
LUMINANCE_R | Configuration for the red portion of the luminance vector. |
LUMINANCE_G | Configuration for the green portion of the luminance vector. |
LUMINANCE_B | Configuration for the blue portion of the luminance vector. |
IDENTITY | The default matrix for this object to begin at. |
Variables | |
m_aMatrix | Stores the current matrix of values that this object represents. |
m_nAlpha | Stores the current alpha setting. |
m_nBrightness | Stores the current brightness setting. |
m_nContrast | Stores the current contrast setting. |
m_nHue | Stores the current hue setting. |
m_nSaturation | Stores the current saturation setting. |
Functions | |
ColorMatrix | Constructor. |
valueOf | Returns the raw array of color transform data that this object represents. |
clone | Creates a new color matrix object that is a clone of this object. |
reset | Resets this object back to it’s original state. |
Properties | |
alpha | Gets the current alpha setting. |
alpha | Sets the current alpha setting. |
brightness | Gets the current brightness setting. |
brightness | Sets the current brightness setting. |
contrast | Gets the current contrast setting. |
contrast | Sets the current contrast setting. |
hue | Gets the current hue setting. |
hue | Sets the current hue setting. |
saturation | Gets the current saturation setting. |
saturation | Sets the current saturation setting. |
Functions | |
init | Initializes this object. |
setDefaultValues | Applies all default values to the corresponding properties. |
multiply | Multiplies the specified matrix array against the one this object represents. |
Configuration for the red portion of the luminance vector.
protected const LUMINANCE_R: Number
Configuration for the green portion of the luminance vector.
protected const LUMINANCE_G: Number
Configuration for the blue portion of the luminance vector.
protected const LUMINANCE_B: Number
The default matrix for this object to begin at.
protected const IDENTITY: Array
Stores the current matrix of values that this object represents.
protected var m_aMatrix: Array
Stores the current alpha setting.
protected var m_nAlpha: Number
Stores the current brightness setting.
protected var m_nBrightness: Number
Stores the current contrast setting.
protected var m_nContrast: Number
Stores the current hue setting.
protected var m_nHue: Number
Stores the current saturation setting.
protected var m_nSaturation: Number
Constructor.
public function ColorMatrix( aMatrix: Array = null )
Returns the raw array of color transform data that this object represents.
public function valueOf():Array
Creates a new color matrix object that is a clone of this object.
public function clone():ColorMatrix
Resets this object back to it’s original state.
public function reset():void
Gets the current alpha setting.
public function get alpha():Number
Gets the current brightness setting.
public function get brightness():Number
Gets the current contrast setting.
public function get contrast():Number
Gets the current hue setting.
public function get hue():Number
Gets the current saturation setting.
public function get saturation():Number
Initializes this object.
protected function init( aMatrix: Array ):void
Applies all default values to the corresponding properties.
protected function setDefaultValues():void
Multiplies the specified matrix array against the one this object represents.
protected function multiply( aMatrix: Array ):void