#include <SkMatrix.h>
Inherited by SkTRefCnt< SkMatrix >.
The SkMatrix class holds a 3x3 matrix for transforming coordinates. SkMatrix does not have a constructor, so it must be explicitly initialized using either reset() - to construct an identity matrix, or one of the set functions (e.g. setTranslate, setRotate, etc.).
Definition at line 31 of file SkMatrix.h.
typedef void(* SkMatrix::MapPtsProc)(const SkMatrix &mat, SkPoint dst[], const SkPoint src[], int count) |
Definition at line 377 of file SkMatrix.h.
typedef void(* SkMatrix::MapXYProc)(const SkMatrix &mat, SkScalar x, SkScalar y, SkPoint *result) |
Definition at line 365 of file SkMatrix.h.
anonymous enum |
Definition at line 74 of file SkMatrix.h.
anonymous enum |
Definition at line 403 of file SkMatrix.h.
enum SkMatrix::ScaleToFit |
Definition at line 236 of file SkMatrix.h.
enum SkMatrix::TypeMask |
Enum of bit fields for the mask return by getType(). Use this to identify the complexity of the matrix.
Definition at line 36 of file SkMatrix.h.
void SkMatrix::dump | ( | ) | const |
If the matrix can be stepped in X (not complex perspective) then return true and if step[XY] is not null, return the step[XY] value. If it cannot, return false and ignore step.
uint32_t SkMatrix::flatten | ( | void * | buffer | ) | const |
SkScalar SkMatrix::get | ( | int | index | ) | const [inline] |
Definition at line 91 of file SkMatrix.h.
MapPtsProc SkMatrix::getMapPtsProc | ( | ) | const [inline] |
Definition at line 385 of file SkMatrix.h.
static MapPtsProc SkMatrix::GetMapPtsProc | ( | TypeMask | mask | ) | [inline, static] |
Definition at line 380 of file SkMatrix.h.
MapXYProc SkMatrix::getMapXYProc | ( | ) | const [inline] |
Definition at line 373 of file SkMatrix.h.
Definition at line 368 of file SkMatrix.h.
SkScalar SkMatrix::getPerspX | ( | ) | const [inline] |
Definition at line 102 of file SkMatrix.h.
SkScalar SkMatrix::getPerspY | ( | ) | const [inline] |
Definition at line 103 of file SkMatrix.h.
SkScalar SkMatrix::getScaleX | ( | ) | const [inline] |
Definition at line 96 of file SkMatrix.h.
SkScalar SkMatrix::getScaleY | ( | ) | const [inline] |
Definition at line 97 of file SkMatrix.h.
SkScalar SkMatrix::getSkewX | ( | ) | const [inline] |
Definition at line 99 of file SkMatrix.h.
SkScalar SkMatrix::getSkewY | ( | ) | const [inline] |
Definition at line 98 of file SkMatrix.h.
SkScalar SkMatrix::getTranslateX | ( | ) | const [inline] |
Definition at line 100 of file SkMatrix.h.
SkScalar SkMatrix::getTranslateY | ( | ) | const [inline] |
Definition at line 101 of file SkMatrix.h.
TypeMask SkMatrix::getType | ( | ) | const [inline] |
Returns a mask bitfield describing the types of transformations that the matrix will perform. This information is used by routines like mapPoints, to optimize its inner loops to only perform as much arithmetic as is necessary.
Definition at line 49 of file SkMatrix.h.
bool SkMatrix::invert | ( | SkMatrix * | inverse | ) | const |
If this matrix can be inverted, return true and if inverse is not null, set inverse to be the inverse of this matrix. If this matrix cannot be inverted, ignore inverse and return false
bool SkMatrix::isIdentity | ( | ) | const [inline] |
Returns true if the matrix is identity.
Definition at line 59 of file SkMatrix.h.
void SkMatrix::mapPoints | ( | SkPoint | pts[], | |
int | count | |||
) | const [inline] |
Apply this matrix to the array of points, overwriting it with the transformed values. dst[] = M * pts[]
pts | The points to be transformed. It must contain at least count entries | |
count | The number of points in pts. |
Definition at line 308 of file SkMatrix.h.
Apply this matrix to the array of points specified by src, and write the transformed points into the array of points specified by dst. dst[] = M * src[]
dst | Where the transformed coordinates are written. It must contain at least count entries | |
src | The original coordinates that are to be transformed. It must contain at least count entries | |
count | The number of points in src to read, and then transform into dst. |
Return the mean radius of a circle after it has been mapped by this matrix. NOTE: in perspective this value assumes the circle has its center at the origin.
bool SkMatrix::mapRect | ( | SkRect * | rect | ) | const [inline] |
Apply this matrix to the rectangle, and write the transformed rectangle back into it. This is accomplished by transforming the 4 corners of rect, and then setting it to the bounds of those points
rect | The rectangle to transform. |
Definition at line 355 of file SkMatrix.h.
Apply this matrix to the src rectangle, and write the transformed rectangle into dst. This is accomplished by transforming the 4 corners of src, and then setting dst to the bounds of those points.
dst | Where the transformed rectangle is written. | |
src | The original rectangle to be transformed. |
void SkMatrix::mapVectors | ( | SkVector | vecs[], | |
int | count | |||
) | const [inline] |
Apply this matrix to the array of vectors specified by src, and write the transformed vectors into the array of vectors specified by dst. This is similar to mapPoints, but ignores any translation in the matrix.
vecs | The vectors to be transformed. It must contain at least count entries | |
count | The number of vectors in vecs. |
Definition at line 336 of file SkMatrix.h.
Apply this matrix to the array of vectors specified by src, and write the transformed vectors into the array of vectors specified by dst. This is similar to mapPoints, but ignores any translation in the matrix.
dst | Where the transformed coordinates are written. It must contain at least count entries | |
src | The original coordinates that are to be transformed. It must contain at least count entries | |
count | The number of vectors in src to read, and then transform into dst. |
Definition at line 312 of file SkMatrix.h.
SkScalar SkMatrix::operator[] | ( | int | index | ) | const [inline] |
Definition at line 86 of file SkMatrix.h.
bool SkMatrix::postConcat | ( | const SkMatrix & | other | ) |
Postconcats the matrix with the specified matrix. M' = other * M
bool SkMatrix::postIDiv | ( | int | divx, | |
int | divy | |||
) |
Postconcats the matrix by dividing it by the specified integers. M' = S(1/divx, 1/divy, 0, 0) * M
bool SkMatrix::postRotate | ( | SkScalar | degrees | ) |
Postconcats the matrix with the specified rotation. M' = R(degrees) * M
Postconcats the matrix with the specified rotation. M' = R(degrees, px, py) * M
Postconcats the matrix with the specified scale. M' = S(sx, sy) * M
Postconcats the matrix with the specified scale. M' = S(sx, sy, px, py) * M
Postconcats the matrix with the specified skew. M' = K(kx, ky) * M
Postconcats the matrix with the specified skew. M' = K(kx, ky, px, py) * M
Postconcats the matrix with the specified translation. M' = T(dx, dy) * M
bool SkMatrix::preConcat | ( | const SkMatrix & | other | ) |
Preconcats the matrix with the specified matrix. M' = M * other
bool SkMatrix::preRotate | ( | SkScalar | degrees | ) |
Preconcats the matrix with the specified rotation. M' = M * R(degrees)
Preconcats the matrix with the specified rotation. M' = M * R(degrees, px, py)
Preconcats the matrix with the specified scale. M' = M * S(sx, sy)
Preconcats the matrix with the specified scale. M' = M * S(sx, sy, px, py)
Preconcats the matrix with the specified skew. M' = M * K(kx, ky)
Preconcats the matrix with the specified skew. M' = M * K(kx, ky, px, py)
Preconcats the matrix with the specified translation. M' = M * T(dx, dy)
bool SkMatrix::rectStaysRect | ( | ) | const [inline] |
Returns true if will map a rectangle to another rectangle. This can be true if the matrix is identity, scale-only, or rotates a multiple of 90 degrees.
Definition at line 67 of file SkMatrix.h.
void SkMatrix::reset | ( | ) |
Set the matrix to identity
void SkMatrix::set | ( | int | index, | |
SkScalar | value | |||
) | [inline] |
Definition at line 105 of file SkMatrix.h.
Set the matrix to the concatenation of the two specified matrices, returning true if the the result can be represented. Either of the two matrices may also be the target matrix. *this = a * b;
void SkMatrix::setPerspX | ( | SkScalar | v | ) | [inline] |
Definition at line 117 of file SkMatrix.h.
void SkMatrix::setPerspY | ( | SkScalar | v | ) | [inline] |
Definition at line 118 of file SkMatrix.h.
Set the matrix such that the specified src points would map to the specified dst points. count must be within [0..4].
src | The array of src points | |
dst | The array of dst points | |
count | The number of points to use for the transformation |
bool SkMatrix::setRectToRect | ( | const SkRect & | src, | |
const SkRect & | dst, | |||
ScaleToFit | stf | |||
) |
Set the matrix to the scale and translate values that map the source rectangle to the destination rectangle, returning true if the the result can be represented.
src | the source rectangle to map from. | |
dst | the destination rectangle to map to. | |
stf | the ScaleToFit option |
void SkMatrix::setRotate | ( | SkScalar | degrees | ) |
Set the matrix to rotate about (0,0) by the specified number of degrees.
Set the matrix to rotate by the specified number of degrees, with a pivot point at (px, py). The pivot point is the coordinate that should remain unchanged by the specified transformation.
Set the matrix to scale by sx and sy, with a pivot point at (px, py). The pivot point is the coordinate that should remain unchanged by the specified transformation.
void SkMatrix::setScaleX | ( | SkScalar | v | ) | [inline] |
Definition at line 111 of file SkMatrix.h.
void SkMatrix::setScaleY | ( | SkScalar | v | ) | [inline] |
Definition at line 112 of file SkMatrix.h.
Set the matrix to rotate by the specified sine and cosine values.
Set the matrix to rotate by the specified sine and cosine values, with a pivot point at (px, py). The pivot point is the coordinate that should remain unchanged by the specified transformation.
Set the matrix to skew by sx and sy, with a pivot point at (px, py). The pivot point is the coordinate that should remain unchanged by the specified transformation.
void SkMatrix::setSkewX | ( | SkScalar | v | ) | [inline] |
Definition at line 114 of file SkMatrix.h.
void SkMatrix::setSkewY | ( | SkScalar | v | ) | [inline] |
Definition at line 113 of file SkMatrix.h.
void SkMatrix::setTranslateX | ( | SkScalar | v | ) | [inline] |
Definition at line 115 of file SkMatrix.h.
void SkMatrix::setTranslateY | ( | SkScalar | v | ) | [inline] |
Definition at line 116 of file SkMatrix.h.
void SkMatrix::toDumpString | ( | SkString * | ) | const |
uint32_t SkMatrix::unflatten | ( | const void * | buffer | ) |
Definition at line 399 of file SkMatrix.h.
Definition at line 395 of file SkMatrix.h.
friend class SkPerspIter [friend] |
Definition at line 477 of file SkMatrix.h.