![]() |
![]() |
![]() |
Cairo: A Vector Graphics Library | ![]() |
---|---|---|---|---|
typedef cairo_t; enum cairo_antialias_t; enum cairo_fill_rule_t; enum cairo_line_cap_t; enum cairo_line_join_t; enum cairo_operator_t;
cairo_t is the main object used when drawing with cairo. To
draw with cairo, you create a cairo_t, set the target surface,
and drawing options for the cairo_t, create shapes with
functions like cairo_move_to()
and cairo_line_to()
, and then
draw shapes with cairo_stroke()
or cairo_fill()
.
cairo_t's can be pushed to a stack via cairo_save()
.
They may then safely be changed, without loosing the current state.
Use cairo_restore()
to restore to the saved state.
typedef struct _cairo cairo_t;
A cairo_t contains the current state of the rendering device, including coordinates of yet to be drawn shapes.
typedef enum _cairo_antialias { CAIRO_ANTIALIAS_DEFAULT, CAIRO_ANTIALIAS_NONE, CAIRO_ANTIALIAS_GRAY, CAIRO_ANTIALIAS_SUBPIXEL } cairo_antialias_t;
Specifies the type of antialiasing to do when rendering text or shapes.
typedef enum _cairo_fill_rule { CAIRO_FILL_RULE_WINDING, CAIRO_FILL_RULE_EVEN_ODD } cairo_fill_rule_t;
cairo_fill_rule_t is used to select how paths are filled. For both fill rules, whether or not a point is included in the fill is determined by taking a ray from that point to infinity and looking at intersections with the path. The ray can be in any direction, as long as it doesn't pass through the end point of a segment or have a tricky intersection such as intersecting tangent to the path. (Note that filling is not actually implemented in this way. This is just a description of the rule that is applied.)
typedef enum _cairo_line_cap { CAIRO_LINE_CAP_BUTT, CAIRO_LINE_CAP_ROUND, CAIRO_LINE_CAP_SQUARE } cairo_line_cap_t;
enumeration for style of line-endings
typedef enum _cairo_line_join { CAIRO_LINE_JOIN_MITER, CAIRO_LINE_JOIN_ROUND, CAIRO_LINE_JOIN_BEVEL } cairo_line_join_t;
typedef enum _cairo_operator { CAIRO_OPERATOR_CLEAR, CAIRO_OPERATOR_SOURCE, CAIRO_OPERATOR_OVER, CAIRO_OPERATOR_IN, CAIRO_OPERATOR_OUT, CAIRO_OPERATOR_ATOP, CAIRO_OPERATOR_DEST, CAIRO_OPERATOR_DEST_OVER, CAIRO_OPERATOR_DEST_IN, CAIRO_OPERATOR_DEST_OUT, CAIRO_OPERATOR_DEST_ATOP, CAIRO_OPERATOR_XOR, CAIRO_OPERATOR_ADD, CAIRO_OPERATOR_SATURATE } cairo_operator_t;