Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Burger::Flash::Matrix23 Class Reference

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.
 

Detailed Description

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

See also
Flash::Rect

Constructor & Destructor Documentation

◆ Matrix23()

Burger::Flash::Matrix23::Matrix23 ( )

Initialize to an identity matrix.


Set to an identity matrix (Scale = 1, all others 0)

See also
Identity(void)

Member Function Documentation

◆ Concatenate()

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.

Parameters
pInputPointer to a matrix to concatenate
See also
ConcatenateTranslation(float,float) or ConcatenateScale(float)

◆ ConcatenateScale()

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.

Parameters
fScaleScale to concatenate
See also
ConcatenateTranslation(const Matrix23 *) or ConcatenateScale(float,float)

◆ ConcatenateTranslation()

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.

Parameters
fXTranslation X to concatenate
fYTranslation Y to concatenate
See also
ConcatenateTranslation(const Matrix23 *) or ConcatenateScale(float)

◆ DoesFlip()

uint_t BURGER_API Burger::Flash::Matrix23::DoesFlip ( void ) const

Test for left handed matrix.


Returns
TRUE if the matrix determinate is less than 0.0f

◆ GetDeterminant()

float Burger::Flash::Matrix23::GetDeterminant ( void ) const
inline

Calculate the matrix determinate.


Using the 2x2 rotation/scale values, return the determinant

Returns
The determinant of (m_fScaleX * m_fScaleY) - (m_fRotateSkew1 * m_fRotateSkew0)

◆ GetMaxScale()

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.

Returns
The largest scale value.

◆ GetRotation()

float BURGER_API Burger::Flash::Matrix23::GetRotation ( void ) const

Get the matrix rotation value.


Calculate the rotation in radians.

Returns
The rotation of the matrix.
See also
GetXScale(void) const or GetYScale(void) const

◆ GetXScale()

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

Returns
The X scale magnitude
See also
GetYScale(void) const

◆ GetYScale()

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

Returns
The Y scale magnitude
See also
GetXScale(void) const

◆ Identity()

void BURGER_API Burger::Flash::Matrix23::Identity ( void )

Initialize to an identity matrix.


Set to an identity matrix (Scale = 1, all others 0)

◆ Interpolate()

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.

Parameters
pInput1Pointer to a matrix for the factor of 0.0f
pInput2Pointer to a matrix for the factor of 1.0f
fFactorInterpolation factor from 0.0f to 1.0f

◆ operator!=()

uint_t BURGER_API Burger::Flash::Matrix23::operator!= ( const Matrix23 & rInput) const

Test matrix for inequality.


Parameters
rInputMatrix to compare against
Returns
TRUE if not equal, FALSE if equal.
See also
operator==(const Matrix23 &) const

◆ operator==()

uint_t BURGER_API Burger::Flash::Matrix23::operator== ( const Matrix23 & rInput) const

Test matrix for equality.


Parameters
rInputMatrix to compare against
Returns
TRUE if equal, FALSE if not.
See also
operator!=(const Matrix23 &) const

◆ Print()

void BURGER_API Burger::Flash::Matrix23::Print ( void ) const

Dump the matrix to Debug::Message()


Output the matrix values to the console for debugging.

See also
Debug::Message()

◆ Read()

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

Parameters
pStreamPointer to a flash byte stream

◆ SetInverse()

void BURGER_API BURGER_API Burger::Flash::Matrix23::SetInverse ( const Matrix23 * pInput)

Set this matrix to the inverse of the input matrix.


Parameters
pInputPointer to a matrix to invert.

◆ SetScaleRotation()

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.

Parameters
fXScaleScale in the X direction
fYScaleScale in the Y direction
fRotationRotation in radians

◆ Transform() [1/3]

void BURGER_API Burger::Flash::Matrix23::Transform ( Vector2D_t * pOutput,
const Vector2D_t * pInput ) const

Transform a point by this matrix.


Note
The output and input pointers can be the same pointer
Parameters
pOutputPointer to a point to store the result
pInputPointer to the point to transform

◆ Transform() [2/3]

void BURGER_API Burger::Flash::Matrix23::Transform ( Vector2D_t * pOutput,
float fX,
float fY ) const

Transform a point by this matrix.


Parameters
pOutputPointer to a point to store the result
fXX coordinate of the point to transform
fYY coordinate of the point to transform

◆ Transform() [3/3]

void BURGER_API Burger::Flash::Matrix23::Transform ( Vector4D_t * pBounds) const

Transform a rectangle by this matrix.


Parameters
pBoundsPointer to a rectangle to transform

◆ TransformByInverse() [1/2]

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.

Parameters
pOutputPointer to a point to store the result
pInputPointer to a point to transform

◆ TransformByInverse() [2/2]

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.

Parameters
pBoundsPointer to a rectangle to transform

◆ TransformVector()

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.

Parameters
pOutputPointer to a point to store the result
pInputPointer to a point to transform

Member Data Documentation

◆ m_fRotateSkew0

float Burger::Flash::Matrix23::m_fRotateSkew0

X rotation skew.

◆ m_fRotateSkew1

float Burger::Flash::Matrix23::m_fRotateSkew1

Y rotation skew.

◆ m_fScaleX

float Burger::Flash::Matrix23::m_fScaleX

XScale value.

◆ m_fScaleY

float Burger::Flash::Matrix23::m_fScaleY

YScale value.

◆ m_fTranslateX

float Burger::Flash::Matrix23::m_fTranslateX

X translation.

◆ m_fTranslateY

float Burger::Flash::Matrix23::m_fTranslateY

Y translation.