cairo-cairo-t {RGtk2}R Documentation

cairo_t

Description

The cairo drawing context

Methods and Functions

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)

Detailed Description

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.

Structures

Cairo
A 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
A data structure for holding a rectangle.

Since 1.4 CairoRectangle is a transparent-type.

x
[numeric] X coordinate of the left side of the rectangle
y
[numeric] Y coordinate of the the top side of the rectangle
width
[numeric] width of the rectangle
height
[numeric] height of the rectangle

CairoRectangleList
A data structure for holding a dynamically allocated array of rectangles.

Since 1.4 CairoRectangleList is a transparent-type.

status
[CairoStatus] Error status of the rectangle list
rectangles
[CairoRectangle] list containing the rectangles
num_rectangles
[integer] Number of rectangles in this list

Convenient Construction

cairo is the equivalent of cairoCreate.

Enums and Flags

CairoAntialias
Specifies the type of antialiasing to do when rendering text or shapes.

default
Use the default antialiasing for the subsystem and target device
none
Use a bilevel alpha mask
gray
Perform single-color antialiasing (using shades of gray for black text on a white background, for example).
subpixel
Perform antialiasing by taking advantage of the order of subpixel elements on devices such as LCD panels

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.)

New entries may be added in future versions.

winding
If the path crosses the ray from left-to-right, counts +1. If the path crosses the ray from right to left, counts -1. (Left and right are determined from the perspective of looking along the ray from the starting point.) If the total count is non-zero, the point will be filled.
even-odd
Counts the total number of intersections, without regard to the orientation of the contour. If the total number of intersections is odd, the point will be filled.

CairoLineCap
Specifies how to render the endpoint of a line when stroking.

butt
start(stop) the line exactly at the start(end) point
round
use a round ending, the center of the circle is the end point
square
use squared ending, the center of the square is the end point

CairoLineJoin
Specifies how to render the junction of two lines when stroking.

miter
use a sharp (angled) corner, see cairoSetMiterLimit
round
use a rounded join, the center of the circle is the joint point
bevel
use a cut-off join, the join is cut off at half the line width from the joint point

CairoOperator
undocumented

clear
undocumented
source
undocumented
over
undocumented
in
undocumented
out
undocumented
atop
undocumented
dest
undocumented
dest-over
undocumented
dest-in
undocumented
dest-out
undocumented
dest-atop
undocumented
xor
undocumented
add
undocumented
saturate
undocumented

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://www.cairographics.org/manual/cairo-cairo-t.html


[Package RGtk2 version 2.12.5-3 Index]