52 const float*
ptr()
const {
return &
x; }
53 float*
ptr() {
return &
x; }
60 return x == v.
x &&
y == v.
y && z == v.
z;
75 return {
x*v.
x,
y*v.
y, z*v.
z };
78 return { v.
x*
s, v.
y*
s, v.
z*
s };
94 const float*
ptr()
const {
return &
x; }
95 float*
ptr() {
return &
x; }
102 return x == v.
x &&
y == v.
y && z == v.
z &&
w == v.
w;
116 return {
x*v.
x,
y*v.
y, z*v.
z,
w*v.
w };
119 return { v.
x*
s, v.
y*
s, v.
z*
s, v.
w*
s };
129 const float*
ptr()
const {
return &
x; }
134 return this->ptr()[
i];
138 return this->ptr()[
i];
163 this->setConcat(
a,
b);
167 kUninitialized_Constructor
189 : fMat{m0, m1, m2, m3,
196 SkM44 m(kUninitialized_Constructor);
204 SkM44 m(kUninitialized_Constructor);
213 return SkM44(r[ 0], r[ 1], r[ 2], r[ 3],
214 r[ 4], r[ 5], r[ 6], r[ 7],
215 r[ 8], r[ 9], r[10], r[11],
216 r[12], r[13], r[14], r[15]);
219 return SkM44(c[0], c[4], c[ 8], c[12],
220 c[1], c[5], c[ 9], c[13],
221 c[2], c[6], c[10], c[14],
222 c[3], c[7], c[11], c[15]);
240 SkM44 m(kUninitialized_Constructor);
241 m.setRotate(axis, radians);
249 static SkM44 Perspective(
float near,
float far,
float angle);
253 return !(other == *
this);
257 memcpy(v, fMat,
sizeof(fMat));
259 void getRowMajor(
SkScalar v[])
const;
264 return fMat[c*4 + r];
269 fMat[c*4 + r] =
value;
274 return {fMat[
i + 0], fMat[
i + 4], fMat[
i + 8], fMat[
i + 12]};
278 return {fMat[
i*4 + 0], fMat[
i*4 + 1], fMat[
i*4 + 2], fMat[
i*4 + 3]};
290 memcpy(&fMat[
i*4], v.
ptr(),
sizeof(v));
294 *
this = { 1, 0, 0, 0,
302 *
this = { 1, 0, 0,
x,
310 *
this = {
x, 0, 0, 0,
352 return this->setConcat(*
this,
m);
356 return this->setConcat(
m, *
this);
371 void normalizePerspective();
385 [[nodiscard]]
SkM44 transpose()
const;
391 SkV4 map(
float x,
float y,
float z,
float w)
const;
393 return this->
map(v.
x, v.
y, v.
z, v.
w);
396 auto v4 = this->
map(v.
x, v.
y, v.
z, 0);
411 fMat[1], fMat[5], fMat[13],
412 fMat[3], fMat[7], fMat[15]);
static bool SkIsFinite(T x, Pack... values)
static SkV4 v4(SkV3 v, SkScalar w)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
static SkScalar center(float pos0, float pos1)
SkM44 & postConcat(const SkM44 &m)
static SkM44 Rows(const SkV4 &r0, const SkV4 &r1, const SkV4 &r2, const SkV4 &r3)
void getColMajor(SkScalar v[]) const
friend SkM44 operator*(const SkM44 &a, const SkM44 &b)
static SkM44 RowMajor(const SkScalar r[16])
void setCol(int i, const SkV4 &v)
SkM44 & setTranslate(SkScalar x, SkScalar y, SkScalar z=0)
static SkM44 ColMajor(const SkScalar c[16])
SkM44(const SkM44 &a, const SkM44 &b)
void setRow(int i, const SkV4 &v)
SkScalar rc(int r, int c) const
bool operator!=(const SkM44 &other) const
static SkM44 Rotate(SkV3 axis, SkScalar radians)
Uninitialized_Constructor
SkM44 & preConcat(const SkM44 &m)
SkM44(const SkM44 &src)=default
constexpr SkM44(NaN_Constructor)
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
SkM44(Uninitialized_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)
SkV4 operator*(const SkV4 &v) const
SkM44 & setScale(SkScalar x, SkScalar y, SkScalar z=1)
void setRC(int r, int c, SkScalar value)
SkM44 & operator=(const SkM44 &src)=default
SkM44(const SkMatrix &src)
SkM44 & setRotateUnit(SkV3 axis, SkScalar radians)
SkV3 operator*(SkV3 v) const
static SkM44 Scale(SkScalar x, SkScalar y, SkScalar z=1)
static SkM44 Cols(const SkV4 &c0, const SkV4 &c1, const SkV4 &c2, const SkV4 &c3)
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static void Normalize(char *s)
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
static SkV2 Normalize(SkV2 v)
void operator*=(SkScalar s)
static SkScalar Dot(SkV2 a, SkV2 b)
SkScalar dot(SkV2 v) const
friend SkV2 operator*(SkV2 v, SkScalar s)
SkV2 operator*(SkV2 v) const
SkV2 operator-(SkV2 v) const
friend SkV2 operator/(SkScalar s, SkV2 v)
SkScalar lengthSquared() const
bool operator==(const SkV2 v) const
const float * ptr() const
bool operator!=(const SkV2 v) const
static SkScalar Cross(SkV2 a, SkV2 b)
friend SkV2 operator/(SkV2 v, SkScalar s)
void operator/=(SkScalar s)
SkScalar cross(SkV2 v) const
SkV2 operator+(SkV2 v) const
friend SkV2 operator*(SkScalar s, SkV2 v)
static SkScalar Dot(const SkV3 &a, const SkV3 &b)
static SkV3 Normalize(const SkV3 &v)
static SkV3 Cross(const SkV3 &a, const SkV3 &b)
bool operator!=(const SkV3 &v) const
bool operator==(const SkV3 &v) const
friend SkV3 operator*(SkScalar s, const SkV3 &v)
SkV3 cross(const SkV3 &v) const
SkScalar dot(const SkV3 &v) const
SkV3 operator*(const SkV3 &v) const
SkV3 operator+(const SkV3 &v) const
SkScalar lengthSquared() const
friend SkV3 operator*(const SkV3 &v, SkScalar s)
SkV3 operator-(const SkV3 &v) const
void operator*=(SkScalar s)
const float * ptr() const
const float * ptr() const
SkScalar dot(const SkV4 &v) const
SkV4 operator-(const SkV4 &v) const
static SkV4 Normalize(const SkV4 &v)
SkV4 operator+(const SkV4 &v) const
friend SkV4 operator*(SkScalar s, const SkV4 &v)
static SkScalar Dot(const SkV4 &a, const SkV4 &b)
float operator[](int i) const
float & operator[](int i)
SkScalar lengthSquared() const
bool operator==(const SkV4 &v) const
SkV4 operator*(const SkV4 &v) const
bool operator!=(const SkV4 &v) const
friend SkV4 operator*(const SkV4 &v, SkScalar s)