25 #define _function(inline) function inline { return _##inline; }
27 _function(CGAffineTransformMake(a, b, c, d,
tx, ty))
28 _function(CGAffineTransformMakeIdentity())
29 _function(CGAffineTransformMakeCopy(anAffineTransform))
31 _function(CGAffineTransformMakeScale(sx, sy))
32 _function(CGAffineTransformMakeTranslation(
tx, ty))
33 _function(CGAffineTransformTranslate(aTransform, tx, ty))
34 _function(CGAffineTransformScale(aTransform, sx, sy))
36 _function(CGAffineTransformConcat(lhs, rhs))
37 _function(CGPointApplyAffineTransform(aPoint, aTransform))
38 _function(CGSizeApplyAffineTransform(aSize, aTransform))
40 _function(CGAffineTransformIsIdentity(aTransform))
41 _function(CGAffineTransformEqualToTransform(lhs, rhs))
43 _function(CGStringCreateWithCGAffineTransform(aTransform))
50 function CGAffineTransformCreateCopy(aTransform)
52 return _CGAffineTransformMakeCopy(aTransform);
65 var sin = SIN(anAngle),
68 return _CGAffineTransformMake(cos, sin, -sin, cos, 0.0, 0.0);
80 var sin = SIN(anAngle),
84 a:aTransform.a * cos + aTransform.c * sin,
85 b:aTransform.b * cos + aTransform.d * sin,
86 c:aTransform.c * cos - aTransform.a * sin,
87 d:aTransform.d * cos - aTransform.b * sin,
101 var determinant = 1 / (aTransform.a * aTransform.d - aTransform.b * aTransform.c);
104 a:determinant * aTransform.d,
105 b:-determinant * aTransform.b,
106 c:-determinant * aTransform.c,
107 d:determinant * aTransform.a,
108 tx:determinant * (aTransform.c * aTransform.ty - aTransform.d * aTransform.tx),
109 ty:determinant * (aTransform.b * aTransform.tx - aTransform.a * aTransform.ty)
123 var top = _CGRectGetMinY(aRect),
124 left = _CGRectGetMinX(aRect),
125 right = _CGRectGetMaxX(aRect),
126 bottom = _CGRectGetMaxY(aRect),
127 topLeft = CGPointApplyAffineTransform(_CGPointMake(left, top), anAffineTransform),
128 topRight = CGPointApplyAffineTransform(_CGPointMake(right, top), anAffineTransform),
129 bottomLeft = CGPointApplyAffineTransform(_CGPointMake(left, bottom), anAffineTransform),
130 bottomRight = CGPointApplyAffineTransform(_CGPointMake(right, bottom), anAffineTransform),
131 minX = MIN(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x),
132 maxX = MAX(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x),
133 minY = MIN(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y),
134 maxY = MAX(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
136 return _CGRectMake(minX, minY, (maxX - minX), (maxY - minY));
147 return '{' + anAffineTransform.a +
", " + anAffineTransform.b +
", " + anAffineTransform.c +
", " + anAffineTransform.d +
", " + anAffineTransform.tx +
", " + anAffineTransform.ty +
'}';