This reference is organized by the Python classes used to wrap Quartz 2D functions. The naming scheme in Quartz implies sets of object-based functions which determine the Python class in which the function is located. For example, geometric objects like points and rectangles are contained in the CGGeometry group. Functions in this group, like CGRectIntersection, become in the API methods of the implied object, in this case a rectangle. So in Python, code for rectangle intersection will look like this:
rectangle_1 = CGRectMake(10, 20, 100, 200)
rectangle_2 = CGRectMake(50, 80, 400, 100)
rectangular_intersection = rectangle_1.intersection(rectangle_2)
In the descriptions below, functions that create instances of a class will be marked with the word "creates" at the right side. Methods of a class, on the other hand, are marked with the phrase "method of" at the right. For methods that return a value, the word "returns" and the type of the return value follows the function declaration. The function declarations are not in Python, but use a C-like syntax which puts the type of the argument before the argument name. For example, this is the documentation for the CGRectMake function that creates an instance of CGRect:
Make a rect from (x, y, width, height).
Given a CGRect made with CGRectMake, you can call methods with it. The "returns" value for the intersection method is another CGRect:
Return the intersection of r1 and r2. This may return a null rect.
I produced this documentation from file /Developer/Examples/Quartz/Python/API-SUMMARY as described in Apple's documentation using Python and a modicum of brute force. There are still some gray areas, in particular where the Python wrapping isn't easily deduced from the C type. When in doubt, take a look at the API-SUMMARY file. Additional information about the functions that are being wrapped is available in the API documentation of Quartz in which function arguments are more fully described.
Instance variables.
Return the transform [ a b c d tx ty ].
Return a transform which translates by (tx, ty) t' = [ 1 0 0 1 tx ty ]
Return a transform which scales by (sx, sy) t' = [ sx 0 0 sy 0 0 ]
Return a transform which rotates by angle radians: t' = [ cos(angle) sin(angle) -sin(angle) cos(angle) 0 0 ]
Translate t by (tx, ty) and return the result: t' = [ 1 0 0 1 tx ty ] * t
Scale t by (sx, sy) and return the result: t' = [ sx 0 0 sy 0 0 ] * t
Rotate t by angle radians and return the result: t' = [ cos(angle) sin(angle) -sin(angle) cos(angle) 0 0 ] * t
Invert t and return the result. If t has zero determinant, then t is returned unchanged.
Concatenate t2 to t1 and return the result: t' = t1 * t2
Return true if t1 and t2 are equal, false otherwise.
Return true if t is the identity transform, false otherwise.
Instance variables.
Make a point from (x, y).
Return true if point1 and point2 are the same, 0 otherwise.
Transform point by t and return the result: p' = p * t where p = [ x y 1 ].
Instance variables.
Make a size from (width, height).
Return true if size1 and size2 are the same, 0 otherwise.
Transform size by t and return the result: s' = s * t where s = [ width height 0 ].
Instance variables.
Make a rect from (x, y; width, height).
Convenience function for measuring text.
Convenience function for measuring text.
Convenience function for measuring text.
Convenience function for measuring text.
Return the leftmost x-value of rect.
Return the midpoint x-value of rect.
Return the rightmost x-value of rect.
Return the bottommost y-value of rect.
Return the midpoint y-value of rect.
Return the topmost y-value of rect.
Return the width of rect.
Return the height of rect.
Return true if rect1 and rect2 are the same, 0 otherwise.
Standardize rect — i.e., convert it to an equivalent rect which has positive width and height.
Return true if rect is empty — i.e., if it has zero width or height. A null rect is defined to be empty.
Return true if rect is null — e.g., the result of intersecting two disjoint rectangles is a null rect.
Return true if rect is the infinite rectangle, false otherwise.
Inset rect by (dx, dy) — i.e., offset its origin by (dx, dy), and decrease its size by (2*dx, 2*dy).
Expand rect to the smallest rect containing it with integral origin and size.
Return the union of r1 and r2. NOTE: the python/perl methods are actually called 'union'.
Return the intersection of r1 and r2. This may return a null rect.
Offset rect by (dx, dy).
Make two new rectangles, slice and remainder, by dividing rect with a line that's parallel to one of its sides, specified by edge — either CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, or CGRectMaxYEdge. The size of slice is determined by amount, which measures the distance from the specified edge.
Return true if point is contained in rect, 0 otherwise.
Return true if rect2 is contained in rect1, 0 otherwise. rect2 is contained in rect1 if the union of rect1 and rect2 is equal to rect1.
Return true if rect1 intersects rect2, 0 otherwise. rect1 intersects rect2 if the intersection of rect1 and rect2 is not the null rect.
Transform rect by t and return the result. Since affine transforms do not preserve rectangles in general, this function returns the smallest rectangle which contains the transformed corner points of rect. If t consists solely of scales, flips and translations, then the returned rectangle coincides with the rectangle constructed from the four transformed corners.
Create an image.
Create an image mask.
Create an image from source, a data provider of JPEG-encoded data.
Create an image using source, a data provider for PNG-encoded data.
Create a new data provider that will read data from the file 'filename'.
Create an image mask.
Create an image from source, a data provider of JPEG-encoded data.
Create an image using source, a data provider for PNG-encoded data.
Create an image using source, a data provider with data encoded using one of the standard image formats.
Create an image using source, a data provider with data encoded using one of the image formats supported by ImageIO.
Create an image using source, a data provider with data encoded using one of the image formats supported by QuickTime graphics importers. The returned affine transform has the necessary scale factors to map the created image to 72dpi.
Return true if image is an image mask, false otherwise.
Return the width of image.
Return the height of image.
Return the number of bits/component of image.
Return the number of bits/pixel of image.
Return the number of bytes/row of image.
Return the colorspace of image, or NULL if image is an image mask.
Return the alpha info of image.
Return the data provider of image.
Return the decode array of image.
Return the interpolation parameter of image.
Return the rendering intent of image.
Return the bitmap info of image.
Create an image using the data contained within the subrectangle rect of image. The new image is created by 1) adjusting rect to integral bounds by calling "CGRectIntegral"; 2) intersecting the result with a rectangle with origin (0, 0) and size equal to the size of image 3) referencing the pixels within the resulting rectangle, treating the first pixel of the image data as the origin of the image. If the resulting rectangle is the null rectangle, this function returns NULL. If W and H are the width and height of image, respectively, then the point (0,0) corresponds to the first pixel of the image data; the point (W-1, 0) is the last pixel of the first row of the image data; (0, H-1) is the first pixel of the last row of the image data; and (W-1, H-1) is the last pixel of the last row of the image data. The resulting image retains a reference to the original image, so you may release the original image after calling this function.
Create a new image from image masked by mask, which may be an image mask or an image. If mask is an image mask, then it indicates which parts of the context are to be painted with the image when drawn in a context, and which are to be masked out (left unchanged). The source samples of the image mask determine which areas are painted, acting as an "inverse alpha": if the value of a source sample in the image mask is S, then the corresponding region in image is blended with the destination using an alpha of (1-S). (For example, if S is 1, then the region is not painted, while if S is 0, the region is fully painted.) If mask is an image, then it serves as alpha mask for blending the image onto the destination. The source samples of mask determine which areas are painted: if the value of the source sample in mask is S, then the corresponding region in image is blended with the destination with an alpha of S. (For example, if S is 0, then the region is not painted, while if S is 1, the region is fully painted.) The parameter image may not be an image mask and may not have an image mask or masking color associated with it. If mask is an image, then it must be in the DeviceGray color space, may not have alpha, and may not itself be masked by an image mask or a masking color.
Create a new image from image masked by components, an array of 2N values { min[1], max[1], ... min[N], max[N] } where N is the number of components in color space of image. Any image sample with color value {c[1], ... c[N]} where min[i] <= c[i] <= max[i] for 1 <= i <= N is masked out (that is, not painted). Each value in components must be a valid image sample value: if image has integral pixel components, then each value of must be in the range [0 .. 2**bitsPerComponent - 1] (where bitsPerComponent is the number of bits/component of image if image has floating-point pixel components, then each value may be any floating-point number which is a valid color component. The parameter image may not be an image mask, and may not already have an image mask or masking color associated with it.
Create a copy of path.
Return true if path1 is equal to path2 false otherwise.
Return true if path contains no elements, false otherwise.
Return true if path represents a rectangle, false otherwise.
Return the current point of the current subpath of path. If there is no current point, then return CGPointZero.
Return the bounding box of path. The bounding box is the smallest rectangle completely enclosing all points in the path, including control points for Bezier and quadratic curves. If the path is empty, then return CGRectNull.
Return true if point is contained in path false otherwise. A point is contained in a path if it is inside the painted region when the path is filled; if eoFill is true, then the even-odd fill rule is used to evaluate the painted region of the path, otherwise, the winding-number fill rule is used. If m is non-NULL, then the point is transformed by m before determining whether the path contains it.
Move the current point to (x, y) in path and begin a new subpath. If m is non-NULL, then transform (x, y) by m first.
Append a straight line segment from the current point to (x, y) in path and move the current point to (x, y). If m is non-NULL, then transform (x, y) by m first.
Append a quadratic curve from the current point to (x, y) with control point (cpx, cpy) in path and move the current point to (x, y). If m is non-NULL, then transform all points by m first.
Append a cubic Bezier curve from the current point to (x,y) with control points (cp1x, cp1y) and (cp2x, cp2y) in path and move the current point to (x, y). If m is non-NULL, then transform all points by m first.
Append a line from the current point to the starting point of the current subpath of path and end the subpath.
Add rect to path. If m is non-NULL, then first transform rect by m before adding it to path.
Add each rectangle specified by rects, an array of count CGRects, to path. If m is non-NULL, then first transform each rectangle by m before adding it to path.
Move to the first element of points, an array of count CGPoints, and append a line from each point to the next point in points. If m is non-NULL, then first transform each point by m.
Add an arc of a circle to path, possibly preceded by a straight line segment. The arc is approximated by a sequence of cubic Bezier curves. (x, y) is the center of the arc; radius is its radius; startAngle is the angle to the first endpoint of the arc; endAngle is the angle to the second endpoint of the arc; and clockwise is true if the arc is to be drawn clockwise, false otherwise. startAngle and endAngle are measured in radians. If m is non-NULL, then the constructed Bezier curves representing the arc will be transformed by m before they are added to path.
Add an arc of a circle to path, possibly preceded by a straight line segment. The arc is approximated by a sequence of cubic Bezier curves. radius is the radius of the arc. The resulting arc is tangent to the line from the current point of path to (x1, y1), and the line from (x1, y1) to (x2, y2). If m is non-NULL, then the constructed Bezier curves representing the arc will be transformed by m before they are added to path.
Add path2 to path1. If m is non-NULL, then the points in path2 will be transformed by m before they are added to path1.
Create a color in colorspace colorspace with color components (including alpha) specified by components. colorspace may be any colorspace expect a pattern colorspace.
Create a color in colorspace colorspace with pattern pattern and components components. colorspace must be a pattern colorspace.
Return true if color1 is equal to color2 false otherwise.
Return the number of color components (including alpha) associated with color.
Return the color components associated with color.
Return the alpha component associated with color.
Return the colorspace associated with color.
Return the pattern associated with color, if it's a color in a pattern colorspace; NULL otherwise.
Use "kCGColorSpaceGenericGray" instead.
Create a DeviceRGB colorspace.
Create a DeviceCMYK colorspace.
Create a calibrated gray colorspace. whitePoint is an array of 3 numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point. blackPoint is an array of 3 numbers specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point. gamma defines the gamma for the gray component.
Create a calibrated RGB colorspace. whitePoint is an array of 3 numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point. blackPoint is an array of 3 numbers specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point. gamma is an array of 3 numbers specifying the gamma for the red, green, and blue components of the color space. matrix is an array of 9 numbers specifying the linear interpretation of the gamma-modified RGB values of the colorspace with respect to the final XYZ representation.
Create an L*a*b* colorspace. whitePoint is an array of 3 numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point. blackPoint is an array of 3 numbers specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point. range is an array of four numbers specifying the range of valid values for the a* and b* components of the color space.
Create an indexed colorspace. A sample value in an indexed color space is treated as an index into the color table of the color space. base specifies the base color space in which the values in the color table are to be interpreted. lastIndex is an integer which specifies the maximum valid index value; it must be less than or equal to 255. colorTable is an array of m * (lastIndex + 1) bytes, where m is the number of color components in the base color space. Each byte is an unsigned integer in the range 0 to 255 that is scaled to the range of the corresponding color component in the base color space.
Create a pattern colorspace. baseSpace is the underlying colorspace of the pattern colorspace. For colored patterns, baseSpace should be NULL; for uncolored patterns, baseSpace specifies the colorspace of colors which will be painted through the pattern.
Create a CGColorSpace using platformColorSpaceReference, a pointer to a platform-specific color space reference. For MacOS X, platformColorSpaceReference should be a pointer to a CMProfileRef.
Create a colorspace using name as the identifier for the colorspace.
Return the number of color components in the colorspace cs.
Given a handle returned by CGPatternBegin, returns a context that can be used to define the contents of the pattern cell.
Create a bitmap context. The context draws into a bitmap which is width pixels wide and height pixels high. The number of components for each pixel is specified by colorspace, which also may specify a destination color profile. The number of bits for each component of a pixel is specified by bitsPerComponent, which must be 1, 2, 4, or 8. Each row of the bitmap consists of bytesPerRow bytes, which must be at least (width * bitsPerComponent * number of components + 7)/8 bytes. data points a block of memory at least bytesPerRow * height bytes. alphaInfo specifies whether the bitmap should contain an alpha channel, and how it's to be generated.
Format specifiers for writeToDataConsumer/writeToFile
Push a copy of the current graphics state onto the graphics state stack. Note that the path is not considered part of the gstate, and is not saved.
Restore the current graphics state from the one on the top of the graphics state stack, popping the graphics state stack in the process.
Scale the current graphics state's transformation matrix (the CTM) by (sx, sy).
Translate the current graphics state's transformation matrix (the CTM) by (tx, ty).
Rotate the current graphics state's transformation matrix (the CTM) by angle radians.
Concatenate the current graphics state's transformation matrix (the CTM) with the affine transform transform.
Return the current graphics state's transformation matrix.
Set the line width in the current graphics state to width.
Set the line cap in the current graphics state to cap.
Set the line join in the current graphics state to join.
Set the miter limit in the current graphics state to limit.
Set the line dash patttern in the current graphics state.
Set the path flatness parameter in the current graphics state to flatness.
Set the alpha value in the current graphics state to alpha.
Set the blend mode of context to mode.
Begin a new path. The old path is discarded.
Start a new subpath at point (x, y) in the context's path.
Append a straight line segment from the current point to (x, y).
Append a cubic Bezier curve from the current point to (x,y), with control points (cp1x, cp1y) and (cp2x, cp2y).
Append a quadratic curve from the current point to (x, y), with control point (cpx, cpy).
Close the current subpath of the context's path.
Add a single rect to the context's path.
Add a set of rects to the context's path.
Add a set of lines to the context's path.
Add an ellipse inside rect to the current path of context. See the function CGPathAddEllipseInRect for more information on how the path for the ellipse is constructed.
Add an arc of a circle to the context's path, possibly preceded by a straight line segment. (x, y) is the center of the arc; radius is its radius; startAngle is the angle to the first endpoint of the arc; endAngle is the angle to the second endpoint of the arc; and clockwise is 1 if the arc is to be drawn clockwise, 0 otherwise. startAngle and endAngle are measured in radians.
Add an arc of a circle to the context's path, possibly preceded by a straight line segment. radius is the radius of the arc. The arc is tangent to the line from the current point to (x1, y1), and the line from (x1, y1) to (x2, y2).
Add path to the path of context. The points in path are transformed by the CTM of context before they are added.
Replace the path in context with the stroked version of the path, using the parameters of context to calculate the stroked path. The resulting path is created such that filling it with the appropriate color will produce the same results as stroking the original path. You can use this path in the same way you can use the path of any context; for example, you can clip to the stroked version of a path by calling this function followed by a call to "CGContextClipPath".
Return 1 if the context's path contains no elements, 0 otherwise.
Return the current point of the current subpath of the context's path.
Return the bounding box of the context's path. The bounding box is the smallest rectangle completely enclosing all points in the path, including control points for Bezier and quadratic curves.
Return true if point is contained in the current path of context. A point is contained within a context's path if it is inside the painted region when the path is stroked or filled with opaque colors using the path drawing mode mode. point is specified is user space.
Draw the context's path using drawing mode mode.
Fill the context's path using the winding-number fill rule. Any open subpath of the path is implicitly closed.
Fill the context's path using the even-odd fill rule. Any open subpath of the path is implicitly closed.
Stroke the context's path.
Fill rect with the current fill color.
Fill rects, an array of count CGRects, with the current fill color.
Stroke rect with the current stroke color and the current linewidth.
Stroke rect with the current stroke color, using width as the the line width.
Clear rect (that is, set the region within the rect to transparent).
Fill an ellipse (an oval) inside rect.
Stroke an ellipse (an oval) inside rect.
Stroke a sequence of line segments one after another in context. The line segments are specified by points, an array of count CGPoints. This function is equivalent to CGContextBeginPath(context); for (k = 0; k < count; k += 2) { CGContextMoveToPoint(context, s[k].x, s[k].y); CGContextAddLineToPoint(context, s[k+1].x, s[k+1].y); } CGContextStrokePath(context);
Intersect the context's path with the current clip path and use the resulting path as the clip path for subsequent rendering operations. Use the winding-number fill rule for deciding what's inside the path.
Intersect the context's path with the current clip path and use the resulting path as the clip path for subsequent rendering operations. Use the even-odd fill rule for deciding what's inside the path.
Add mask transformed to rect to the clipping area of context. The mask, which may be either an image mask or an image, is mapped into the specified rectangle and intersected with the current clipping area of the context. If mask is an image mask, then it clips in a manner identical to the behavior if it were used with "CGContextDrawImage": it indicates an area to be masked out (left unchanged) when drawing. The source samples of the image mask determine which points of the clipping area are changed, acting as an "inverse alpha": if the value of a source sample in the image mask is S, then the corresponding point in the current clipping area will be multiplied by an alpha of (1-S). (For example, if S is 1, then the point in the clipping area becomes clear, while if S is 0, the point in the clipping area is unchanged. If mask is an image, then it serves as alpha mask and is blended with the current clipping area. The source samples of mask determine which points of the clipping area are changed: if the value of the source sample in mask is S, then the corresponding point in the current clipping area will be multiplied by an alpha of S. (For example, if S is 0, then the point in the clipping area becomes clear, while if S is 1, the point in the clipping area is unchanged. If mask is an image, then it must be in the DeviceGray color space, may not have alpha, and may not be masked by an image mask or masking color.
Intersect the current clipping path with rect. Note that this function resets the context's path to the empty path.
Intersect the current clipping path with the clipping region formed by creating a path consisting of all rects in rects. Note that this function resets the context's path to the empty path.
Set the current fill color in the context c to color.
Set the current stroke color in the context c to color.
Set the current fill colorspace in the context c to colorspace. As a side-effect, set the fill color to a default value appropriate for the colorspace.
Set the current stroke colorspace in the context c to colorspace. As a side-effect, set the stroke color to a default value appropriate for the colorspace.
Set the components of the current fill color in the context c to the values specifed by components. The number of elements in components must be one greater than the number of components in the current fill colorspace (N color components + 1 alpha component). The current fill colorspace must not be a pattern colorspace.
Set the components of the current stroke color in the context c to the values specifed by components. The number of elements in components must be one greater than the number of components in the current stroke colorspace (N color components + 1 alpha component). The current stroke colorspace must not be a pattern colorspace.
Set the components of the current fill color in the context c to the values specifed by components, and set the current fill pattern to pattern. The number of elements in components must be one greater than the number of components in the current fill colorspace (N color components + 1 alpha component). The current fill colorspace must be a pattern colorspace.
Set the components of the current stroke color in the context c to the values specifed by components, and set the current stroke pattern to pattern. The number of elements in components must be one greater than the number of components in the current stroke colorspace (N color components + 1 alpha component). The current stroke colorspace must be a pattern colorspace.
Set the pattern phase of context c to phase.
Set the current fill colorspace in the context c to DeviceGray and set the components of the current fill color to (gray, alpha).
Set the current stroke colorspace in the context c to DeviceGray and set the components of the current stroke color to (gray, alpha).
Set the current fill colorspace in the context c to DeviceRGB and set the components of the current fill color to (red, green, blue, alpha).
Set the current stroke colorspace in the context c to DeviceRGB and set the components of the current stroke color to (red, green, blue, alpha).
Set the current fill colorspace in the context c to DeviceCMYK and set the components of the current fill color to (cyan, magenta, yellow, black, alpha).
Set the current stroke colorspace in the context c to DeviceCMYK and set the components of the current stroke color to (cyan, magenta, yellow, black, alpha).
Set the current rendering intent in the context c to intent.
Draw image in the rectangular area specified by rect in the context c. The image is scaled, if necessary, to fit into rect.
Return the interpolation quality for image rendering of the context c. The interpolation quality is a gstate-parameter which controls the level of interpolation performed when an image is interpolated (for example, when scaling the image). Note that it is merely a hint to the context: not all contexts support all interpolation quality levels.
Set the interpolation quality of the context c to quality.
Set the shadow parameters in context. offset specifies a translation in base-space; blur is a non-negative number specifying the amount of blur; color specifies the color of the shadow, which may contain a non-opaque alpha value. If color is NULL, it's equivalent to specifying a fully transparent color. The shadow is a gstate parameter. After a shadow is specified, all objects drawn subsequently will be shadowed. To turn off shadowing, set the shadow color to a fully transparent color (or pass NULL as the color), or use the standard gsave/grestore mechanism.
Equivalent to calling CGContextSetShadowWithColor(context, offset, blur, color) where color is black with 1/3 alpha (i.e., RGBA = {0, 0, 0, 1.0/3.0}) in the DeviceRGB colorspace.
Fill the current clipping region of c with shading.
Set the current character spacing in the context c to spacing. The character spacing is added to the displacement between the origin of one character and the origin of the next.
Set the user-space point at which text will be drawn in the context c to (x, y).
Return the user-space point at which text will be drawn in the context c.
Set the text matrix in the context c to t.
Return the text matrix in the context c.
Set the current text drawing mode in the context c to mode.
Set the current font size in the context c to size.
Attempts to find the font named name for the context c. If successful, scales it to size units in text space. textEncoding specifies how to translate from bytes to glyphs.
Draw string, a string of length bytes, at the point specified by the text matrix in the context c. Each byte of the string is mapped through the encoding vector of the current font to obtain the glyph to display.
Draw the glyphs pointed to by g, an array of count glyphs, at the point specified by the text matrix in the context c.
Draw string, a string of length bytes, at the point (x, y), specified in user space, in the context c. Each byte of the string is mapped through the encoding vector of the current font to obtain the glyph to display.
Display the glyphs pointed to by glyphs, an array of count glyphs, at at the point (x, y), specified in user space, in the context c.
* Text extra convenience functions. Uses the font size from the context gstate when drawing (when greater than zero). *
Draw page in document in the rectangular area specified by rect in the context c. The media box of the page is scaled, if necessary, to fit into rect.
Begin a new page.
End the current page.
Flush all drawing to the destination.
Synchronized drawing.
Turn on antialiasing if shouldAntialias is true; turn it off otherwise. This parameter is part of the graphics state.
Allow antialiasing in context c if allowsAntialiasing is true; don't allow it otherwise. This parameter is not part of the graphics state. A context will perform antialiasing if both allowsAntialiasing and the graphics state parameter shouldAntialias are true.
Turn on font smoothing if shouldSmoothFonts is true; turn it off otherwise. This parameter is part of the graphics state.
Begin a transparency layer. All subsequent drawing operations until a corresponding CGContextEndTransparencyLayer are composited into a fully transparent backdrop (which is treated as a separate destination buffer from the context); after a call to CGContextEndTransparencyLayer, the result is composited into the context using the global alpha and shadow state of the context. This operation respects the clipping region of the context. After a call to this function, all of the parameters in the graphics state remain unchanged with the exception of the following: The global alpha is set to 1. The shadow is turned off. Ending the transparency layer restores these parameters to the values they had before CGContextBeginTransparencyLayer was called. Transparency layers may be nested.
End a tranparency layer.
Return the affine transform mapping the user space (abstract coordinates) of context to device space (pixels).
Transform point from the user space of context to device space.
Transform point from device space to the user space of context.
Transform size from the user space of context to device space.
Transform size from device space to the user space of context.
Transform rect from the user space of context to device space. Since affine transforms do not preserve rectangles in general, this function returns the smallest rectangle which contains the transformed corner points of rect.
Transform rect from device space to the user space of context. Since affine transforms do not preserve rectangles in general, this function returns the smallest rectangle which contains the transformed corner points of rect.
Return the data associated with the bitmap context c, or NULL if c is not a bitmap context.
Return the width of the bitmap context c, or 0 if c is not a bitmap context.
Return the height of the bitmap context c, or 0 if c is not a bitmap context.
Return the bits per component of the bitmap context c, or 0 if c is not a bitmap context.
Return the bits per pixel of the bitmap context c, or 0 if c is not a bitmap context.
Return the bytes per row of the bitmap context c, or 0 if c is not a bitmap context.
Return the colorspace of the bitmap context c, or NULL if c is not a bitmap context.
Return the alpha info of the bitmap context c, or kCGImageAlphaNone if c is not a bitmap context.
Return an image containing the current contents of the bitmap context c.
Write an encoded representation of the current contents of the bitmap context c to the data consumer consumer.
Given a handle returned by CGPatternBegin, returns a context that can be used to define the contents of the pattern cell.
Create a bitmap context. The context draws into a bitmap which is width pixels wide and height pixels high. The number of components for each pixel is specified by colorspace, which also may specify a destination color profile. The number of bits for each component of a pixel is specified by bitsPerComponent, which must be 1, 2, 4, or 8. Each row of the bitmap consists of bytesPerRow bytes, which must be at least (width * bitsPerComponent * number of components + 7)/8 bytes. data points a block of memory at least bytesPerRow * height bytes. alphaInfo specifies whether the bitmap should contain an alpha channel, and how it's to be generated.
Format specifiers for writeToDataConsumer/writeToFile
Set the URL associated with rect to url in the PDF context context.
Create a PDF destination named name at point in the current page of the PDF context context.
Specify a destination named name to jump to when clicking in rect of the current page of the PDF context context.
Create a PDF document, using provider to obtain the document's data.
Return the major and minor version numbers of document.
Return true if the PDF file associated with document is encrypted; false otherwise. If the PDF file is encrypted, then a password must be supplied before certain operations are enabled; different passwords may enable different operations.
Use password to decrypt document and grant permission for certain operations. Returns true if password is a valid password; false otherwise.
Return true if document is unlocked; false otherwise. A document is unlocked if it isn't encrypted, or if it is encrypted and a valid password was previously specified with CGPDFDocumentUnlockWithPassword.
Return true if document allows printing; false otherwise. Typically, this function returns false only if the document is encrypted and the document's current password doesn't grant permission to perform printing.
Return true if document allows copying; false otherwise. Typically, this function returns false only if the document is encrypted and the document's current password doesn't grant permission to perform copying.
Return the number of pages in document.
Return the page corresponding to pageNumber, or NULL if no such page exists in the document. Pages are numbered starting at 1.
Return the document catalog of document.
Return the info dictionary of document.
Return the "file identifier" of document.
Return the media box of page number page in document.
Return the crop box of page number page in document.
Return the bleed box of page number page in document.
Return the trim box of page number page in document.
Return the art box of page number page in document.
Return the rotation angle (in degrees) of page number page in document.
Return the document of page.
Return the page number of page.
Return the rectangle associated with box in page. This is the value of the corresponding entry (such as /MediaBox, /ArtBox, and so on) in the page's dictionary.
Return the rotation angle (in degrees) of page. This is the value of the /Rotate entry in the page's dictionary.
Return a transform mapping the box specified by box to rect as follows: - Compute the effective rect by intersecting the rect associated with box and the /MediaBox entry of the page. - Rotate the effective rect according to the page's /Rotate entry. - Center the resulting rect on rect. If rotation is non-zero, then the rect will rotated clockwise by rotation degrees. rotation must be a multiple of 90. - Scale the rect down, if necessary, so that it coincides with the edges of rect. If preserveAspectRatio is true, then the final rect will coincide with the edges of rect only in the more restrictive dimension.
Return the dictionary of page.
Look up the object at index in array and, if it's a null, return true; otherwise, return false.
Look up the object at index in array and, if it's a boolean, return the result in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's an integer, return the result in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's a number (real or integer), return the result in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's a name, return the result in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's a string, return the result in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's an array, return it in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's a dictionary, return it in value. Return true on success; false otherwise.
Look up the object at index in array and, if it's a stream, return it in value. Return true on success; false otherwise.
Create a content stream from page.
Increment the retain count of cs.
Decrement the retain count of cs.
Return the array of CGPDFStreamRefs comprising the entire content stream of cs.
Return the resource named name in category category of the resource dictionaries of cs.
Return the number of entries in dictionary.
Return an array containing all keys defined by dict.
Look up the object associated with key in dict and, if it's a boolean, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's an integer, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's a number (real or integer), return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's a name, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's a string, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's an array, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's a dictionary, return the result in value. Return true on success; false otherwise.
Look up the object associated with key in dict and, if it's a stream, return the result in value. Return true on success; false otherwise.
Return the dictionary of stream.
Return the data of stream.
Return an empty operator table.
Increment the retain count of table.
Decrement the retain count of table.
Set the callback for the operator named name to callback
Create a scanner.
Retain scanner.
Release scanner.
Scan the content stream of scanner. Returns true if the entire stream was scanned successfully; false if scanning failed for some reason (for example, if the stream's data is corrupted).
Return the content stream associated with scanner.
Pop an object from the stack of scanner and return it in value.
Pop an object from the stack of scanner and, if it's a boolean, return it in value. Return false if the top of the stack isn't a boolean.
Pop an object from the stack of scanner and, if it's an integer, return it in value. Return false if the top of the stack isn't an integer.
Pop an object from the stack of scanner and, if it's a number, return it in value. Return false if the top of the stack isn't a number.
Pop an object from the stack of scanner and, if it's a name, return it in value. Return false if the top of the stack isn't a name.
Pop an object from the stack of scanner and, if it's a string, return it in value. Return false if the top of the stack isn't a string.
Pop an object from the stack of scanner and, if it's an array, return it in value. Return false if the top of the stack isn't an array.
Pop an object from the stack of scanner and, if it's a dictionary, return it in value. Return false if the top of the stack isn't a dictionary.
Scan an inline image from scanner and return it. Return NULL if it's not possible to build the inline image for any reason.
Skip past an inline image in scanner.
Create a new CGPSConverter object.
Use converter to convert PostScript data to PDF data. The PostScript data is supplied by provider the resulting PDF is written to consumer. Returns true if the conversion succeeded; false otherwise.
Tell the converter to abort conversion at the next possible opportunity.
Return true if converter is currently converting data.
Create a QDPict reference, using provider to obtain the QDPict's data. It is assumed that either the first byte or the 513th byte of data in the file referenced by the URL is the first byte of the picture header. If the URL does not begin PICT data at one of these places in the data fork then the QDPictRef returned will be NULL.
Create a QDPict reference from filename. It is assumed that either the first byte or the 513th byte of data in the file referenced by the filename is the first byte of the picture header. If the file does not begin PICT data at one of these places in the data fork then the QDPictRef returned will be NULL.
Return the Picture Bounds of the QuickDraw picture represented by pictRef. This rectangle is in the default user space with one unit = 1/72 inch.
Return the resolution of the QuickDraw picture represented by pictRef. This data, together with the CGRect returned by QDPictGetBounds, can be used to compute the size of the picture in pixels, which is what QuickDraw really records into pictures.
Draw pictRef in the rectangular area specified by rect. The PICT bounds of the page is scaled, if necessary, to fit into rect. To get unscaled results, supply a rect the size of the rect returned by QDPictGetBounds.