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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMatrix_DEFINED 10 #ifndef SkMatrix_DEFINED
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Returns false if other transformation types are included or is degenerat e 89 Returns false if other transformation types are included or is degenerat e
90 */ 90 */
91 bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const; 91 bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const;
92 92
93 /** Returns true if the matrix contains only translation, rotation or scale 93 /** Returns true if the matrix contains only translation, rotation or scale
94 (non-uniform scale is allowed). 94 (non-uniform scale is allowed).
95 Returns false if other transformation types are included or is degenerat e 95 Returns false if other transformation types are included or is degenerat e
96 */ 96 */
97 bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const; 97 bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const;
98 98
99 /** Decomposes the upper 2x2 of the matrix into a rotation, followed by a no n-uniform scale,
100 followed by another rotation. Returns true if successful.
101 If the scale factors are uniform, then rotation1 will be 0.
102 If there is a reflection, yScale will be negative.
103 Returns false if the matrix is degenerate.
reed1 2013/07/18 14:15:54 ... or perspective?
104 */
105 bool decomposeUpper2x2(SkScalar* rotation0,
106 SkScalar* xScale, SkScalar* yScale,
107 SkScalar* rotation1) const;
108
99 enum { 109 enum {
100 kMScaleX, 110 kMScaleX,
101 kMSkewX, 111 kMSkewX,
102 kMTransX, 112 kMTransX,
103 kMSkewY, 113 kMSkewY,
104 kMScaleY, 114 kMScaleY,
105 kMTransY, 115 kMTransY,
106 kMPersp0, 116 kMPersp0,
107 kMPersp1, 117 kMPersp1,
108 kMPersp2 118 kMPersp2
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 675 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
666 int count); 676 int count);
667 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 677 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
668 678
669 static const MapPtsProc gMapPtsProcs[]; 679 static const MapPtsProc gMapPtsProcs[];
670 680
671 friend class SkPerspIter; 681 friend class SkPerspIter;
672 }; 682 };
673 683
674 #endif 684 #endif
OLDNEW
« 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