![]() |
Flutter Engine
The Flutter Engine
|
#include <SkM44.h>
Public Types | |
enum | Uninitialized_Constructor { kUninitialized_Constructor } |
enum | NaN_Constructor { kNaN_Constructor } |
Static Public Member Functions | |
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) |
Friends | |
class | SkMatrixPriv |
SkM44 | operator* (const SkM44 &a, const SkM44 &b) |
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)
|
default |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlineexplicit |
|
inline |
Definition at line 409 of file SkM44.h.
|
inlinestatic |
void SkM44::dump | ( | ) | const |
Definition at line 291 of file SkM44.cpp.
|
inline |
void SkM44::getRowMajor | ( | SkScalar | v[] | ) | const |
Definition at line 44 of file SkM44.cpp.
bool SkM44::invert | ( | SkM44 * | inverse | ) | const |
If this is invertible, return that in inverse and return true. If it is not invertible, return false and leave the inverse parameter unchanged.
We always perform the calculation in doubles, to avoid prematurely losing precision along the way. This relies on the compiler automatically promoting our SkScalar values to double (if needed).
Definition at line 247 of file SkM44.cpp.
|
inline |
Definition at line 331 of file SkM44.cpp.
SkV4 SkM44::map | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) | const |
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.
|
inline |
bool SkM44::operator== | ( | const SkM44 & | other | ) | const |
|
static |
Definition at line 343 of file SkM44.cpp.
|
inline |
Set this matrix to rotate about the specified axis vector, by an angle specified in radians.
Note: axis is not assumed to be unit-length, so it will be normalized internally. If axis is already unit-length, call setRotateAboutUnitRadians() instead.
Set this matrix to rotate about the specified unit-length axis vector, by an angle specified in radians.
This does not attempt to verify that axis.length() == 1.
Definition at line 332 of file SkM44.h.
Set this matrix to rotate about the specified unit-length axis vector, by an angle specified by its sin() and cos().
This does not attempt to verify that axis.length() == 1 or that the sin,cos values are correct.
SkM44 SkM44::transpose | ( | ) | const |
|
friend |