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

Side by Side Diff: include/core/SkMatrix.h

Issue 151923006: Add rotation APIs in radians to SkCanvas, SkMatrix Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 */ 194 */
195 bool setIDiv(int divx, int divy); 195 bool setIDiv(int divx, int divy);
196 /** Set the matrix to rotate by the specified number of degrees, with a 196 /** Set the matrix to rotate by the specified number of degrees, with a
197 pivot point at (px, py). The pivot point is the coordinate that should 197 pivot point at (px, py). The pivot point is the coordinate that should
198 remain unchanged by the specified transformation. 198 remain unchanged by the specified transformation.
199 */ 199 */
200 void setRotate(SkScalar degrees, SkScalar px, SkScalar py); 200 void setRotate(SkScalar degrees, SkScalar px, SkScalar py);
201 /** Set the matrix to rotate about (0,0) by the specified number of degrees. 201 /** Set the matrix to rotate about (0,0) by the specified number of degrees.
202 */ 202 */
203 void setRotate(SkScalar degrees); 203 void setRotate(SkScalar degrees);
204 /** Set the matrix to rotate by the specified number of radians, with a
205 pivot point at (px, py). The pivot point is the coordinate that should
206 remain unchanged by the specified transformation.
207 */
208 void setRotateRadians(SkScalar radians, SkScalar px, SkScalar py);
209 /** Set the matrix to rotate about (0,0) by the specified number of radians.
210 */
211 void setRotateRadians(SkScalar radians);
204 /** Set the matrix to rotate by the specified sine and cosine values, with 212 /** Set the matrix to rotate by the specified sine and cosine values, with
205 a pivot point at (px, py). The pivot point is the coordinate that 213 a pivot point at (px, py). The pivot point is the coordinate that
206 should remain unchanged by the specified transformation. 214 should remain unchanged by the specified transformation.
207 */ 215 */
208 void setSinCos(SkScalar sinValue, SkScalar cosValue, 216 void setSinCos(SkScalar sinValue, SkScalar cosValue,
209 SkScalar px, SkScalar py); 217 SkScalar px, SkScalar py);
210 /** Set the matrix to rotate by the specified sine and cosine values. 218 /** Set the matrix to rotate by the specified sine and cosine values.
211 */ 219 */
212 void setSinCos(SkScalar sinValue, SkScalar cosValue); 220 void setSinCos(SkScalar sinValue, SkScalar cosValue);
213 /** Set the matrix to skew by sx and sy, with a pivot point at (px, py). 221 /** Set the matrix to skew by sx and sy, with a pivot point at (px, py).
(...skipping 23 matching lines...) Expand all
237 */ 245 */
238 bool preScale(SkScalar sx, SkScalar sy); 246 bool preScale(SkScalar sx, SkScalar sy);
239 /** Preconcats the matrix with the specified rotation. 247 /** Preconcats the matrix with the specified rotation.
240 M' = M * R(degrees, px, py) 248 M' = M * R(degrees, px, py)
241 */ 249 */
242 bool preRotate(SkScalar degrees, SkScalar px, SkScalar py); 250 bool preRotate(SkScalar degrees, SkScalar px, SkScalar py);
243 /** Preconcats the matrix with the specified rotation. 251 /** Preconcats the matrix with the specified rotation.
244 M' = M * R(degrees) 252 M' = M * R(degrees)
245 */ 253 */
246 bool preRotate(SkScalar degrees); 254 bool preRotate(SkScalar degrees);
255 /** Preconcats the matrix with the specified rotation.
256 M' = M * R(radians, px, py)
257 */
258 bool preRotateRadians(SkScalar degrees, SkScalar px, SkScalar py);
259 /** Preconcats the matrix with the specified rotation.
260 M' = M * R(radians)
261 */
262 bool preRotateRadians(SkScalar degrees);
247 /** Preconcats the matrix with the specified skew. 263 /** Preconcats the matrix with the specified skew.
248 M' = M * K(kx, ky, px, py) 264 M' = M * K(kx, ky, px, py)
249 */ 265 */
250 bool preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py); 266 bool preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py);
251 /** Preconcats the matrix with the specified skew. 267 /** Preconcats the matrix with the specified skew.
252 M' = M * K(kx, ky) 268 M' = M * K(kx, ky)
253 */ 269 */
254 bool preSkew(SkScalar kx, SkScalar ky); 270 bool preSkew(SkScalar kx, SkScalar ky);
255 /** Preconcats the matrix with the specified matrix. 271 /** Preconcats the matrix with the specified matrix.
256 M' = M * other 272 M' = M * other
(...skipping 17 matching lines...) Expand all
274 */ 290 */
275 bool postIDiv(int divx, int divy); 291 bool postIDiv(int divx, int divy);
276 /** Postconcats the matrix with the specified rotation. 292 /** Postconcats the matrix with the specified rotation.
277 M' = R(degrees, px, py) * M 293 M' = R(degrees, px, py) * M
278 */ 294 */
279 bool postRotate(SkScalar degrees, SkScalar px, SkScalar py); 295 bool postRotate(SkScalar degrees, SkScalar px, SkScalar py);
280 /** Postconcats the matrix with the specified rotation. 296 /** Postconcats the matrix with the specified rotation.
281 M' = R(degrees) * M 297 M' = R(degrees) * M
282 */ 298 */
283 bool postRotate(SkScalar degrees); 299 bool postRotate(SkScalar degrees);
300 /** Postconcats the matrix with the specified rotation.
301 M' = R(radians, px, py) * M
302 */
303 bool postRotateRadians(SkScalar degrees, SkScalar px, SkScalar py);
304 /** Postconcats the matrix with the specified rotation.
305 M' = R(radians) * M
306 */
307 bool postRotateRadians(SkScalar degrees);
284 /** Postconcats the matrix with the specified skew. 308 /** Postconcats the matrix with the specified skew.
285 M' = K(kx, ky, px, py) * M 309 M' = K(kx, ky, px, py) * M
286 */ 310 */
287 bool postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py); 311 bool postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py);
288 /** Postconcats the matrix with the specified skew. 312 /** Postconcats the matrix with the specified skew.
289 M' = K(kx, ky) * M 313 M' = K(kx, ky) * M
290 */ 314 */
291 bool postSkew(SkScalar kx, SkScalar ky); 315 bool postSkew(SkScalar kx, SkScalar ky);
292 /** Postconcats the matrix with the specified matrix. 316 /** Postconcats the matrix with the specified matrix.
293 M' = other * M 317 M' = other * M
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 718 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
695 int count); 719 int count);
696 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 720 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
697 721
698 static const MapPtsProc gMapPtsProcs[]; 722 static const MapPtsProc gMapPtsProcs[];
699 723
700 friend class SkPerspIter; 724 friend class SkPerspIter;
701 }; 725 };
702 726
703 #endif 727 #endif
OLDNEW
« include/core/SkCanvas.h ('K') | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698