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

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

Issue 22816005: Add homogeneous point mapping to Matrix (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 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 size_t stride, int count) const { 416 size_t stride, int count) const {
417 SkASSERT(stride >= sizeof(SkPoint)); 417 SkASSERT(stride >= sizeof(SkPoint));
418 SkASSERT(0 == stride % sizeof(SkScalar)); 418 SkASSERT(0 == stride % sizeof(SkScalar));
419 for (int i = 0; i < count; ++i) { 419 for (int i = 0; i < count; ++i) {
420 this->mapPoints(dst, src, 1); 420 this->mapPoints(dst, src, 1);
421 src = (SkPoint*)((intptr_t)src + stride); 421 src = (SkPoint*)((intptr_t)src + stride);
422 dst = (SkPoint*)((intptr_t)dst + stride); 422 dst = (SkPoint*)((intptr_t)dst + stride);
423 } 423 }
424 } 424 }
425 425
426 /** Apply this matrix to the array of homogeneous points, specified by src,
427 where a homogeneous point is defined by 3 contiguous scalar values,
428 and write the transformed points into the array of scalars specified by dst.
429 dst[] = M * src[]
430 @param dst Where the transformed coordinates are written. It must
431 contain at least 3 * count entries
432 @param src The original coordinates that are to be transformed. It
433 must contain at least 3 * count entries
434 @param count The number of triples (homogeneous points) in src to read,
435 and then transform into dst.
436 */
437 void mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int count) c onst;
438
426 void mapXY(SkScalar x, SkScalar y, SkPoint* result) const { 439 void mapXY(SkScalar x, SkScalar y, SkPoint* result) const {
427 SkASSERT(result); 440 SkASSERT(result);
428 this->getMapXYProc()(*this, x, y, result); 441 this->getMapXYProc()(*this, x, y, result);
429 } 442 }
430 443
431 /** Apply this matrix to the array of vectors specified by src, and write 444 /** Apply this matrix to the array of vectors specified by src, and write
432 the transformed vectors into the array of vectors specified by dst. 445 the transformed vectors into the array of vectors specified by dst.
433 This is similar to mapPoints, but ignores any translation in the matrix. 446 This is similar to mapPoints, but ignores any translation in the matrix.
434 @param dst Where the transformed coordinates are written. It must 447 @param dst Where the transformed coordinates are written. It must
435 contain at least count entries 448 contain at least count entries
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 678 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
666 int count); 679 int count);
667 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 680 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
668 681
669 static const MapPtsProc gMapPtsProcs[]; 682 static const MapPtsProc gMapPtsProcs[];
670 683
671 friend class SkPerspIter; 684 friend class SkPerspIter;
672 }; 685 };
673 686
674 #endif 687 #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