Drag[en]gine Game Engine
1.21
|
4x3 Component Matrix. Provides matrix calculation on a 3x3 matrix in row major order. This kind of matrix is useful for transforming 3 component color values. More...
#include <decColorMatrix3.h>
Public Member Functions | |
Constructors and Destructors | |
decColorMatrix3 () | |
Create new color matrix initialized to identity. More... | |
decColorMatrix3 (const decColorMatrix3 &m) | |
Create copy of a color matrix. More... | |
Management | |
void | SetIdentity () |
Sets identity color matrix. More... | |
void | SetTranslation (float red, float green, float blue) |
Sets color translation matrix. More... | |
void | SetTranslation (const decColor &color) |
Sets color translation matrix. More... | |
void | SetScaling (float sred, float sgreen, float sblue) |
Sets color scaling matrix. More... | |
void | SetScaling (const decColor &color) |
Sets color scaling matrix. More... | |
void | SetFrom (const decColor &red, const decColor &green, const decColor &blue, const decColor &translation) |
Set color matrix with the given colors as transformation base. More... | |
float | Determinant () const |
Calculates the determinant of the color matrix. More... | |
decColorMatrix3 | Invert () const |
Inverse of this 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 | GetTranslationBase () const |
Translation 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 | SetTranslationBase (const decColor &color) |
Set translation color base. More... | |
decColor | Transform (const decColor &color) const |
Transforms color by this matrix. More... | |
bool | IsEqualTo (const decColorMatrix3 &matrix, float threshold=VECTOR_THRESHOLD) const |
Matrix is cell wise equal to another one in respect to a threshold. More... | |
Operators | |
decColorMatrix3 & | operator= (const decColorMatrix3 &matrix) |
Set cells of this matrix to the values of another one. More... | |
decColorMatrix3 & | operator+= (const decColorMatrix3 &matrix) |
Adds the cells of another matrix to this one. More... | |
decColorMatrix3 & | operator-= (const decColorMatrix3 &matrix) |
Subtracts the cells of another matrix from this vector. More... | |
decColorMatrix3 & | operator*= (float scalar) |
Multiplies the cells of this matrix with a value k. More... | |
decColorMatrix3 & | operator/= (float scalar) |
Divide cells of this matrix by a value k. More... | |
decColorMatrix3 & | operator*= (const decColorMatrix3 &matrix) |
Multiply matrix with another one. More... | |
decColorMatrix3 | operator+ (const decColorMatrix3 &matrix) const |
Retrieves a new matrix with the sum of this matrix with another one. More... | |
decColorMatrix3 | operator- (const decColorMatrix3 &matrix) const |
Retrieves a new matrix with the difference of this matrix to another one. More... | |
decColorMatrix3 | operator* (float scalar) const |
Retrieves a new matrix with this matrix scaled by k. More... | |
decColorMatrix3 | operator/ (float scalar) const |
Matrix with this matrix divided by k. More... | |
decColorMatrix3 | operator* (const decColorMatrix3 &matrix) const |
Matrix with this matrix multiplied with another one. More... | |
decColor | operator* (const decColor &color) const |
Transforms color by this matrix. More... | |
Static Public Member Functions | |
Matrix Creation | |
static decColorMatrix3 | CreateIdentity () |
Create new identity color matrix. More... | |
static decColorMatrix3 | CreateTranslation (float red, float green, float blue) |
Create new color translation matrix. More... | |
static decColorMatrix3 | CreateTranslation (const decColor &color) |
Create new color translation matrix. More... | |
static decColorMatrix3 | CreateScaling (float sred, float sgreen, float sblue) |
Create new color scaling matrix. More... | |
static decColorMatrix3 | CreateScaling (const decColor &color) |
Create new color scaling matrix. More... | |
static decColorMatrix3 | CreateFrom (const decColor &red, const decColor &green, const decColor &blue, const decColor &translation) |
Create color matrix with the given colors as transformation base. The red color fills the values in the first column, the green of the second, the blue of the third, the alpha of the fourth and the translation the fifth. More... | |
Public Attributes | |
Cells | |
The first number indicates the row the second the column. | |
float | a11 |
float | a12 |
float | a13 |
float | a14 |
float | a21 |
float | a22 |
float | a23 |
float | a24 |
float | a31 |
float | a32 |
float | a33 |
float | a34 |
4x3 Component Matrix. Provides matrix calculation on a 3x3 matrix in row major order. This kind of matrix is useful for transforming 3 component color values.
decColorMatrix3::decColorMatrix3 | ( | ) |
Create new color matrix initialized to identity.
decColorMatrix3::decColorMatrix3 | ( | const decColorMatrix3 & | m | ) |
Create copy of a color matrix.
|
static |
Create color matrix with the given colors as transformation base. The red color fills the values in the first column, the green of the second, the blue of the third, the alpha of the fourth and the translation the fifth.
|
static |
Create new identity color matrix.
|
static |
Create new color scaling matrix.
|
static |
Create new color scaling matrix.
|
static |
Create new color translation matrix.
|
static |
Create new color translation matrix.
float decColorMatrix3::Determinant | ( | ) | const |
Calculates the determinant of the color matrix.
Mathematically this only works on a 5x5 matrix. Hence the color matrix is first expanded with an identity line at the bottom to become a 5x5 matrix to calculate the determinant from.
decColor decColorMatrix3::GetBlueBase | ( | ) | const |
Blue color base.
decColor decColorMatrix3::GetGreenBase | ( | ) | const |
Green color base.
decColor decColorMatrix3::GetRedBase | ( | ) | const |
Red color base.
decColor decColorMatrix3::GetTranslationBase | ( | ) | const |
Translation color base.
decColorMatrix3 decColorMatrix3::Invert | ( | ) | const |
Inverse of this color matrix if the inverse is possible.
Mathematically this only works for a 4x4 matrix. Hence we expand the color matrix with an identity line to become a 4x4 matrix. Thereof the inverse is calculated and only the 4x3 part is returned.
bool decColorMatrix3::IsEqualTo | ( | const decColorMatrix3 & | matrix, |
float | threshold = VECTOR_THRESHOLD |
||
) | const |
Matrix is cell wise equal to another one in respect to a threshold.
Transforms color by this matrix.
decColorMatrix3 decColorMatrix3::operator* | ( | const decColorMatrix3 & | matrix | ) | const |
Matrix with this matrix multiplied with another one.
Mathematically this would yield a 5x5 matrix but as a color matrix has no use for the last line only the 5x4 part is returned.
decColorMatrix3 decColorMatrix3::operator* | ( | float | scalar | ) | const |
Retrieves a new matrix with this matrix scaled by k.
decColorMatrix3& decColorMatrix3::operator*= | ( | const decColorMatrix3 & | matrix | ) |
Multiply matrix with another one.
Mathematically this would yield a 5x5 matrix but as a color matrix has no use for the last line only the 5x4 part is returned.
decColorMatrix3& decColorMatrix3::operator*= | ( | float | scalar | ) |
Multiplies the cells of this matrix with a value k.
decColorMatrix3 decColorMatrix3::operator+ | ( | const decColorMatrix3 & | matrix | ) | const |
Retrieves a new matrix with the sum of this matrix with another one.
decColorMatrix3& decColorMatrix3::operator+= | ( | const decColorMatrix3 & | matrix | ) |
Adds the cells of another matrix to this one.
decColorMatrix3 decColorMatrix3::operator- | ( | const decColorMatrix3 & | matrix | ) | const |
Retrieves a new matrix with the difference of this matrix to another one.
decColorMatrix3& decColorMatrix3::operator-= | ( | const decColorMatrix3 & | matrix | ) |
Subtracts the cells of another matrix from this vector.
decColorMatrix3 decColorMatrix3::operator/ | ( | float | scalar | ) | const |
Matrix with this matrix divided by k.
If k is 0 an exception is thrown.
decColorMatrix3& decColorMatrix3::operator/= | ( | float | scalar | ) |
Divide cells of this matrix by a value k.
If the value k is 0 an exception is thrown.
decColorMatrix3& decColorMatrix3::operator= | ( | const decColorMatrix3 & | matrix | ) |
Set cells of this matrix to the values of another one.
void decColorMatrix3::SetBlueBase | ( | const decColor & | color | ) |
Set blue color base.
void decColorMatrix3::SetFrom | ( | const decColor & | red, |
const decColor & | green, | ||
const decColor & | blue, | ||
const decColor & | translation | ||
) |
Set color matrix with the given colors as transformation base.
The red color fills the values in the first column, the green of the second, the blue of the third, the alpha of the fourth and the translation the fifth.
void decColorMatrix3::SetGreenBase | ( | const decColor & | color | ) |
Set green color base.
void decColorMatrix3::SetIdentity | ( | ) |
Sets identity color matrix.
void decColorMatrix3::SetRedBase | ( | const decColor & | color | ) |
Set red color base.
void decColorMatrix3::SetScaling | ( | const decColor & | color | ) |
Sets color scaling matrix.
void decColorMatrix3::SetScaling | ( | float | sred, |
float | sgreen, | ||
float | sblue | ||
) |
Sets color scaling matrix.
void decColorMatrix3::SetTranslation | ( | const decColor & | color | ) |
Sets color translation matrix.
void decColorMatrix3::SetTranslation | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Sets color translation matrix.
void decColorMatrix3::SetTranslationBase | ( | const decColor & | color | ) |
Set translation color base.
Transforms color by this matrix.
float decColorMatrix3::a11 |
float decColorMatrix3::a12 |
float decColorMatrix3::a13 |
float decColorMatrix3::a14 |
float decColorMatrix3::a21 |
float decColorMatrix3::a22 |
float decColorMatrix3::a23 |
float decColorMatrix3::a24 |
float decColorMatrix3::a31 |
float decColorMatrix3::a32 |
float decColorMatrix3::a33 |
float decColorMatrix3::a34 |