![]() |
Mako 8.3.0 API
MakoCore SDK API Documentation
|
Matrix class - special 3x2 matrix. More...
#include <edl/edlgeom.h>
Classes | |
| struct | DecomposeInfo |
Public Types | |
| enum | eOperationTypes { eDoesTranslate = 0x1 , eDoesScale = 0x2 , eDoesRotate = 0x4 , eIsComplex = 0x8 } |
| Classification of operation type flags of the transform. More... | |
Public Member Functions | |
| CTransformMatrix () | |
| Initializes the matrix to identity. | |
| CTransformMatrix (TItem _xx, TItem _xy, TItem _yx, TItem _yy, TItem _dx, TItem _dy) | |
| Initializes the matrix. | |
| 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) |
| Set the matrix parameters. | |
| TItem | xx () const |
| Fetch the xx component. | |
| TItem | xy () const |
| Fetch the xy component. | |
| TItem | yx () const |
| Fetch the yx component. | |
| TItem | yy () const |
| Fetch the yy component. | |
| TItem | dx () const |
| Fetch the dx component. | |
| TItem | dy () const |
| Fetch the dy component. | |
| void | setXX (TItem x) |
| Sets the xx component. | |
| void | setXY (TItem x) |
| Sets the xy component. | |
| void | setYX (TItem x) |
| Sets the yx component. | |
| void | setYY (TItem x) |
| Sets the yy component. | |
| void | setDX (TItem x) |
| Sets the dx component. | |
| void | setDY (TItem x) |
| Sets the 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. | |
| bool | ortho (bool &rotated) const |
| Determine if the matrix is orthogonal. That is, if the matrix is aligned to the x and y axes. This is true for example if the matrix flips, and/or if it rotates by 90 degrees, or is identity. | |
| CTransformMatrix< TItem > & | preMul (const CTransformMatrix< TItem > &matrix) |
| Premultiply by the given matrix. | |
| CTransformMatrix< TItem > & | postMul (const CTransformMatrix< TItem > &matrix) |
| Postmultiply by the 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, FPoint &scale, FPoint &shear, double &rotationAngle, double eps=1.0e-06) const |
| Decompose the transform into an equivalent set of translate + scale + shear + rotate. | |
| DecomposeInfo | decompose (double eps=1.0e-06) const |
| Decompose the transform into an equivalent set of translate + scale + shear + rotate but return the results in a DecomposeInfo structure. | |
| double | getScale () const |
| Determine the average scale of the transform. | |
| bool | isSimpleScaled (TItem &scale) const |
| Determine if the transform is merely a scale, and if so, populate the scale. | |
| std::pair< bool, TItem > | isSimpleScaled () const |
| Determine if the transform is merely a scale, and if so, return that scale. | |
| 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. | |
Matrix class - special 3x2 matrix.
|
inline |
Initializes the matrix to identity.
|
inline |
Initializes the matrix.
| _xx | xx component. |
| _xy | xy component. |
| _yx | yx component. |
| _yy | yy component. |
| _dx | dx component. |
| _dy | dy component. |
|
inline |
Copy constructor.
| m | Transform matrix. |
|
inline |
Creates a matrix that transforms from one rectangle to another.
| sourceRect | Source rectangle. |
| destRect | Destination rectangle. |
|
inline |
Retrieve the matrix as an array of the given type.
| array | Pointer to a six-entry array of the given type. |
|
inline |
Classify the transform.
|
inline |
Undo the second form of decompose above. It starts with an identity matrix and applies the transforms in this order:
| translateAmount | The desired translation component in x and y. |
| rotationAngle | The desired rotation angle in radians. |
| shearAngle | The desired shear angle in radians. |
| scaleAmount | The desired scale in x and y. |
|
inline |
Decompose the transform into an equivalent set of translate + scale + shear + rotate but return the results in a DecomposeInfo structure.
| eps | Epsilon for determining when values are close to zero. |
|
inline |
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:
See compose, which demonstrates how to perform these steps.
| 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. |
|
inline |
Decompose the transform into an equivalent set of translate + scale + shear + rotate.
| translate | Reference to receive the translation component in x and y. |
| scale | Reference to receive the scale component in x and y. |
| shear | Reference to receive the shear angle in radians. |
| rotationAngle | Reference to receive the rotation angle in radians. |
| eps | Epsilon for determining when values are close to zero. |
|
inline |
Check to see if the matrix is degenerate (0 scale).
|
inline |
Find the determinant of the matrix.
|
inline |
Fetch the dx component.
|
inline |
Fetch the dy component.
|
inline |
Compare to another matrix.
| matrix | Matrix to compare current instance to. |
| ignoreDXDY | Ignore DX & DY for this comparison. |
|
inline |
Determine the average scale of the transform.
|
inline |
Determine if identity matrix.
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Invert the matrix.
|
inline |
Determine if the transform is merely a scale, and if so, return that scale.
|
inline |
Determine if the transform is merely a scale, and if so, populate the scale.
| scale | If successful, the scale. |
|
inline |
Transform a point by the inverse of the matrix.
| point | The point. |
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Transform a point by the inverse of the matrix.
| result | PointTmpl<TItem> to accept result. |
| point | The point. |
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Assignment operator.
| m | Transform matrix. |
|
inline |
Determine if the matrix is orthogonal. That is, if the matrix is aligned to the x and y axes. This is true for example if the matrix flips, and/or if it rotates by 90 degrees, or is identity.
| rotated | On return, this is set true if the matrix rotates by 90 or 270 degrees, false otherwise. |
|
inline |
Postmultiply by the given matrix.
| matrix | Matrix postmultiplier. |
|
inline |
Premultiply by the given matrix.
| matrix | Matrix premultiplier. |
|
inline |
Add a rotation, clockwise, in radians.
| radians | Angle in radians. |
|
inline |
Scale.
| xscale | X-axis scaling factor. |
| yscale | Y-axis scaling factor. |
|
inline |
Set the matrix parameters.
| _xx | xx component. |
| _xy | xy component. |
| _yx | yx component. |
| _yy | yy component. |
| _dx | dx component. |
| _dy | dy component. |
|
inline |
Sets the dx component.
| x | value to set. |
|
inline |
Sets the dy component.
| x | value to set. |
|
inline |
Sets the xx component.
| x | value to set. |
|
inline |
Sets the xy component.
| x | value to set. |
|
inline |
Sets the yx component.
| x | value to set. |
|
inline |
Sets the yy component.
| x | value to set. |
|
inline |
Transform a point.
| point | The point before transformation. |
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Transform a point.
| result | The point after transformation. |
| point | The point before transformation. |
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Transform a rectangle.
| rect | Rectangle to transform. |
| ignoreDXDY | Ignore DX & DY for this operation. |
|
inline |
Translate.
| dx | x-axis transformation value. |
| dy | y-axis transformation value. |
|
inline |
Fetch the xx component.
|
inline |
Fetch the xy component.
|
inline |
Fetch the yx component.
|
inline |
Fetch the yy component.