Represents a 2D affine-transformation matrix. More...
Public Member Functions | |
| AffineTransform () throw () | |
| Creates an identity transform. | |
| AffineTransform (const AffineTransform &other) throw () | |
| Creates a copy of another transform. | |
| AffineTransform (const float mat00, const float mat01, const float mat02, const float mat10, const float mat11, const float mat12) throw () | |
| Creates a transform from a set of raw matrix values. | |
| AffineTransform & | operator= (const AffineTransform &other) throw () |
| Copies from another AffineTransform object. | |
| bool | operator== (const AffineTransform &other) const throw () |
| Compares two transforms. | |
| bool | operator!= (const AffineTransform &other) const throw () |
| Compares two transforms. | |
| void | transformPoint (float &x, float &y) const throw () |
| Transforms a 2D co-ordinate using this matrix. | |
| void | transformPoint (double &x, double &y) const throw () |
| Transforms a 2D co-ordinate using this matrix. | |
| const AffineTransform | translated (const float deltaX, const float deltaY) const throw () |
| Returns a new transform which is the same as this one followed by a translation. | |
| const AffineTransform | rotated (const float angleInRadians) const throw () |
| Returns a transform which is the same as this one followed by a rotation. | |
| const AffineTransform | rotated (const float angleInRadians, const float pivotX, const float pivotY) const throw () |
| Returns a transform which is the same as this one followed by a rotation about a given point. | |
| const AffineTransform | scaled (const float factorX, const float factorY) const throw () |
| Returns a transform which is the same as this one followed by a re-scaling. | |
| const AffineTransform | sheared (const float shearX, const float shearY) const throw () |
| Returns a transform which is the same as this one followed by a shear. | |
| const AffineTransform | inverted () const throw () |
| Returns a matrix which is the inverse operation of this one. | |
| const AffineTransform | followedBy (const AffineTransform &other) const throw () |
| Returns the result of concatenating another transformation after this one. | |
| bool | isIdentity () const throw () |
| Returns true if this transform has no effect on points. | |
| bool | isSingularity () const throw () |
| Returns true if this transform maps to a singularity - i.e. | |
| bool | isOnlyTranslation () const throw () |
| Returns true if the transform only translates, and doesn't scale or rotate the points. | |
| float | getTranslationX () const throw () |
| If this transform is only a translation, this returns the X offset. | |
| float | getTranslationY () const throw () |
| If this transform is only a translation, this returns the X offset. | |
Static Public Member Functions | |
| static const AffineTransform | translation (const float deltaX, const float deltaY) throw () |
| Returns a new transform which is a translation. | |
| static const AffineTransform | rotation (const float angleInRadians) throw () |
| Returns a new transform which is a rotation about (0, 0). | |
| static const AffineTransform | rotation (const float angleInRadians, const float pivotX, const float pivotY) throw () |
| Returns a new transform which is a rotation about a given point. | |
| static const AffineTransform | scale (const float factorX, const float factorY) throw () |
| Returns a new transform which is a re-scale about the origin. | |
Public Attributes | |
| juce_UseDebuggingNewOperator float | mat00 |
| juce_UseDebuggingNewOperator float | mat01 |
| juce_UseDebuggingNewOperator float | mat02 |
| float | mat10 |
| float | mat11 |
| float | mat12 |
Static Public Attributes | |
| static const AffineTransform | identity |
| A ready-to-use identity transform, which you can use to append other transformations to. | |
Represents a 2D affine-transformation matrix.
An affine transformation is a transformation such as a rotation, scale, shear, resize or translation.
These are used for various 2D transformation tasks, e.g. with Path objects.
| AffineTransform::AffineTransform | ( | ) | throw () |
Creates an identity transform.
| AffineTransform::AffineTransform | ( | const AffineTransform & | other | ) | throw () |
Creates a copy of another transform.
| AffineTransform::AffineTransform | ( | const float | mat00, | |
| const float | mat01, | |||
| const float | mat02, | |||
| const float | mat10, | |||
| const float | mat11, | |||
| const float | mat12 | |||
| ) | throw () |
Creates a transform from a set of raw matrix values.
The resulting matrix is:
(mat00 mat01 mat02) (mat10 mat11 mat12) ( 0 0 1 )
| AffineTransform& AffineTransform::operator= | ( | const AffineTransform & | other | ) | throw () |
Copies from another AffineTransform object.
| bool AffineTransform::operator== | ( | const AffineTransform & | other | ) | const throw () |
Compares two transforms.
| bool AffineTransform::operator!= | ( | const AffineTransform & | other | ) | const throw () |
Compares two transforms.
| void AffineTransform::transformPoint | ( | float & | x, | |
| float & | y | |||
| ) | const throw () |
Transforms a 2D co-ordinate using this matrix.
| void AffineTransform::transformPoint | ( | double & | x, | |
| double & | y | |||
| ) | const throw () |
Transforms a 2D co-ordinate using this matrix.
| const AffineTransform AffineTransform::translated | ( | const float | deltaX, | |
| const float | deltaY | |||
| ) | const throw () |
Returns a new transform which is the same as this one followed by a translation.
| static const AffineTransform AffineTransform::translation | ( | const float | deltaX, | |
| const float | deltaY | |||
| ) | throw () [static] |
Returns a new transform which is a translation.
| const AffineTransform AffineTransform::rotated | ( | const float | angleInRadians | ) | const throw () |
Returns a transform which is the same as this one followed by a rotation.
The rotation is specified by a number of radians to rotate clockwise, centred around the origin (0, 0).
| const AffineTransform AffineTransform::rotated | ( | const float | angleInRadians, | |
| const float | pivotX, | |||
| const float | pivotY | |||
| ) | const throw () |
Returns a transform which is the same as this one followed by a rotation about a given point.
The rotation is specified by a number of radians to rotate clockwise, centred around the co-ordinates passed in.
| static const AffineTransform AffineTransform::rotation | ( | const float | angleInRadians | ) | throw () [static] |
Returns a new transform which is a rotation about (0, 0).
| static const AffineTransform AffineTransform::rotation | ( | const float | angleInRadians, | |
| const float | pivotX, | |||
| const float | pivotY | |||
| ) | throw () [static] |
Returns a new transform which is a rotation about a given point.
| const AffineTransform AffineTransform::scaled | ( | const float | factorX, | |
| const float | factorY | |||
| ) | const throw () |
Returns a transform which is the same as this one followed by a re-scaling.
The scaling is centred around the origin (0, 0).
| static const AffineTransform AffineTransform::scale | ( | const float | factorX, | |
| const float | factorY | |||
| ) | throw () [static] |
Returns a new transform which is a re-scale about the origin.
| const AffineTransform AffineTransform::sheared | ( | const float | shearX, | |
| const float | shearY | |||
| ) | const throw () |
Returns a transform which is the same as this one followed by a shear.
The shear is centred around the origin (0, 0).
| const AffineTransform AffineTransform::inverted | ( | ) | const throw () |
Returns a matrix which is the inverse operation of this one.
Some matrices don't have an inverse - in this case, the method will just return an identity transform.
| const AffineTransform AffineTransform::followedBy | ( | const AffineTransform & | other | ) | const throw () |
Returns the result of concatenating another transformation after this one.
| bool AffineTransform::isIdentity | ( | ) | const throw () |
Returns true if this transform has no effect on points.
| bool AffineTransform::isSingularity | ( | ) | const throw () |
Returns true if this transform maps to a singularity - i.e.
if it has no inverse.
| bool AffineTransform::isOnlyTranslation | ( | ) | const throw () |
Returns true if the transform only translates, and doesn't scale or rotate the points.
| float AffineTransform::getTranslationX | ( | ) | const throw () |
If this transform is only a translation, this returns the X offset.
| float AffineTransform::getTranslationY | ( | ) | const throw () |
If this transform is only a translation, this returns the X offset.
const AffineTransform AffineTransform::identity [static] |
A ready-to-use identity transform, which you can use to append other transformations to.
e.g.
AffineTransform myTransform = AffineTransform::identity.rotated (.5f) .scaled (2.0f);
| juce_UseDebuggingNewOperator float AffineTransform::mat00 |
| juce_UseDebuggingNewOperator float AffineTransform::mat01 |
| juce_UseDebuggingNewOperator float AffineTransform::mat02 |
| float AffineTransform::mat10 |
| float AffineTransform::mat11 |
| float AffineTransform::mat12 |
1.6.3