Package: cairo

Function cairo:path-data-to-list

Lambda List

cairo:path-data-to-list (path)

Arguments

path -- a cairo:path-t instance

Return Value

The list with the path.

Details

Creates a list with the path information from a cairo:path-t instance. See the cairo:copy-path and cairo:copy-path-flat functions.

Note

There is no Lisp API exported which gives direct access to the internal path data, nor has the Lisp API functions to create from scratch path data information.

Example

(cairo:with-recording-surface (surface :color)
  (cairo:with-context (context surface)
    (cairo:new-path context)
    (cairo:rectangle context 10 20 30 40)
    (let ((path (cairo:copy-path-flat context)))
      (prog1
        (cairo:path-data-to-list path)
        (cairo:path-destroy path)))))
=> (:PATH
    (:MOVE-TO 10.0d0 20.0d0)
    (:LINE-TO 40.0d0 20.0d0)
    (:LINE-TO 40.0d0 60.0d0)
    (:LINE-TO 10.0d0 60.0d0)
    (:CLOSE-PATH)
    (:MOVE-TO 10.0d0 20.0d0))    
 

See also

2024-2-3