Package | com.boostworthy.geom |
Class | public class ColorMatrix |
Inheritance | ColorMatrix ![]() |
The general mindset behind the calculations for a color matrix are as follows:
redResult = (a[0] srcR) + (a[1] srcG) + (a[2] srcB) + (a[3] srcA) + a[4]
greenResult = (a[5] srcR) + (a[6] srcG) + (a[7] srcB) + (a[8] srcA) + a[9]
blueResult = (a[10] srcR) + (a[11] srcG) + (a[12] srcB) + (a[13] srcA) + a[14]
alphaResult = (a[15] srcR) + (a[16] srcG) + (a[17] srcB) + (a[18] srcA) + a[19]
For more information on the formulas used in this class, see:
http://www.graficaobscura.com/matrix/index.html
Property | Defined by | ||
---|---|---|---|
alpha : Number
Gets the current alpha setting.
| ColorMatrix | ||
brightness : Number
Gets the current brightness setting.
| ColorMatrix | ||
contrast : Number
Gets the current contrast setting.
| ColorMatrix | ||
hue : Number
Gets the current hue setting.
| ColorMatrix | ||
saturation : Number
Gets the current saturation setting.
| ColorMatrix |
Property | Defined by | ||
---|---|---|---|
m_aMatrix : Array
Stores the current matrix of values that this object represents.
| ColorMatrix | ||
m_nAlpha : Number
Stores the current alpha setting.
| ColorMatrix | ||
m_nBrightness : Number
Stores the current brightness setting.
| ColorMatrix | ||
m_nContrast : Number
Stores the current contrast setting.
| ColorMatrix | ||
m_nHue : Number
Stores the current hue setting.
| ColorMatrix | ||
m_nSaturation : Number
Stores the current saturation setting.
| ColorMatrix |
Method | Defined by | ||
---|---|---|---|
ColorMatrix(aMatrix:Array = null)
Constructor.
| ColorMatrix | ||
Creates a new color matrix object that is a clone of this object.
| ColorMatrix | ||
reset():void
Resets this object back to it's original state.
| ColorMatrix | ||
valueOf():Array
Returns the raw array of color transform data that this object represents.
| ColorMatrix |
Method | Defined by | ||
---|---|---|---|
init(aMatrix:Array):void
Initializes this object.
| ColorMatrix | ||
multiply(aMatrix:Array):void
Multiplies the specified matrix array against the one this object represents.
| ColorMatrix | ||
setDefaultValues():void
Applies all default values to the corresponding properties.
| ColorMatrix |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when the value of this object changes. | ColorMatrix |
Constant | Defined by | ||
---|---|---|---|
IDENTITY : Array
The default matrix for this object to begin at.
| ColorMatrix | ||
LUMINANCE_B : Number = 0.072169
Configuration for the blue portion of the luminance vector.
| ColorMatrix | ||
LUMINANCE_G : Number = 0.715160
Configuration for the green portion of the luminance vector.
| ColorMatrix | ||
LUMINANCE_R : Number = 0.212671
Configuration for the red portion of the luminance vector.
| ColorMatrix |
alpha | property |
alpha:Number
[read-write]Gets the current alpha setting.
Implementation public function get alpha():Number
public function set alpha(value:Number):void
brightness | property |
brightness:Number
[read-write]Gets the current brightness setting.
Implementation public function get brightness():Number
public function set brightness(value:Number):void
contrast | property |
contrast:Number
[read-write]Gets the current contrast setting.
Implementation public function get contrast():Number
public function set contrast(value:Number):void
hue | property |
hue:Number
[read-write]Gets the current hue setting.
Implementation public function get hue():Number
public function set hue(value:Number):void
m_aMatrix | property |
protected var m_aMatrix:Array
Stores the current matrix of values that this object represents.
m_nAlpha | property |
protected var m_nAlpha:Number
Stores the current alpha setting.
m_nBrightness | property |
protected var m_nBrightness:Number
Stores the current brightness setting.
m_nContrast | property |
protected var m_nContrast:Number
Stores the current contrast setting.
m_nHue | property |
protected var m_nHue:Number
Stores the current hue setting.
m_nSaturation | property |
protected var m_nSaturation:Number
Stores the current saturation setting.
saturation | property |
saturation:Number
[read-write]Gets the current saturation setting.
Implementation public function get saturation():Number
public function set saturation(value:Number):void
ColorMatrix | () | constructor |
public function ColorMatrix(aMatrix:Array = null)
Constructor.
ParametersaMatrix:Array (default = null ) — An array of 20 items for 4 x 5 color transform to initialize this object with.
|
clone | () | method |
public function clone():ColorMatrix
Creates a new color matrix object that is a clone of this object.
ReturnsColorMatrix —
A new color matrix object.
|
init | () | method |
protected function init(aMatrix:Array):void
Initializes this object.
ParametersaMatrix:Array — An array of 20 items for 4 x 5 color transform to initialize this object with.
|
multiply | () | method |
protected function multiply(aMatrix:Array):void
Multiplies the specified matrix array against the one this object represents.
ParametersaMatrix:Array — An array of 20 items for 4 x 5 color transform to multiply against this object's matrix array.
|
reset | () | method |
public function reset():void
Resets this object back to it's original state.
setDefaultValues | () | method |
protected function setDefaultValues():void
Applies all default values to the corresponding properties.
valueOf | () | method |
public function valueOf():Array
Returns the raw array of color transform data that this object represents.
ReturnsArray — A copy of the color transform matrix that this object represents.
|
change | event |
IDENTITY | constant |
protected const IDENTITY:Array
The default matrix for this object to begin at.
LUMINANCE_B | constant |
protected const LUMINANCE_B:Number = 0.072169
Configuration for the blue portion of the luminance vector.
LUMINANCE_G | constant |
protected const LUMINANCE_G:Number = 0.715160
Configuration for the green portion of the luminance vector.
LUMINANCE_R | constant |
protected const LUMINANCE_R:Number = 0.212671
Configuration for the red portion of the luminance vector.