jpayne@68: jpayne@68: jpayne@68:
jpayne@68: jpayne@68:jpayne@68: Top jpayne@68: | jpayne@68:![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68:
jpayne@68: Quartz Surfacesjpayne@68:Quartz Surfaces — Rendering to Quartz surfaces jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_quartz_surface_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_quartz_surface_create_for_cg_context () jpayne@68: | jpayne@68:
jpayne@68: CGContextRef jpayne@68: | jpayne@68:jpayne@68: cairo_quartz_surface_get_cg_context () jpayne@68: | jpayne@68:
#define | jpayne@68:CAIRO_HAS_QUARTZ_SURFACE | jpayne@68:
The Quartz surface is used to render cairo graphics targeting the jpayne@68: Apple OS X Quartz rendering system.
jpayne@68:cairo_surface_t * jpayne@68: cairo_quartz_surface_create (jpayne@68:cairo_format_t format
, jpayne@68:unsigned int width
, jpayne@68:unsigned int height
);
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:format |
jpayne@68: format of pixels in the surface to create |
jpayne@68: jpayne@68: |
width |
jpayne@68: width of the surface, in pixels |
jpayne@68: jpayne@68: |
height |
jpayne@68: height of the surface, in pixels |
jpayne@68: jpayne@68: |
Since: 1.6
jpayne@68:cairo_surface_t * jpayne@68: cairo_quartz_surface_create_for_cg_context jpayne@68: (jpayne@68:CGContextRef cgContext
, jpayne@68:unsigned int width
, jpayne@68:unsigned int height
);
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:1 jpayne@68: 2 |
jpayne@68: CGContextTranslateCTM (cgContext, 0.0, height); jpayne@68: CGContextScaleCTM (cgContext, 1.0, -1.0); |
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:cgContext |
jpayne@68: the existing CGContext for which to create the surface |
jpayne@68: jpayne@68: |
width |
jpayne@68: width of the surface, in pixels |
jpayne@68: jpayne@68: |
height |
jpayne@68: height of the surface, in pixels |
jpayne@68: jpayne@68: |
Since: 1.6
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.
surface |
jpayne@68: the Cairo Quartz surface |
jpayne@68: jpayne@68: |
Since: 1.6
jpayne@68: