/// <summary>
		/// <para>Checks whether an affine transform is the identity transform.</para>
		/// <para>Original signature is : bool CGAffineTransformIsIdentity ( CGAffineTransform t );</para>
		/// <para>Available in Mac OS X v10.4 and later.</para>
		/// </summary>
		/// <param name="t">The affine transform to check.</param>
		/// <returns>Returns true if t is the identity transform, false otherwise.</returns>
		public static bool IsIdentity (CGAffineTransform t)
		{
			return ((t.a == 1.0) &&
				(t.b == 0.0) &&
				(t.c == 0.0) &&
				(t.d == 1.0) &&
				(t.tx == 0.0) &&
				(t.ty == 0.0));
		}
		/// <summary>
		/// <para>Returns an affine transformation matrix constructed by inverting an existing affine transform.</para>
		/// <para>Original signature is : CGAffineTransform CGAffineTransformInvert ( CGAffineTransform t );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="t">An existing affine transform.</param>
		/// <returns>A new affine transformation matrix. If the affine transform passed in parameter t cannot be inverted, Quartz returns the affine transform unchanged.</returns>
		public static CGAffineTransform Invert (CGAffineTransform t)
		{
			// TODO : To implement
			throw new NotImplementedException ();
		}
		/// <summary>
		/// <para>Returns an affine transformation matrix constructed by combining two existing affine transforms.</para>
		/// <para>Original signature is : CGAffineTransform CGAffineTransformConcat ( CGAffineTransform t1, CGAffineTransform t2 );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="t1">The first affine transform.</param>
		/// <param name="t2">The second affine transform. This affine transform is concatenated to the first affine transform.</param>
		/// <returns>A new affine transformation matrix. That is, t' = t1*t2.</returns>
		public static CGAffineTransform Concat (CGAffineTransform t1, CGAffineTransform t2)
		{
			// TODO : To implement
			throw new NotImplementedException ();
		}
		/// <summary>
		/// <para>Checks whether two affine transforms are equal.</para>
		/// <para>Original signature is : bool CGAffineTransformEqualToTransform ( CGAffineTransform t1, CGAffineTransform t2 );</para>
		/// <para>Available in Mac OS X v10.4 and later.</para>
		/// </summary>
		/// <param name="t1">An affine transform.</param>
		/// <param name="t2">An affine transform.</param>
		/// <returns>Returns true if t1 and t2 are equal, false otherwise.</returns>
		public static bool EqualToTransform (CGAffineTransform t1, CGAffineTransform t2)
		{
			return Equals (t1, t2);
		}
		/// <summary>
		/// <para>Applies an affine transform to a rectangle.</para>
		/// <para>Original signature is : CGRect CGRectApplyAffineTransform ( CGRect rect, CGAffineTransform t );</para>
		/// <para>Available in Mac OS X v10.4 and later.</para>
		/// </summary>
		/// <param name="rect">The rectangle whose corner points you want to transform.</param>
		/// <param name="t">The affine transform to apply to the rect parameter.</param>
		/// <returns>The transformed rectangle.</returns>
		public static CGRect CGRectApplyAffineTransform (CGRect rect, CGAffineTransform t)
		{
			// TODO : To implement
			throw new NotImplementedException ();
		}
		/// <summary>
		/// <para>Returns the height and width resulting from a transformation of an existing height and width.</para>
		/// <para>Original signature is : CGSize CGSizeApplyAffineTransform ( CGSize size, CGAffineTransform t );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="size">A size that specifies the height and width to transform.</param>
		/// <param name="t">The affine transform to apply.</param>
		/// <returns>A new size resulting from applying the specified affine transform to the existing size.</returns>
		public static CGSize CGSizeApplyAffineTransform (CGSize size, CGAffineTransform t)
		{
			return new CGSize (
                           t.a * size.width + t.c * size.height + t.tx, 
                           t.b * size.width + t.d * size.height + t.ty
			);
		}
		/// <summary>
		/// <para>Returns the point resulting from an affine transformation of an existing point.</para>
		/// <para>Original signature is : CGPoint CGPointApplyAffineTransform ( CGPoint point, CGAffineTransform t );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="point">A point that specifies the x- and y-coordinates to transform.</param>
		/// <param name="t">The affine transform to apply.</param>
		/// <returns>A new point resulting from applying the specified affine transform to the existing point.</returns>
		public static CGPoint CGPointApplyAffineTransform (CGPoint point, CGAffineTransform t)
		{
			return new CGPoint (
                           t.a * point.x + t.c * point.y + t.tx, 
                           t.b * point.x + t.d * point.y + t.ty
			);
		}
		/// <summary>
		/// <para>Returns an affine transformation matrix constructed by translating an existing affine transform.</para>
		/// <para>Original signature is : CGAffineTransform CGAffineTransformTranslate ( CGAffineTransform t, CGFloat tx, CGFloat ty );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="t">An existing affine transform.</param>
		/// <param name="tx">The value by which to move x values with the affine transform.</param>
		/// <param name="ty">The value by which to move y values with the affine transform.</param>
		/// <returns>A new affine transformation matrix.</returns>
		public static CGAffineTransform Translate (CGAffineTransform t, CGFloat tx, CGFloat ty)
		{
			return new CGAffineTransform (
                            t.a,
                            t.b,
                            t.c, 
                            t.d,
                            t.tx + tx,
                            t.ty + ty
			);
		}
		/// <summary>
		/// <para>Returns an affine transformation matrix constructed by scaling an existing affine transform.</para>
		/// <para>Original signature is : CGAffineTransform CGAffineTransformScale ( CGAffineTransform t, CGFloat sx, CGFloat sy );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="t">An existing affine transform.</param>
		/// <param name="sx">The value by which to scale x values of the affine transform.</param>
		/// <param name="sy">The value by which to scale y values of the affine transform.</param>
		/// <returns>A new affine transformation matrix.</returns>
		public static CGAffineTransform Scale (CGAffineTransform t, CGFloat sx, CGFloat sy)
		{
			return new CGAffineTransform (
                            t.a * sx, 
                            t.b * sx, 
                            t.c * sy,
                            t.d * sy,
                            t.tx * sx,
                            t.ty * sy
			);
		}
Exemplo n.º 10
0
		/// <summary>
		/// <para>Returns an affine transformation matrix constructed by rotating an existing affine transform.</para>
		/// <para>Original signature is : CGAffineTransform CGAffineTransformRotate ( CGAffineTransform t, CGFloat angle );</para>
		/// <para>Available in Mac OS X version 10.0 and later.</para>
		/// </summary>
		/// <param name="t">An existing affine transform.</param>
		/// <param name="angle">The angle, in radians, by which to rotate the affine transform.</param>
		/// <returns>A new affine transformation matrix.</returns>
		public static CGAffineTransform Rotate (CGAffineTransform t, CGFloat angle)
		{
			return new CGAffineTransform (
                            t.a * Math.Cos (angle) - t.b * Math.Sin (angle),     
                            t.a * Math.Sin (angle) + t.b * Math.Cos (angle),      
                            t.c * Math.Cos (angle) - t.d * Math.Sin (angle),        
                            t.c * Math.Sin (angle) + t.d * Math.Cos (angle),        
                            t.tx * Math.Cos (angle) - t.ty * Math.Sin (angle),       
                            t.tx * Math.Sin (angle) + t.ty * Math.Cos (angle)
			);
		}
Exemplo n.º 11
0
		/// <summary>
		///     <para>Return a transform with the same effect as affine transform 'm'.</para>
		///     <para>Original signature is : CATransform3D CATransform3DMakeAffineTransform (CGAffineTransform m)</para>
		/// 	<para>Available in Mac OS X version 10.5 and later.</para>
		/// </summary>
		public static CATransform3D Make (CGAffineTransform m)
		{
			// TODO : To implement
			throw new NotImplementedException ();
		}