diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/SkMatrix44.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h index f63f0df495..565fcf5848 100644 --- a/include/utils/SkMatrix44.h +++ b/include/utils/SkMatrix44.h @@ -37,7 +37,7 @@ #endif typedef float SkMScalar; typedef int32_t SkMIntScalar; - + static inline float SkFloatToMScalar(float x) { return x; } @@ -134,7 +134,7 @@ public: kAffine_Mask = 0x04, //!< set if the matrix skews or rotates kPerspective_Mask = 0x08 //!< set if the matrix is in perspective }; - + /** * Returns a bitfield describing the transformations the matrix may * perform. The bitfield is computed conservatively, so it may include @@ -153,7 +153,7 @@ public: inline bool isIdentity() const { return 0 == this->getType(); } - + void setIdentity(); inline void reset() { this->setIdentity();} @@ -309,6 +309,17 @@ public: return dst; } + /** + * map an array of [x, y, 0, 1] through the matrix, returning an array + * of [x', y', z', w']. + * + * @param src2 array of [x, y] pairs, with implied z=0 and w=1 + * @param count number of [x, y] pairs in src2 + * @param dst4 array of [x', y', z', w'] quads as the output. + */ + void map2(const float src2[], int count, float dst4[]) const; + void map2(const double src2[], int count, double dst4[]) const; + void dump() const; double determinant() const; @@ -319,7 +330,7 @@ private: // we are always packed with no extra bits, allowing us to call memcpy // without fear of copying uninitialized bits. mutable SkMIntScalar fTypeMask; - + enum { kUnknown_Mask = 0x80, @@ -333,7 +344,7 @@ private: SkMScalar scaleX() const { return fMat[0][0]; } SkMScalar scaleY() const { return fMat[1][1]; } SkMScalar scaleZ() const { return fMat[2][2]; } - + SkMScalar perspX() const { return fMat[0][3]; } SkMScalar perspY() const { return fMat[1][3]; } SkMScalar perspZ() const { return fMat[2][3]; } |