|
| CTransformMatrix () |
| Creates zero matrix.
|
|
| CTransformMatrix (TItem _xx, TItem _xy, TItem _yx, TItem _yy, TItem _dx, TItem _dy) |
| Creates the matrix elementary.
|
|
| CTransformMatrix (const CTransformMatrix< TItem > &m) |
| Copy constructor.
|
|
CTransformMatrix & | operator= (const CTransformMatrix< TItem > &m) |
| Assignment operator.
|
|
| CTransformMatrix (const RectTmpl< TItem > &sourceRect, const RectTmpl< TItem > &destRect) |
| Creates a matrix that transforms from one rectangle to another.
|
|
void | set (TItem _xx=1, TItem _xy=0, TItem _yx=0, TItem _yy=1, TItem _dx=0, TItem _dy=0) |
| Create blank matrix.
|
|
TItem | xx () const |
| Returns xx component.
|
|
TItem | xy () const |
| Returns xy component.
|
|
TItem | yx () const |
| Returns yx component.
|
|
TItem | yy () const |
| Returns yy component.
|
|
TItem | dx () const |
| Returns dx component.
|
|
TItem | dy () const |
| Returns dy component.
|
|
void | setXX (TItem x) |
| Sets xx component.
|
|
void | setXY (TItem x) |
| Sets xy component.
|
|
void | setYX (TItem x) |
| Sets yx component.
|
|
void | setYY (TItem x) |
| Sets yy component.
|
|
void | setDX (TItem x) |
| Sets dx component.
|
|
void | setDY (TItem x) |
| Sets dy component.
|
|
bool | equal (const CTransformMatrix< TItem > &matrix, bool ignoreDXDY=false) const |
| Compare to another matrix.
|
|
bool | identity (bool ignoreDXDY=false) const |
| Determine if identity matrix.
|
|
CTransformMatrix< TItem > & | preMul (const CTransformMatrix< TItem > &matrix) |
| Premultiply by given matrix.
|
|
CTransformMatrix< TItem > & | postMul (const CTransformMatrix< TItem > &matrix) |
| Postmultiply by given matrix.
|
|
bool | degenerate () |
| Check to see if the matrix is degenerate (0 scale)
|
|
bool | invert () |
| Invert the matrix.
|
|
void | transform (PointTmpl< TItem > &result, const PointTmpl< TItem > &point, bool ignoreDXDY=false) const |
| Transform a point.
|
|
PointTmpl< TItem > | transform (const PointTmpl< TItem > &point, bool ignoreDXDY=false) const |
| Transform a point.
|
|
bool | iTransform (PointTmpl< TItem > &result, const PointTmpl< TItem > &point, bool ignoreDXDY=false) const |
| Transform a point by the inverse of the matrix.
|
|
std::pair< bool, PointTmpl< TItem > > | iTransform (const PointTmpl< TItem > &point, bool ignoreDXDY=false) const |
| Transform a point by the inverse of the matrix.
|
|
void | rotate (double radians) |
| Add a rotation, clockwise, in radians.
|
|
void | scale (TItem xscale, TItem yscale) |
| Scale.
|
|
void | translate (TItem dx, TItem dy) |
| Translate.
|
|
TItem | determinant () const |
| Find the determinant of the matrix.
|
|
void | transformRect (RectTmpl< TItem > &rect, bool ignoreDXDY=false) const |
| Transform a rectangle.
|
|
uint32 | classify () const |
| Classify the transform.
|
|
void | decompose (PointTmpl< TItem > &translate, double &rotationAngle, double &shearAngle, FPoint &scale) const |
| Similar to the other form of decompose, but does the decomposition in a different, potentially more useful order. It's designed to more naturally extract rotation information when objects are scaled in a rotated context.
|
|
void | compose (const PointTmpl< TItem > &translateAmount, double rotationAngle, double shearAngle, const FPoint &scaleAmount) |
| Undo the second form of decompose above. It starts with an identity matrix and applies the transforms in this order:
|
|
template<typename AType > |
void | asArray (AType *array) const |
| Retrieve the matrix as an array of the given type.
|
|
template<typename TItem>
class CTransformMatrix< TItem >
Matrix class - special 3x2 matrix.
template<typename TItem >
Similar to the other form of decompose, but does the decomposition in a different, potentially more useful order. It's designed to more naturally extract rotation information when objects are scaled in a rotated context.
Here, once decomposed, the original matrix (within the limitations of floating point roundoff and trig functions) can be reconstructed through successive premultiplies in the following order:
- Translate
- Rotate
- Shear
- Scale
See compose, which demonstrates how to perform these steps.
- Parameters
-
translate | Reference to receive the translation component in x and y. |
rotationAngle | Reference to receive the rotation angle in radians. Please note that the rotation direction is not the same as the other decompose method, and instead uses the same semantics as the rotate member function (clockwise). |
shearAngle | Reference to receive the shear angle in radians. |
scale | Reference to receive the scale component in x and y. |