cairo_surface_t

cairo_surface_t — Base class for surfaces

Synopsis




typedef     cairo_surface_t;
enum        cairo_content_t;
cairo_surface_t* cairo_surface_create_similar
                                            (cairo_surface_t *other,
                                             cairo_content_t content,
                                             int width,
                                             int height);
void        cairo_surface_destroy           (cairo_surface_t *surface);
void        cairo_surface_finish            (cairo_surface_t *surface);
void        cairo_surface_flush             (cairo_surface_t *surface);
void        cairo_surface_get_font_options  (cairo_surface_t *surface,
                                             cairo_font_options_t *options);
cairo_content_t cairo_surface_get_content   (cairo_surface_t *surface);
cairo_status_t cairo_surface_set_user_data  (cairo_surface_t *surface,
                                             const cairo_user_data_key_t *key,
                                             void *user_data,
                                             cairo_destroy_func_t destroy);
void*       cairo_surface_get_user_data     (cairo_surface_t *surface,
                                             const cairo_user_data_key_t *key);
void        cairo_surface_mark_dirty        (cairo_surface_t *surface);
void        cairo_surface_mark_dirty_rectangle
                                            (cairo_surface_t *surface,
                                             int x,
                                             int y,
                                             int width,
                                             int height);
cairo_surface_t* cairo_surface_reference    (cairo_surface_t *surface);
void        cairo_surface_set_device_offset (cairo_surface_t *surface,
                                             double x_offset,
                                             double y_offset);
void        cairo_surface_get_device_offset (cairo_surface_t *surface,
                                             double *x_offset,
                                             double *y_offset);
void        cairo_surface_set_fallback_resolution
                                            (cairo_surface_t *surface,
                                             double x_pixels_per_inch,
                                             double y_pixels_per_inch);
cairo_status_t cairo_surface_status         (cairo_surface_t *surface);
enum        cairo_surface_type_t;
cairo_surface_type_t cairo_surface_get_type (cairo_surface_t *surface);

Description

Details

cairo_surface_t

typedef struct _cairo_surface cairo_surface_t;

A cairo_surface_t represents an image, either as the destination of a drawing operation or as source when drawing onto another surface. There are different subtypes of cairo_surface_t for different drawing backends; for example, cairo_image_surface_create() creates a bitmap image in memory.

Memory management of cairo_surface_t is done with cairo_surface_reference() and cairo_surface_destroy().


enum cairo_content_t

typedef enum _cairo_content {
    CAIRO_CONTENT_COLOR		= 0x1000,
    CAIRO_CONTENT_ALPHA		= 0x2000,
    CAIRO_CONTENT_COLOR_ALPHA	= 0x3000
} cairo_content_t;

cairo_content_t is used to describe the content that a surface will contain, whether color information, alpha information (translucence vs. opacity), or both.

Note: The large values here are designed to keep cairo_content_t values distinct from cairo_format_t values so that the implementation can detect the error if users confuse the two types.

CAIRO_CONTENT_COLOR The surface will hold color content only.
CAIRO_CONTENT_ALPHA The surface will hold alpha content only.
CAIRO_CONTENT_COLOR_ALPHA The surface will hold color and alpha content.

cairo_surface_create_similar ()

cairo_surface_t* cairo_surface_create_similar
                                            (cairo_surface_t *other,
                                             cairo_content_t content,
                                             int width,
                                             int height);

cairo_surface_destroy ()

void        cairo_surface_destroy           (cairo_surface_t *surface);

cairo_surface_finish ()

void        cairo_surface_finish            (cairo_surface_t *surface);

cairo_surface_flush ()

void        cairo_surface_flush             (cairo_surface_t *surface);

cairo_surface_get_font_options ()

void        cairo_surface_get_font_options  (cairo_surface_t *surface,
                                             cairo_font_options_t *options);

cairo_surface_get_content ()

cairo_content_t cairo_surface_get_content   (cairo_surface_t *surface);

Since 1.2


cairo_surface_set_user_data ()

cairo_status_t cairo_surface_set_user_data  (cairo_surface_t *surface,
                                             const cairo_user_data_key_t *key,
                                             void *user_data,
                                             cairo_destroy_func_t destroy);

cairo_surface_get_user_data ()

void*       cairo_surface_get_user_data     (cairo_surface_t *surface,
                                             const cairo_user_data_key_t *key);

cairo_surface_mark_dirty ()

void        cairo_surface_mark_dirty        (cairo_surface_t *surface);

cairo_surface_mark_dirty_rectangle ()

void        cairo_surface_mark_dirty_rectangle
                                            (cairo_surface_t *surface,
                                             int x,
                                             int y,
                                             int width,
                                             int height);

cairo_surface_reference ()

cairo_surface_t* cairo_surface_reference    (cairo_surface_t *surface);

cairo_surface_set_device_offset ()

void        cairo_surface_set_device_offset (cairo_surface_t *surface,
                                             double x_offset,
                                             double y_offset);

cairo_surface_get_device_offset ()

void        cairo_surface_get_device_offset (cairo_surface_t *surface,
                                             double *x_offset,
                                             double *y_offset);

Since 1.2


cairo_surface_set_fallback_resolution ()

void        cairo_surface_set_fallback_resolution
                                            (cairo_surface_t *surface,
                                             double x_pixels_per_inch,
                                             double y_pixels_per_inch);

Since 1.2


cairo_surface_status ()

cairo_status_t cairo_surface_status         (cairo_surface_t *surface);

enum cairo_surface_type_t

typedef enum _cairo_surface_type {
    CAIRO_SURFACE_TYPE_IMAGE,
    CAIRO_SURFACE_TYPE_PDF,
    CAIRO_SURFACE_TYPE_PS,
    CAIRO_SURFACE_TYPE_XLIB,
    CAIRO_SURFACE_TYPE_XCB,
    CAIRO_SURFACE_TYPE_GLITZ,
    CAIRO_SURFACE_TYPE_QUARTZ,
    CAIRO_SURFACE_TYPE_WIN32,
    CAIRO_SURFACE_TYPE_BEOS,
    CAIRO_SURFACE_TYPE_DIRECTFB,
    CAIRO_SURFACE_TYPE_SVG
} cairo_surface_type_t;

Since 1.2


cairo_surface_get_type ()

cairo_surface_type_t cairo_surface_get_type (cairo_surface_t *surface);

Since 1.2