Package: cairo

CStruct cairo:path-data-t

Declaration

(cffi:defcstruct header-t
  (data-type path-data-type-t)
  (length :int))

(cffi:defcstruct point-t (x :double) (y :double))

(cffi:defcunion path-data-t (header (:pointer (:struct header-t))) (point (:pointer (:struct point-t))))

Details

The cairo:path-data-t structure is used to represent the path data inside a cairo:path-t instance.

The data structure is designed to try to balance the demands of efficiency and ease-of-use. A path is represented as an array of cairo:path-data-t instances, which is a union of headers and points.

Each portion of the path is represented by one or more elements in the array, one header followed by 0 or more points. The length value of the header is the number of array elements for the current portion including the header, that is length == 1 + # of points, and where the number of points for each element type is as follows:
:move-to     1 point
:line-to     1 point
:curve-to    3 points
:close-path  0 points  
The semantics and ordering of the coordinate values are consistent with the cairo:move-to, cairo:line-to, cairo:curve-to, and cairo:close-path functions.

Notes

The Lisp API has the cairo:path-data-to-list function, that returns a cairo:path-data-t instance as a Lisp list. There are no functions available, that allows to create a cairo:path-data-t instance from scratch.
 

See also

2025-1-14