Graphics Reference
In-Depth Information
For this reason, you will often see 2D transforms represented as a 3×3 matrix (instead of
2×3). You will also often see the matrix shown in a 3-column-by-2-row format instead,
with the vector values stacked vertically. This is known as column-major format. The way
we've presented it in Figure 5.1 is row-major format. It doesn't actually matter which
representation you use as long as you are consistent.
Figure 5.1 CGAffineTransform and CGPoint represented as matrices
When the transform matrix is applied to a layer, each corner point of the layer rectangle is
individually transformed, resulting in a new quadrilateral shape. The “affine” in
CGAffineTransform just means that whatever values are used for the matrix, lines in
the layer that were parallel before the transform will remain parallel after the transform. A
CGAffineTransform can be used to define any transform that meets that criterion.
Figure 5.2 shows some examples of affine and nonaffine transforms:
Figure 5.2 Affine and nonaffine transforms
Search WWH ::




Custom Search