Like render() with a .png / .pdf path, but returns the encoded document
as a raw vector instead of writing a file. These are the in-memory entry
points for a host that needs the bytes rather than a path — embedding a
base64 data URI in an HTML widget, serving a plot from a web API, or writing
to a connection — without a temp-file round-trip.
Arguments
- scene
A
vl_scene(), or anything with anas_vellum_scene()method.- scale
Resolution multiplier (default
1).scale = 2renders at twice the device pixels while keeping the same physical size — the retina /ggsave(scaling=)idiom. It multipliesdpi, so absolute units (mm,pt,in) cover proportionally more pixels and nothing about the layout changes; text does not get relatively bigger or smaller. Only raster output gains anything: a PDF's page size in points and an SVG's physical size are unchanged by construction.- cvd
Simulate a colour-vision deficiency:
"none"(default),"protanopia"(red-blind),"deuteranopia"(green-blind, the common one that breaks red/green encodings),"tritanopia"(blue-blind), or"achromatopsia"(total, and a fair proxy for greyscale printing). The simulation is a post-pass over the finished raster using the Machado et al. (2009) matrices applied in linear light, so it turns an accessibility check into a one-line change instead of an export-and-upload round trip. Raster output only — a vector format has no pixels to transform, andrender()warns if you ask for one.
Details
Together with scene_svg() (a string) and scene_raster() (pixels), every
output format vellum supports can now be produced without touching disk.
Backend degradation warnings (see render()) are surfaced here too, so a PDF
that could not honour a pattern or mask reports it exactly as writing a file
would.
