|
| void | ReadWrite (IPMStream *s) |
| |
| constexpr | PMMatrix () noexcept |
| |
| constexpr | PMMatrix (PMReal a, PMReal b, PMReal c, PMReal d, PMReal e, PMReal f) noexcept |
| |
| constexpr | PMMatrix (const PMMatrix &m) noexcept=default |
| |
| constexpr | PMMatrix (PMMatrix &&m) noexcept=default |
| |
| | PMMatrix (const BRVCoordMatrix &m) |
| |
| PMMatrix & | operator= (const PMMatrix &m) noexcept=default |
| |
| PMMatrix & | operator= (PMMatrix &&m) noexcept=default |
| |
| void | SetMatrix (const BRVCoordMatrix &m) |
| |
| void | SetMatrix (const _t_BRVFixedMatrix &m) |
| |
| void | SetMatrix (const dvacore::geom::ScaleMatrixT< float > &m) |
| |
| void | GetAGMFixedMatrix (_t_BRVFixedMatrix *retMatrix) const |
| |
| void | GetAGMFloatMatrix (BRVCoordMatrix *retMatrix) const |
| |
| void | GetUIMatrixF32 (dvacore::geom::ScaleMatrixT< float > *retMatrix) const |
| |
| bool16 | operator== (const PMMatrix &other) const |
| |
| bool16 | operator!= (const PMMatrix &other) const |
| |
| bool16 | operator< (const PMMatrix &other) const |
| |
| void | Transform (PMReal *x, PMReal *y) const |
| |
| void | Transform (PMPoint *p) const |
| |
| void | Transform (PMPolygon4 *fourPoints) const |
| |
| void | Transform (PMRect *rect) const |
| |
| void | Transform (PMLineSeg *segment) const |
| |
| const PMReal | operator[] (int index) const |
| |
| bool16 | IsIdentity () const noexcept |
| |
| bool | exactly_identity () const noexcept |
| |
| void | ResetToIdentity () noexcept |
| |
| PMReal | Determinant () const |
| |
| bool16 | IsSingular () const |
| |
| bool16 | PreservesBoxes () const |
| |
| void | Invert () |
| |
| PMMatrix | Inverse () const |
| |
| void | PreConcat (const PMMatrix &m) |
| |
| void | PostConcat (const PMMatrix &m) |
| |
| void | PermuteLeftPast (const PMMatrix &m) |
| |
| void | PermuteRightPast (const PMMatrix &m) |
| |
| void | PreScale (PMReal xScale, PMReal yScale) |
| |
| void | Scale (PMReal xScale, PMReal yScale) |
| |
| const PMMatrix & | ScaleFrom (const PMPoint &stationaryPoint, PMReal xScale, PMReal yScale) |
| |
| void | SkewHorizontal (PMReal xSkewAngleInDegrees) |
| |
| void | SkewVertical (PMReal ySkewAngleInDegrees) |
| |
| void | SkewFrom (const PMPoint &stationaryPoint, PMReal skewAngle, PMReal noSkewDirectionAngle) |
| |
| void | PreRotate (PMReal angleInDegrees) |
| |
| void | Rotate (PMReal angleInDegrees) |
| |
| const PMMatrix & | RotateAbout (const PMPoint ¢er, PMReal angle) |
| |
| void | PreTranslate (PMReal x, PMReal y) |
| |
| void | PreTranslate (const PMPoint &offset) |
| |
| void | Translate (PMReal x, PMReal y) |
| |
| void | Translate (const PMPoint &offset) |
| |
| void | ScaleTo (PMReal xScale, PMReal yScale) |
| |
| void | ScaleTo (const PMPoint &stationaryPoint, PMReal xScale, PMReal yScale) |
| |
| void | SkewTo (PMReal xSkewAngleInDegrees) |
| |
| void | SkewTo (const PMPoint &stationaryPoint, PMReal xSkewAngleInDegrees) |
| |
| void | SkewToSlope (const PMPoint &stationaryPoint, PMReal skewSlope) |
| |
| void | RotateTo (PMReal thetaInDegrees) |
| |
| void | RotateTo (const PMPoint &stationaryPoint, PMReal thetaInDegrees) |
| |
| void | RotateTo (const PMPoint &stationaryPoint, PMReal cosineAngle, PMReal sineAngle) |
| |
| void | TranslateTo (PMReal x, PMReal y) |
| |
| void | SetOrigin (PMReal x, PMReal y) |
| |
| uint32 | GetMatrixFactors (PMMatrix *scale, PMMatrix *skew, PMMatrix *rotate, PMMatrix *translate, TransformFactorOrder factorOrder=kFactorOrder_SKRT) const |
| |
| uint32 | GetTransformValues (PMReal *xscale, PMReal *yscale, PMReal *skewslope, PMReal *costheta, PMReal *sintheta, PMReal *xtranslation, PMReal *ytranslation, TransformFactorOrder factorOrder=kFactorOrder_SKRT) const |
| |
| uint32 | GetMatrixContent () const |
| |
| PMReal | GetXScale () const |
| |
| PMReal | GetYScale () const |
| |
| PMReal | GetXSkewAngle () const |
| |
| PMReal | GetRotationAngle (bool16 zeroCentered=kFalse) const |
| |
| PMReal | GetXTranslation () const noexcept |
| |
| PMReal | GetYTranslation () const noexcept |
| |
| void | GetMatrixInfo (PMReal *rotAngle, PMReal *xSkewAngle, PMReal *xScale, PMReal *yScale) const |
| |
| void | SanityCheck () const |
| |
C++ class for dealing with matrix operations.
| uint32 PMMatrix::GetMatrixFactors | ( | PMMatrix * | scale, |
| | PMMatrix * | skew, |
| | PMMatrix * | rotate, |
| | PMMatrix * | translate, |
| | TransformFactorOrder | factorOrder = kFactorOrder_SKRT |
| ) | | const |
GetMatrixFactors asserts if *this is singular. Otherwise, if scale, skew, rotate, and translate are non-nil pointers, then GetMatrixFactors writes matrices to the specified locations such that:
1) scale * skew * rotate * translate == *this if factorOrder == kFactorOrder_SKRT
otherwise rotate * skew * scale * translate == *this if factorORder == kFactorOrder_RKST
2) scale[1] == scale[2] == scale[4] == scale[5] == 0.0
3) skew[1] == scale[4] == scale[5] == 0.0
skew[0] == skew[3] == 1.0
4) rotate[0] == rotate[3]
rotate[1] == -rotate[2]
determinant(rotate) == 1.0
5) translate[0] == translate[3] == 1.0
translate[1] == translate[2] == 0.0
Any nil-pointer passed makes GetMatrixFactors skip writing the corresponding matrix, but this does not change the factorization nor have any effect on the matrices whose values are written.
The return value of GetMatrixFactors is a combination of the above constants OR'd together as one unsigned value. If scale[0] or scale[3] differ from 1.0, then (result & kHasScaleContent). If skew[2] differs from 0.0 then (result & kHasSkewContent). If rotate[0] differs from 1.0 then (result & kHasRotateContent). And if either translate[4] or translate[5] differ from 0.0 then (result & kHasTranslateContent). Note the return value from GetMatrixFactors will not have any bits set for transform components whose factor was not requested. For example, GetMatrixFactors( nil, nil, &rotate, nil) will return either kHasNoTransformContent or kHasRotateContent even if the matrix has other transform components.
Note that the factorization returned from GetMatrixFactors, as described above, is not unique. In particular, for kFactorOrder_SKRT, if one changed the algebraic sign of scale[0], scale[3], rotate[0], rotate[1], rotate[2], and rotate[3], then the set of factors would still meet all the conditions above. Currently it is unspecified which of the two factorizations is returned. Code that relies on one or the other is incorrect.
| uint32 PMMatrix::GetTransformValues | ( | PMReal * | xscale, |
| | PMReal * | yscale, |
| | PMReal * | skewslope, |
| | PMReal * | costheta, |
| | PMReal * | sintheta, |
| | PMReal * | xtranslation, |
| | PMReal * | ytranslation, |
| | TransformFactorOrder | factorOrder = kFactorOrder_SKRT |
| ) | | const |
GetTransformValues writes to its non-nil parameters the free values in the matrices that would have been returned in a call to GetMatrixFactors. In particular, *xscale == scale[0], *yscale == scale[3], *skewslope == skew[2], *costheta == rotate[0], *sintheta == rotate[1], *xtranslation == translate[4], and *ytranslation == translate[5]. Any nil pointers cause GetTransformValues to skip writing the corresponding return value, with the restriction that the pair of parameters (xscale, yscale) must be both nil or both non-nil. Likewise for the the pair (costheta, sintheta) and the pair (xtranslation, ytranslation). Callers are not allowed to be "interested in" only one of the pair. GetTransformValues will assert on such a call.
The return value has the same meaning as the return value of GetMatrixFactors. And like GetMatrixFactors, the only bits set will be those whose corresponding transform values were requested with non-nil pointers.
And, as described for GetMatrixFactors, the 7-tuple returned from GetTransformValues, is not unique. In particular, for kFactorOrder_SKRT, if one changed the algebraic sign of xscale, yscale, costheta, and sintheta, then the set of values would still correctly characterize the matrix. Currently it is unspecified which of the two 7-tuples is returned. Code that relies on one or the other is incorrect.
| const PMReal PMMatrix::operator[] | ( | int | index | ) | const |
Extract the nth free value of *this as a PMReal. The index must be >= 0 and <= 5. In other words consider the following code:
PMReal a,b,c,d,e,f,x,y;
x = y = 0;
m.Transform( &x, &y);
e = x;
f = y;
x = 1; y = 0;
m.Transform( &x, &y);
a = x - e;
b = y - f;
x = 0; y = 1;
m.Transform( &x, &y);
c = x - e;
d = y - f;
Then m[0] returns a m[1] returns b m[2] returns c m[3] returns d m[4] returns e m[5] returns f
operator[] is simply more convenient and perhaps more efficient than using the above code. Note that the implementation of PMMatrix need not be an array of 6 PMReals even though this operator gives it that appearance.