#include <Pt/Gfx/Transform.h>
2D affine transform. More...
Public Member Functions | |
| Transform () | |
| Constructs the identity transform. | |
| Transform (double m11, double m12, double m21, double m22, double dx, double dy) | |
| Constructs a transform from explicit matrix components. | |
| ~Transform () | |
| Destroys the transform. | |
| bool | isIdentity () const |
| Returns true if the transform is the identity matrix. | |
| bool | isAffine () const |
| Returns true if the transform is affine. | |
| bool | isSimple () const |
| Returns true if the matrix is only translating and scaling. | |
| double | m11 () const |
| Returns the first row, first column coefficient. | |
| double | m12 () const |
| Returns the first row, second column coefficient. | |
| double | m21 () const |
| Returns the second row, first column coefficient. | |
| double | m22 () const |
| Returns the second row, second column coefficient. | |
| double | dx () const |
| Returns the horizontal translation. | |
| double | dy () const |
| Returns the vertical translation. | |
| void | reset () |
| Resets the transform to identity. | |
| void | set (double m11, double m12, double m21, double m22, double dx, double dy) |
| Replaces the matrix coefficients. | |
| void | translate (double x, double y) |
| Appends a translation. | |
| void | scale (double x, double y) |
| Appends a scaling. | |
| void | rotateDeg (double angle) |
| Appends a rotation specified in degrees. | |
| void | rotateRad (double angle) |
| Appends a rotation specified in radians. | |
| void | shear (double sh, double sv) |
| Appends horizontal and vertical shearing. | |
| void | shearX (double sh) |
| Appends horizontal shearing. | |
| void | shearY (double sh) |
| Appends vertical shearing. | |
| bool | operator== (const Transform &t) const |
| Returns true if both transforms are equal. | |
| bool | operator!= (const Transform &t) const |
| Returns true if both transforms are different. | |
| Transform & | operator*= (const Transform &t) |
| Appends another transform in place. | |
| Transform | operator* (const Transform &t) const |
| Returns the composition of two transforms. | |
| PointF | operator* (const PointF &p) const |
| Transforms a point. | |
| SizeF | operator* (const SizeF &p) const |
| Transforms a size. | |
| double | determinant () const |
| Returns the matrix determinant. | |
| bool | isInvertible () const |
| Returns true if the transform can be inverted. | |
| Transform | inverted () const |
| Returns the inverse transform. | |
Transform maps logical drawing coordinates. The default is identity. Translate, scale, rotate, and shear compose on the left. A painter's setTransform() applies this mapping before the surface scaling. drawText() can take an extra transform for a single run.
Invert a transform only when it is invertible. The type is a value; copying duplicates the matrix, not a painter.