plot/core
src/plot/core.tur
defn
plot-into-canvas
(plot-into-canvas [canvas : int renderers : int opts : int px : int py : int pw : int ph : int] :)
render into an existing canvas and viewport.
defn
plot
(plot [renderers : int opts : int] :)
render a Vec[Renderer] to a new surface and return it.
defn
plot-write-png
(plot-write-png [renderers : int opts : int path : cstr] :)
render a Vec[Renderer] and write it to a PNG file.
Internal definitions
__ok-- create an ok result wrapping integer value v.__err-- create an err result wrapping integer error value e.__ok?-- predicate for the local :ptr<void> result envelope.__ok-val-- extract the ok payload from the local :ptr<void> result envelope.__err-val-- extract the err payload from the local :ptr<void> result envelope.__make-renderer-- allocate the generic opaque renderer handle used by all plot modules.__renderer-floats-- attach the six generic float payload slots to a renderer.__renderer-ints-- attach the four generic integer payload slots to a renderer.__renderer-bounds-- attach explicit bounds hints to a renderer.__surface-create-- allocate a new plutovg surface.__surface-destroy-- destroy a plutovg surface.__surface-write-png-- write a plutovg surface to a PNG file.__canvas-create-- allocate a canvas for an existing surface.__canvas-destroy-- destroy a plutovg canvas.__surface-width-- width of a plutovg surface in pixels.__surface-height-- height of a plutovg surface in pixels.__surface-pixel-byte-- read a single byte from the surface's raw pixel buffer.__count-non-background-- count pixels in [x0, x1) x [y0, y1) that are not background.__pixel-is-background?-- true when a pixel is near pure white (>=250 in all RGB channels and full alpha).__plot-sample-adaptive-- adaptive subdivision sampler for sampled-line renderers.data->viewport-- map data coordinates to viewport coordinates.viewport->data-- map viewport coordinates back to data coordinates.