|
| SkM44 (const SkM44 &src)=default |
|
SkM44 & | operator= (const SkM44 &src)=default |
|
constexpr | SkM44 () |
|
| SkM44 (const SkM44 &a, const SkM44 &b) |
|
| SkM44 (Uninitialized_Constructor) |
|
constexpr | SkM44 (NaN_Constructor) |
|
constexpr | SkM44 (SkScalar m0, SkScalar m4, SkScalar m8, SkScalar m12, SkScalar m1, SkScalar m5, SkScalar m9, SkScalar m13, SkScalar m2, SkScalar m6, SkScalar m10, SkScalar m14, SkScalar m3, SkScalar m7, SkScalar m11, SkScalar m15) |
|
bool | operator== (const SkM44 &other) const |
|
bool | operator!= (const SkM44 &other) const |
|
void | getColMajor (SkScalar v[]) const |
|
void | getRowMajor (SkScalar v[]) const |
|
SkScalar | rc (int r, int c) const |
|
void | setRC (int r, int c, SkScalar value) |
|
SkV4 | row (int i) const |
|
SkV4 | col (int i) const |
|
void | setRow (int i, const SkV4 &v) |
|
void | setCol (int i, const SkV4 &v) |
|
SkM44 & | setIdentity () |
|
SkM44 & | setTranslate (SkScalar x, SkScalar y, SkScalar z=0) |
|
SkM44 & | setScale (SkScalar x, SkScalar y, SkScalar z=1) |
|
SkM44 & | setRotateUnitSinCos (SkV3 axis, SkScalar sinAngle, SkScalar cosAngle) |
|
SkM44 & | setRotateUnit (SkV3 axis, SkScalar radians) |
|
SkM44 & | setRotate (SkV3 axis, SkScalar radians) |
|
SkM44 & | setConcat (const SkM44 &a, const SkM44 &b) |
|
SkM44 & | preConcat (const SkM44 &m) |
|
SkM44 & | postConcat (const SkM44 &m) |
|
void | normalizePerspective () |
|
bool | isFinite () const |
|
bool | invert (SkM44 *inverse) const |
|
SkM44 | transpose () const |
|
void | dump () const |
|
SkV4 | map (float x, float y, float z, float w) const |
|
SkV4 | operator* (const SkV4 &v) const |
|
SkV3 | operator* (SkV3 v) const |
|
SkMatrix | asM33 () const |
|
| SkM44 (const SkMatrix &src) |
|
SkM44 & | preTranslate (SkScalar x, SkScalar y, SkScalar z=0) |
|
SkM44 & | postTranslate (SkScalar x, SkScalar y, SkScalar z=0) |
|
SkM44 & | preScale (SkScalar x, SkScalar y) |
|
SkM44 & | preScale (SkScalar x, SkScalar y, SkScalar z) |
|
SkM44 & | preConcat (const SkMatrix &) |
|
|
static SkM44 | Rows (const SkV4 &r0, const SkV4 &r1, const SkV4 &r2, const SkV4 &r3) |
|
static SkM44 | Cols (const SkV4 &c0, const SkV4 &c1, const SkV4 &c2, const SkV4 &c3) |
|
static SkM44 | RowMajor (const SkScalar r[16]) |
|
static SkM44 | ColMajor (const SkScalar c[16]) |
|
static SkM44 | Translate (SkScalar x, SkScalar y, SkScalar z=0) |
|
static SkM44 | Scale (SkScalar x, SkScalar y, SkScalar z=1) |
|
static SkM44 | Rotate (SkV3 axis, SkScalar radians) |
|
static SkM44 | RectToRect (const SkRect &src, const SkRect &dst) |
|
static SkM44 | LookAt (const SkV3 &eye, const SkV3 ¢er, const SkV3 &up) |
|
static SkM44 | Perspective (float near, float far, float angle) |
|
4x4 matrix used by SkCanvas and other parts of Skia.
Skia assumes a right-handed coordinate system: +X goes to the right +Y goes down +Z goes into the screen (away from the viewer)
Definition at line 150 of file SkM44.h.
void SkM44::normalizePerspective |
( |
| ) |
|
A matrix is categorized as 'perspective' if the bottom row is not [0, 0, 0, 1]. For most uses, a bottom row of [0, 0, 0, X] behaves like a non-perspective matrix, though it will be categorized as perspective. Calling normalizePerspective() will change the matrix such that, if its bottom row was [0, 0, 0, X], it will be changed to [0, 0, 0, 1] by scaling the rest of the matrix by 1/X.
| A B C D | | A/X B/X C/X D/X | | E F G H | -> | E/X F/X G/X H/X | for X != 0 | I J K L | | I/X J/X K/X L/X | | 0 0 0 X | | 0 0 0 1 |
Definition at line 226 of file SkM44.cpp.
226 {
227
228
229
230
231 if (fMat[15] != 1 && fMat[15] != 0 && fMat[3] == 0 && fMat[7] == 0 && fMat[11] == 0) {
232 double inv = 1.0 / fMat[15];
237 fMat[15] = 1.0f;
238 }
239}
static SkM44 inv(const SkM44 &m)