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

Unified Diff: include/core/SkMatrix.h

Issue 19569007: Add basic SVD support to SkMatrix. Allows you to pull out the x- and y-scale factors, sandwiched by… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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') | no next file with comments »
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..80ef9cb3f6266958bfb421e086efd3407c1e304e 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -96,6 +96,16 @@ public:
*/
bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const;
+ /** Decomposes the upper 2x2 of the matrix into a rotation, followed by a non-uniform scale,
+ followed by another rotation. Returns true if successful.
+ If the scale factors are uniform, then rotation1 will be 0.
+ If there is a reflection, yScale will be negative.
+ Returns false if the matrix is degenerate.
reed1 2013/07/18 14:15:54 ... or perspective?
+ */
+ bool decomposeUpper2x2(SkScalar* rotation0,
+ SkScalar* xScale, SkScalar* yScale,
+ SkScalar* rotation1) const;
+
enum {
kMScaleX,
kMSkewX,
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698