jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: Quartz Surfaces: Cairo: A Vector Graphics Library jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68:
jpayne@68:

Quartz Surfaces

jpayne@68:

Quartz Surfaces — Rendering to Quartz surfaces

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: jpayne@68: cairo_quartz_surface_create () jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: jpayne@68: cairo_quartz_surface_create_for_cg_context () jpayne@68:
jpayne@68: CGContextRef jpayne@68: jpayne@68: cairo_quartz_surface_get_cg_context () jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
#defineCAIRO_HAS_QUARTZ_SURFACE
jpayne@68:
jpayne@68:
jpayne@68:

Description

jpayne@68:

The Quartz surface is used to render cairo graphics targeting the jpayne@68: Apple OS X Quartz rendering system.

jpayne@68:
jpayne@68:
jpayne@68:

Functions

jpayne@68:
jpayne@68:

cairo_quartz_surface_create ()

jpayne@68:
cairo_surface_t *
jpayne@68: cairo_quartz_surface_create (cairo_format_t format,
jpayne@68:                              unsigned int width,
jpayne@68:                              unsigned int height);
jpayne@68:

Creates a Quartz surface backed by a CGBitmap. The surface is jpayne@68: created using the Device RGB (or Device Gray, for A8) color space. jpayne@68: All Cairo operations, including those that require software jpayne@68: rendering, will succeed on this surface.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

format

format of pixels in the surface to create

 

width

width of the surface, in pixels

 

height

height of the surface, in pixels

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the newly created surface.

jpayne@68:
jpayne@68:

Since: 1.6

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_quartz_surface_create_for_cg_context ()

jpayne@68:
cairo_surface_t *
jpayne@68: cairo_quartz_surface_create_for_cg_context
jpayne@68:                                (CGContextRef cgContext,
jpayne@68:                                 unsigned int width,
jpayne@68:                                 unsigned int height);
jpayne@68:

Creates a Quartz surface that wraps the given CGContext. The jpayne@68: CGContext is assumed to be in the standard Cairo coordinate space jpayne@68: (that is, with the origin at the upper left and the Y axis jpayne@68: increasing downward). If the CGContext is in the Quartz coordinate jpayne@68: space (with the origin at the bottom left), then it should be jpayne@68: flipped before this function is called. The flip can be accomplished jpayne@68: using a translate and a scale; for example:

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:
1
jpayne@68: 2
CGContextTranslateCTM (cgContext, 0.0, height);
jpayne@68: CGContextScaleCTM (cgContext, 1.0, -1.0);
jpayne@68:
jpayne@68: jpayne@68:

All Cairo operations are implemented in terms of Quartz operations, jpayne@68: as long as Quartz-compatible elements are used (such as Quartz fonts).

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

cgContext

the existing CGContext for which to create the surface

 

width

width of the surface, in pixels

 

height

height of the surface, in pixels

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the newly created Cairo surface.

jpayne@68:
jpayne@68:

Since: 1.6

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

cairo_quartz_surface_get_cg_context ()

jpayne@68:
CGContextRef
jpayne@68: cairo_quartz_surface_get_cg_context (cairo_surface_t *surface);
jpayne@68:

Returns the CGContextRef that the given Quartz surface is backed jpayne@68: by.

jpayne@68:

A call to cairo_surface_flush() is required before using the jpayne@68: CGContextRef to ensure that all pending drawing operations are jpayne@68: finished and to restore any temporary modification cairo has made jpayne@68: to its state. A call to cairo_surface_mark_dirty() is required jpayne@68: after the state or the content of the CGContextRef has been jpayne@68: modified.

jpayne@68:
jpayne@68:

Parameters

jpayne@68:
jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68: jpayne@68:

surface

the Cairo Quartz surface

 
jpayne@68:
jpayne@68:
jpayne@68:

Returns

jpayne@68:

the CGContextRef for the given surface.

jpayne@68:
jpayne@68:

Since: 1.6

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

Types and Values

jpayne@68:
jpayne@68:

CAIRO_HAS_QUARTZ_SURFACE

jpayne@68:
#define CAIRO_HAS_QUARTZ_SURFACE 1
jpayne@68: 
jpayne@68:

Defined if the Quartz surface backend is available. jpayne@68: This macro can be used to conditionally compile backend-specific code.

jpayne@68:

Since: 1.6

jpayne@68:
jpayne@68:
jpayne@68:
jpayne@68:

See Also

jpayne@68:

cairo_surface_t

jpayne@68:
jpayne@68:
jpayne@68: jpayne@68: jpayne@68: