2x3 matrix for two dimensional rotations More...
Public Member Functions | |
Matrix23 () | |
Initialize to an identity matrix. | |
void | Identity (void) |
Initialize to an identity matrix. | |
void | Concatenate (const Matrix23 *pInput) |
Concatenate a matrix to this matrix. | |
void | ConcatenateTranslation (float fX, float fY) |
Concatenate a translation to this matrix. | |
void | ConcatenateScale (float fScale) |
Concatenate a scale to this matrix. | |
void | Interpolate (const Matrix23 *pInput1, const Matrix23 *pInput2, float fFactor) |
Interpolate between two matrices. | |
void | SetScaleRotation (float fXScale, float fYScale, float fRotation) |
Set a scale an rotation to the matrix. | |
void | Read (Stream *pStream) |
Read a matrix from the file stream. | |
void | Transform (Vector2D_t *pOutput, const Vector2D_t *pInput) const |
Transform a point by this matrix. | |
void | Transform (Vector2D_t *pOutput, float fX, float fY) const |
Transform a point by this matrix. | |
void | Transform (Vector4D_t *pBounds) const |
Transform a rectangle by this matrix. | |
void | TransformVector (Vector2D_t *pOutput, const Vector2D_t *pInput) const |
Transform a point by this matrix. | |
void | TransformByInverse (Vector2D_t *pOutput, const Vector2D_t *pInput) const |
Transform a point by this inverse of this matrix. | |
void | TransformByInverse (Vector4D_t *pBounds) const |
Transform a rectangle by this inverse of this matrix. | |
void | SetInverse (const Matrix23 *pInput) |
Set this matrix to the inverse of the input matrix. | |
uint_t | DoesFlip (void) const |
Test for left handed matrix. | |
float | GetDeterminant (void) const |
Calculate the matrix determinate. | |
float | GetMaxScale (void) const |
Get the maximum scale that this transform contains. | |
float | GetXScale (void) const |
Get the X scale magnitude. | |
float | GetYScale (void) const |
Get the Y scale magnitude. | |
float | GetRotation (void) const |
Get the matrix rotation value. | |
void | Print (void) const |
Dump the matrix to Debug::Message() | |
uint_t | operator== (const Matrix23 &rInput) const |
Test matrix for equality. | |
uint_t | operator!= (const Matrix23 &rInput) const |
Test matrix for inequality. | |
Public Attributes | |
float | m_fScaleX |
XScale value. | |
float | m_fRotateSkew0 |
X rotation skew. | |
float | m_fRotateSkew1 |
Y rotation skew. | |
float | m_fScaleY |
YScale value. | |
float | m_fTranslateX |
X translation. | |
float | m_fTranslateY |
Y translation. | |
2x3 matrix for two dimensional rotations
This class implements the functions to support the two dimensional matrix found on page 22 of the Adobe SWF file format manual swf-file-format-spec.pdf
Burger::Flash::Matrix23::Matrix23 | ( | ) |
Initialize to an identity matrix.
Set to an identity matrix (Scale = 1, all others 0)
void BURGER_API Burger::Flash::Matrix23::Concatenate | ( | const Matrix23 * | pInput | ) |
Concatenate a matrix to this matrix.
Concatenate the other matrix's transform onto this one. When transforming points, the input happens first, and then our original transform.
pInput | Pointer to a matrix to concatenate |
void BURGER_API Burger::Flash::Matrix23::ConcatenateScale | ( | float | fScale | ) |
Concatenate a scale to this matrix.
Concatenate a uniform scale onto the front of this matrix. When transforming points, the scale happens first, then our original transform.
fScale | Scale to concatenate |
void BURGER_API Burger::Flash::Matrix23::ConcatenateTranslation | ( | float | fX, |
float | fY ) |
Concatenate a translation to this matrix.
Concatenate a translation onto the front of this matrix. When transforming points, the translation happens first, then our original transform.
fX | Translation X to concatenate |
fY | Translation Y to concatenate |
uint_t BURGER_API Burger::Flash::Matrix23::DoesFlip | ( | void | ) | const |
Calculate the matrix determinate.
Using the 2x2 rotation/scale values, return the determinant
float BURGER_API Burger::Flash::Matrix23::GetMaxScale | ( | void | ) | const |
Get the maximum scale that this transform contains.
Test the X and Y scale factors and return the larger of the two.
float BURGER_API Burger::Flash::Matrix23::GetRotation | ( | void | ) | const |
Get the matrix rotation value.
Calculate the rotation in radians.
float BURGER_API Burger::Flash::Matrix23::GetXScale | ( | void | ) | const |
Get the X scale magnitude.
Get the distance of the scale and skew in the X direction
float BURGER_API Burger::Flash::Matrix23::GetYScale | ( | void | ) | const |
Get the Y scale magnitude.
Get the distance of the scale and skew in the Y direction
void BURGER_API Burger::Flash::Matrix23::Identity | ( | void | ) |
Initialize to an identity matrix.
Set to an identity matrix (Scale = 1, all others 0)
void BURGER_API Burger::Flash::Matrix23::Interpolate | ( | const Matrix23 * | pInput1, |
const Matrix23 * | pInput2, | ||
float | fFactor ) |
Interpolate between two matrices.
Set this matrix to a blend of pInput1 and pInput2, parameterized by fFactor.
pInput1 | Pointer to a matrix for the factor of 0.0f |
pInput2 | Pointer to a matrix for the factor of 1.0f |
fFactor | Interpolation factor from 0.0f to 1.0f |
uint_t BURGER_API Burger::Flash::Matrix23::operator!= | ( | const Matrix23 & | rInput | ) | const |
Test matrix for inequality.
rInput | Matrix to compare against |
uint_t BURGER_API Burger::Flash::Matrix23::operator== | ( | const Matrix23 & | rInput | ) | const |
Test matrix for equality.
rInput | Matrix to compare against |
void BURGER_API Burger::Flash::Matrix23::Print | ( | void | ) | const |
Dump the matrix to Debug::Message()
Output the matrix values to the console for debugging.
void BURGER_API Burger::Flash::Matrix23::Read | ( | Stream * | pStream | ) |
Read a matrix from the file stream.
Read from the bit stream and fill in all of the matrix entries using the compressed format Adobe uses for Flash files
pStream | Pointer to a flash byte stream |
void BURGER_API BURGER_API Burger::Flash::Matrix23::SetInverse | ( | const Matrix23 * | pInput | ) |
Set this matrix to the inverse of the input matrix.
pInput | Pointer to a matrix to invert. |
void BURGER_API Burger::Flash::Matrix23::SetScaleRotation | ( | float | fXScale, |
float | fYScale, | ||
float | fRotation ) |
Set a scale an rotation to the matrix.
Sets the scale and rotation to a matrix while leaving the translation values untouched.
fXScale | Scale in the X direction |
fYScale | Scale in the Y direction |
fRotation | Rotation in radians |
void BURGER_API Burger::Flash::Matrix23::Transform | ( | Vector2D_t * | pOutput, |
const Vector2D_t * | pInput ) const |
Transform a point by this matrix.
pOutput | Pointer to a point to store the result |
pInput | Pointer to the point to transform |
void BURGER_API Burger::Flash::Matrix23::Transform | ( | Vector2D_t * | pOutput, |
float | fX, | ||
float | fY ) const |
Transform a point by this matrix.
pOutput | Pointer to a point to store the result |
fX | X coordinate of the point to transform |
fY | Y coordinate of the point to transform |
void BURGER_API Burger::Flash::Matrix23::Transform | ( | Vector4D_t * | pBounds | ) | const |
Transform a rectangle by this matrix.
pBounds | Pointer to a rectangle to transform |
void BURGER_API Burger::Flash::Matrix23::TransformByInverse | ( | Vector2D_t * | pOutput, |
const Vector2D_t * | pInput ) const |
Transform a point by this inverse of this matrix.
Create the inverse of this matrix and then apply the transform to a point.
pOutput | Pointer to a point to store the result |
pInput | Pointer to a point to transform |
void BURGER_API Burger::Flash::Matrix23::TransformByInverse | ( | Vector4D_t * | pBounds | ) | const |
Transform a rectangle by this inverse of this matrix.
Create the inverse of this matrix and then apply the transform to a rectangle.
pBounds | Pointer to a rectangle to transform |
void BURGER_API Burger::Flash::Matrix23::TransformVector | ( | Vector2D_t * | pOutput, |
const Vector2D_t * | pInput ) const |
Transform a point by this matrix.
Apply the transform to a point, however this function does not apply the translation.
pOutput | Pointer to a point to store the result |
pInput | Pointer to a point to transform |
float Burger::Flash::Matrix23::m_fRotateSkew0 |
X rotation skew.
float Burger::Flash::Matrix23::m_fRotateSkew1 |
Y rotation skew.
float Burger::Flash::Matrix23::m_fScaleX |
XScale value.
float Burger::Flash::Matrix23::m_fScaleY |
YScale value.
float Burger::Flash::Matrix23::m_fTranslateX |
X translation.
float Burger::Flash::Matrix23::m_fTranslateY |
Y translation.