Drag[en]gine Game Engine
1.21
|
5x4 component color matrix in row major order. More...
#include <decColorMatrix.h>
Public Member Functions | |
Constructors and Destructors | |
decColorMatrix () | |
Create color matrix initialized to identity. More... | |
decColorMatrix (const decColorMatrix &m) | |
Create copy of a color matrix. More... | |
Management | |
void | SetIdentity () |
Set identity color matrix. More... | |
void | SetTranslation (float red, float green, float blue, float alpha) |
Set translation color matrix. More... | |
void | SetTranslation (const decColor &color) |
Set translation color matrix. More... | |
void | SetScaling (float sred, float sgreen, float sblue, float salpha) |
Set scaling color matrix. More... | |
void | SetScaling (const decColor &color) |
Set scaling color matrix. More... | |
void | SetST (const decColor &scale, const decColor &translate) |
Set scaling then translation color matrix. More... | |
void | SetFrom (const decColor &red, const decColor &green, const decColor &blue, const decColor &alpha, const decColor &white) |
Set color matrix transformation base. More... | |
void | SetBrightness (float brightness) |
Set brightness adjustment matrix. More... | |
void | SetBrightness (float red, float green, float blue) |
Set brightness adjustment matrix. More... | |
void | SetBrightness (const decColor &brightness) |
Set brightness adjustment matrix. More... | |
void | SetContrast (float contrast) |
Set contrast adjustment matrix. More... | |
void | SetContrast (float red, float green, float blue) |
Set contrast adjustment matrix. More... | |
void | SetContrast (const decColor &contrast) |
Set contrast adjustment matrix. More... | |
void | SetSaturation (float saturation) |
Set saturation adjustment matrix. More... | |
void | SetSaturation (float red, float green, float blue) |
Set saturation adjustment matrix. More... | |
void | SetSaturation (const decColor &saturation) |
Set saturation adjustment matrix. More... | |
void | SetColorInversion () |
Set color inversion matrix. More... | |
float | Determinant () const |
Determinant of the color matrix. More... | |
decColorMatrix | Invert () const |
Inverse of color matrix if the inverse is possible. More... | |
decColor | GetRedBase () const |
Red color base. More... | |
decColor | GetGreenBase () const |
Green color base. More... | |
decColor | GetBlueBase () const |
Blue color base. More... | |
decColor | GetAlphaBase () const |
Alpha color base. More... | |
decColor | GetWhiteBase () const |
White color base. More... | |
void | SetRedBase (const decColor &color) |
Set red color base. More... | |
void | SetGreenBase (const decColor &color) |
Set green color base. More... | |
void | SetBlueBase (const decColor &color) |
Set blue color base. More... | |
void | SetAlphaBase (const decColor &color) |
Set alpha color base. More... | |
void | SetWhiteBase (const decColor &color) |
Set white color base. More... | |
decColor | Transform (const decColor &color) const |
Transform color by this matrix. More... | |
decColor | Transform (float red, float green, float blue) const |
Transform color by this matrix. More... | |
decColor | Transform (float red, float green, float blue, float alpha) const |
Transform color by this matrix. More... | |
decColor | TransformColor (const decColor &color) const |
Transform only color component of color by this matrix. More... | |
bool | IsEqualTo (const decColorMatrix &matrix, float threshold=VECTOR_THRESHOLD) const |
Matrix is cell wise equal to another one in respect to a threshold. More... | |
Operators | |
decColorMatrix & | operator= (const decColorMatrix &matrix) |
Copy another matrix to this matrix. More... | |
decColorMatrix & | operator+= (const decColorMatrix &matrix) |
Cell-wise add another matrix this this. More... | |
decColorMatrix & | operator-= (const decColorMatrix &matrix) |
Cell-wise subtract another matrix from this matrix. More... | |
decColorMatrix & | operator*= (float scalar) |
Cell-wise multiply matrix with a scalar. More... | |
decColorMatrix & | operator/= (float scalar) |
Cell-wise divide matrix by a scalar. More... | |
decColorMatrix & | operator*= (const decColorMatrix &matrix) |
Matrix-multiply this matrix with another matrix. More... | |
decColorMatrix | operator+ (const decColorMatrix &matrix) const |
Cell-wise addition this matrix and another matrix. More... | |
decColorMatrix | operator- (const decColorMatrix &matrix) const |
Cell-wise subtraction of another matrix from this matrix. More... | |
decColorMatrix | operator* (float scalar) const |
Cell-wise multiplication of matrix with a scalar. More... | |
decColorMatrix | operator/ (float scalar) const |
Cell-wise division of matrix by a scalar. More... | |
decColorMatrix | operator* (const decColorMatrix &matrix) const |
Matrix-multiplication of this matrix with another matrix. More... | |
decColor | operator* (const decColor &color) const |
Transform color by matrix. More... | |
Static Public Member Functions | |
Matrix Creation | |
static decColorMatrix | CreateIdentity () |
Create identity color matrix. More... | |
static decColorMatrix | CreateTranslation (float red, float green, float blue, float alpha) |
Create color translation matrix. More... | |
static decColorMatrix | CreateTranslation (const decColor &color) |
Create color translation matrix. More... | |
static decColorMatrix | CreateScaling (float sred, float sgreen, float sblue, float salpha) |
Create color scaling matrix. More... | |
static decColorMatrix | CreateScaling (const decColor &color) |
Create color scaling matrix. More... | |
static decColorMatrix | CreateST (const decColor &scale, const decColor &translate) |
Create scaling then translation color matrix. More... | |
static decColorMatrix | CreateFrom (const decColor &red, const decColor &green, const decColor &blue, const decColor &alpha, const decColor &white) |
Create color matrix with colors as transformation base. More... | |
static decColorMatrix | CreateBrightness (float brightness) |
Create brightness adjustment matrix. More... | |
static decColorMatrix | CreateBrightness (float red, float green, float blue) |
Create brightness adjustment matrix. More... | |
static decColorMatrix | CreateBrightness (const decColor &brightness) |
Create brightness adjustment matrix. More... | |
static decColorMatrix | CreateContrast (float contrast) |
Create contrast adjustment matrix. More... | |
static decColorMatrix | CreateContrast (float red, float green, float blue) |
Create contrast adjustment matrix. More... | |
static decColorMatrix | CreateContrast (const decColor &contrast) |
Create contrast adjustment matrix. More... | |
static decColorMatrix | CreateSaturation (float saturation) |
Create saturation adjustment matrix. More... | |
static decColorMatrix | CreateSaturation (float red, float green, float blue) |
Create saturation adjustment matrix. More... | |
static decColorMatrix | CreateSaturation (const decColor &saturation) |
Create saturation adjustment matrix. More... | |
static decColorMatrix | CreateColorInversion () |
Create color inversion matrix. More... | |
Public Attributes | |
float | a11 |
float | a12 |
float | a13 |
float | a14 |
float | a15 |
float | a21 |
float | a22 |
float | a23 |
float | a24 |
float | a25 |
float | a31 |
float | a32 |
float | a33 |
float | a34 |
float | a35 |
float | a41 |
float | a42 |
float | a43 |
float | a44 |
float | a45 |
5x4 component color matrix in row major order.
The colons are (1 to 5): red, green, blue, alpha and white. The rows are (1 to 4): red, green, blue and alpha. Color transformation has to be done in linear color space. With gamma corrected colors certain transformation functions can yield wrong results.
decColorMatrix::decColorMatrix | ( | ) |
Create color matrix initialized to identity.
decColorMatrix::decColorMatrix | ( | const decColorMatrix & | m | ) |
Create copy of a color matrix.
|
static |
Create brightness adjustment matrix.
Brightness can be positive or negative.
|
static |
Create brightness adjustment matrix.
Brightness can be positive or negative.
|
static |
Create brightness adjustment matrix.
Brightness can be positive or negative.
|
static |
Create color inversion matrix.
|
static |
Create contrast adjustment matrix.
Contrast can be positive or negative.
|
static |
Create contrast adjustment matrix.
Contrast can be positive or negative.
|
static |
Create contrast adjustment matrix.
Contrast can be positive or negative.
|
static |
Create color matrix with colors as transformation base.
The parameters fill the colons from 1 to 5 in the appropriate order..
|
static |
Create identity color matrix.
|
static |
Create saturation adjustment matrix.
Saturation can be positive or negative.
|
static |
Create saturation adjustment matrix.
Saturation can be positive or negative.
|
static |
Create saturation adjustment matrix.
Saturation can be positive or negative.
|
static |
Create color scaling matrix.
|
static |
Create color scaling matrix.
|
static |
Create scaling then translation color matrix.
|
static |
Create color translation matrix.
|
static |
Create color translation matrix.
float decColorMatrix::Determinant | ( | ) | const |
Determinant of the color matrix.
Mathematically this only works on a 5x5 matrix. The color matrix is first expanded with an identity line at the bottom to become a 5x5 matrix. From this matrix the determinant is calculated from.
decColor decColorMatrix::GetAlphaBase | ( | ) | const |
Alpha color base.
decColor decColorMatrix::GetBlueBase | ( | ) | const |
Blue color base.
decColor decColorMatrix::GetGreenBase | ( | ) | const |
Green color base.
decColor decColorMatrix::GetRedBase | ( | ) | const |
Red color base.
decColor decColorMatrix::GetWhiteBase | ( | ) | const |
White color base.
decColorMatrix decColorMatrix::Invert | ( | ) | const |
Inverse of color matrix if the inverse is possible.
Mathematically this only works for a 5x5 matrix. The color matrix is expanded with an identity line to become a 5x5 matrix. Form this matrix the inverse is calculated and the 5x4 part returned.
bool decColorMatrix::IsEqualTo | ( | const decColorMatrix & | matrix, |
float | threshold = VECTOR_THRESHOLD |
||
) | const |
Matrix is cell wise equal to another one in respect to a threshold.
decColorMatrix decColorMatrix::operator* | ( | const decColorMatrix & | matrix | ) | const |
Matrix-multiplication of this matrix with another matrix.
Mathematically this results in a 5x5 matrix. The last row is discarded.
decColorMatrix decColorMatrix::operator* | ( | float | scalar | ) | const |
Cell-wise multiplication of matrix with a scalar.
decColorMatrix& decColorMatrix::operator*= | ( | const decColorMatrix & | matrix | ) |
Matrix-multiply this matrix with another matrix.
Mathematically this results in a 5x5 matrix. The last row is discarded.
decColorMatrix& decColorMatrix::operator*= | ( | float | scalar | ) |
Cell-wise multiply matrix with a scalar.
decColorMatrix decColorMatrix::operator+ | ( | const decColorMatrix & | matrix | ) | const |
Cell-wise addition this matrix and another matrix.
decColorMatrix& decColorMatrix::operator+= | ( | const decColorMatrix & | matrix | ) |
Cell-wise add another matrix this this.
decColorMatrix decColorMatrix::operator- | ( | const decColorMatrix & | matrix | ) | const |
Cell-wise subtraction of another matrix from this matrix.
decColorMatrix& decColorMatrix::operator-= | ( | const decColorMatrix & | matrix | ) |
Cell-wise subtract another matrix from this matrix.
decColorMatrix decColorMatrix::operator/ | ( | float | scalar | ) | const |
Cell-wise division of matrix by a scalar.
deeDivisionByZero | scalar is 0. |
decColorMatrix& decColorMatrix::operator/= | ( | float | scalar | ) |
Cell-wise divide matrix by a scalar.
deeDivisionByZero | scalar is 0. |
decColorMatrix& decColorMatrix::operator= | ( | const decColorMatrix & | matrix | ) |
Copy another matrix to this matrix.
void decColorMatrix::SetAlphaBase | ( | const decColor & | color | ) |
Set alpha color base.
void decColorMatrix::SetBlueBase | ( | const decColor & | color | ) |
Set blue color base.
void decColorMatrix::SetBrightness | ( | const decColor & | brightness | ) |
Set brightness adjustment matrix.
Brightness can be positive or negative.
void decColorMatrix::SetBrightness | ( | float | brightness | ) |
Set brightness adjustment matrix.
Brightness can be positive or negative.
void decColorMatrix::SetBrightness | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Set brightness adjustment matrix.
Brightness can be positive or negative.
void decColorMatrix::SetColorInversion | ( | ) |
Set color inversion matrix.
void decColorMatrix::SetContrast | ( | const decColor & | contrast | ) |
Set contrast adjustment matrix.
Contrast can be positive or negative.
void decColorMatrix::SetContrast | ( | float | contrast | ) |
Set contrast adjustment matrix.
Contrast can be positive or negative.
void decColorMatrix::SetContrast | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Set contrast adjustment matrix.
Contrast can be positive or negative.
void decColorMatrix::SetFrom | ( | const decColor & | red, |
const decColor & | green, | ||
const decColor & | blue, | ||
const decColor & | alpha, | ||
const decColor & | white | ||
) |
Set color matrix transformation base.
The parameters fill the colons from 1 to 5 in the appropriate order..
void decColorMatrix::SetGreenBase | ( | const decColor & | color | ) |
Set green color base.
void decColorMatrix::SetIdentity | ( | ) |
Set identity color matrix.
void decColorMatrix::SetRedBase | ( | const decColor & | color | ) |
Set red color base.
void decColorMatrix::SetSaturation | ( | const decColor & | saturation | ) |
Set saturation adjustment matrix.
Saturation can be positive or negative.
void decColorMatrix::SetSaturation | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Set saturation adjustment matrix.
Saturation can be positive or negative.
void decColorMatrix::SetSaturation | ( | float | saturation | ) |
Set saturation adjustment matrix.
Saturation can be positive or negative.
void decColorMatrix::SetScaling | ( | const decColor & | color | ) |
Set scaling color matrix.
void decColorMatrix::SetScaling | ( | float | sred, |
float | sgreen, | ||
float | sblue, | ||
float | salpha | ||
) |
Set scaling color matrix.
Set scaling then translation color matrix.
void decColorMatrix::SetTranslation | ( | const decColor & | color | ) |
Set translation color matrix.
void decColorMatrix::SetTranslation | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
Set translation color matrix.
void decColorMatrix::SetWhiteBase | ( | const decColor & | color | ) |
Set white color base.
decColor decColorMatrix::Transform | ( | float | red, |
float | green, | ||
float | blue | ||
) | const |
Transform color by this matrix.
decColor decColorMatrix::Transform | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) | const |
Transform color by this matrix.
Transform only color component of color by this matrix.
color alpha is assumed to be one. Result alpha is set to 1.
float decColorMatrix::a11 |
float decColorMatrix::a12 |
float decColorMatrix::a13 |
float decColorMatrix::a14 |
float decColorMatrix::a15 |
float decColorMatrix::a21 |
float decColorMatrix::a22 |
float decColorMatrix::a23 |
float decColorMatrix::a24 |
float decColorMatrix::a25 |
float decColorMatrix::a31 |
float decColorMatrix::a32 |
float decColorMatrix::a33 |
float decColorMatrix::a34 |
float decColorMatrix::a35 |
float decColorMatrix::a41 |
float decColorMatrix::a42 |
float decColorMatrix::a43 |
float decColorMatrix::a44 |
float decColorMatrix::a45 |