Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: include/core/SkMatrix.h

Issue 22330004: Add a map homogenous points to SkMatrix (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | src/core/SkMatrix.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMatrix.h
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index f148e390b5cd4930f2d985f61a286cda3748b7cc..432670eae3c5d6f5ce6d9b4d9e94b72bc820daa1 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -423,6 +423,19 @@ public:
}
}
+ /** Apply this matrix to the array of homogenous points, specified by src,
+ where a homogenous point is defined by 3 contiguous scalar values,
+ and write the transformed points into the array of scalars specified by dst.
+ dst[] = M * src[]
+ @param dst Where the transformed coordinates are written. It must
+ contain at least 3 * count entries
+ @param src The original coordinates that are to be transformed. It
+ must contain at least 3 * count entries
+ @param count The number of points in src to read, and then transform
+ into dst.
+ */
+ void mapHomogenousPoints(SkScalar dst[], const SkScalar src[], int count) const;
+
void mapXY(SkScalar x, SkScalar y, SkPoint* result) const {
SkASSERT(result);
this->getMapXYProc()(*this, x, y, result);
@@ -666,6 +679,8 @@ private:
int count);
static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
+ static void Homogenous_pts(const SkMatrix&, SkScalar dst[], const SkScalar[], int);
+
static const MapPtsProc gMapPtsProcs[];
friend class SkPerspIter;
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | src/core/SkMatrix.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698