Last chance! 50% off unlimited learning
Sale ends in
cairoCreate(target)
cairoStatus(cr)
cairoSave(cr)
cairoRestore(cr)
cairoGetTarget(cr)
cairoPushGroup(cr)
cairoPushGroupWithContent(cr, content)
cairoPopGroup(cr)
cairoPopGroupToSource(cr)
cairoGetGroupTarget(cr)
cairoSetSourceRgb(cr, red, green, blue)
cairoSetSourceRgba(cr, red, green, blue, alpha)
cairoSetSource(cr, source)
cairoSetSourceSurface(cr, surface, x, y)
cairoGetSource(cr)
cairoSetAntialias(cr, antialias)
cairoGetAntialias(cr)
cairoSetDash(cr, dashes, offset)
cairoGetDashCount(cr)
cairoGetDash(cr)
cairoSetFillRule(cr, fill.rule)
cairoGetFillRule(cr)
cairoSetLineCap(cr, line.cap)
cairoGetLineCap(cr)
cairoSetLineJoin(cr, line.join)
cairoGetLineJoin(cr)
cairoSetLineWidth(cr, width)
cairoGetLineWidth(cr)
cairoSetMiterLimit(cr, limit)
cairoGetMiterLimit(cr)
cairoSetOperator(cr, op)
cairoGetOperator(cr)
cairoSetTolerance(cr, tolerance)
cairoGetTolerance(cr)
cairoClip(cr)
cairoClipPreserve(cr)
cairoClipExtents(cr)
cairoResetClip(cr)
cairoCopyClipRectangleList(cr)
cairoFill(cr)
cairoFillPreserve(cr)
cairoFillExtents(cr)
cairoInFill(cr, x, y)
cairoMask(cr, pattern)
cairoMaskSurface(cr, surface, surface.x, surface.y)
cairoPaint(cr)
cairoPaintWithAlpha(cr, alpha)
cairoStroke(cr)
cairoStrokePreserve(cr)
cairoStrokeExtents(cr)
cairoInStroke(cr, x, y)
cairoCopyPage(cr)
cairoShowPage(cr)
cairoSetUserData(cr, key, user.data)
cairoGetUserData(cr, key)
cairo(target)
Cairo
is the main object used when drawing with cairo. To
draw with cairo, you create a Cairo
, set the target surface,
and drawing options for the Cairo
, create shapes with
functions like cairoMoveTo
and cairoLineTo
, and then
draw shapes with cairoStroke
or cairoFill
.
Cairo
's can be pushed to a stack via cairoSave
.
They may then safely be changed, without loosing the current state.
Use cairoRestore
to restore to the saved state.Cairo
Cairo
contains the current state of the rendering device,
including coordinates of yet to be drawn shapes. Cairo contexts, as Cairo
objects are named, are central to
cairo and all drawing with cairo is always done to a Cairo
object. Memory management of Cairo
is done with
cairoReference()
and cairoDestroy()
. CairoRectangle
CairoRectangle
is a transparent-type. x
y
width
height
CairoRectangleList
CairoRectangleList
is a transparent-type. status
CairoStatus
] Error status of the rectangle listrectangles
CairoRectangle
] list containing the rectanglesnum_rectangles
cairo
is the equivalent of cairoCreate
.CairoAntialias
default
none
gray
subpixel
CairoFillRule
CairoFillRule
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.) The default fill rule is CAIRO_FILL_RULE_WINDING
. New entries may be added in future versions. winding
even-odd
CairoLineCap
CAIRO_LINE_CAP_BUTT
. butt
round
square
CairoLineJoin
CAIRO_LINE_JOIN_MITER
. miter
cairoSetMiterLimit
round
bevel
CairoOperator
CairoOperator
is used to set the compositing operator for all cairo
drawing operations. The default operator is CAIRO_OPERATOR_OVER
. The operators marked as unbounded modify their
destination even outside of the mask layer (that is, their effect is not
bound by the mask layer). However, their effect can still be limited by
way of clipping. To keep things simple, the operator descriptions here
document the behavior for when both source and destination are either fully
transparent or fully opaque. The actual implementation works for
translucent layers too.
For a more detailed explanation of the effects of each operator, including
the mathematical definitions, see
http://cairographics.org/operators/ (http://cairographics.org/operators/). clear
source
over
in
out
atop
dest
dest-over
dest-in
dest-out
dest-atop
xor
add
saturate