Name
cairo.Path -- construct new path
Synopsis
p = cairo.Path(table)
Function
Constructs a new Cairo path from a table source. The table can contain a number of subtables describing a path item each. Each subtable inside table must contain a Type field that specifies the path item type of the subtable. Additional subtable items that must be initialized depend on the item type set in the Type field.

The following items are recognized for each subtable within table:

Type
Describes the type of path item. This can be one of the following types:

#CAIRO_PATH_MOVE_TO
A move-to operation. You must set the fields x1 and y1 as well.

#CAIRO_PATH_LINE_TO
A line-to operation. You must set the fields x1 and y1 as well.

#CAIRO_PATH_CURVE_TO
A curve-to operation. You must set the fields x1, y1, x2, y2, x3 and y3 as well.

#CAIRO_PATH_CLOSE_PATH
A close-path operation. No additional fields need to be set.

x1, y1
Control points needed by #CAIRO_PATH_MOVE_TO, #CAIRO_PATH_LINE_TO, and #CAIRO_PATH_CURVE_TO.

x2, y2, x3, y3
Additional control points, only needed by #CAIRO_PATH_CURVE_TO.

Inputs
table
table describing the path
Results
p
a newly allocated Cairo path

Show TOC