Skip to content

calternal_notes_core::canvas_export

Bounded, lossless editable export metadata (DESIGN §60, #976). The renderer draws a projection; metadata always holds the original scene, including tombstones and opaque fields. No paths or resources are opened.

Source: crates/calternal-notes-core/src/canvas_export.rs

pub fn embed_png(png: &[u8], scene: &Value) -> Result<Vec<u8>, CanvasError>

Insert a checked tEXt chunk before IEND. Only a renderer-produced PNG is accepted; checked lengths prevent an invalid child response indexing bytes.

Source: crates/calternal-notes-core/src/canvas_export.rs:85

pub fn embed_svg(svg: &[u8], scene: &Value) -> Result<Vec<u8>, CanvasError>

Attach an upstream-compatible SVG payload in inert base64 comments. The renderer must supply sanitized SVG; this never interpolates source markup.

Source: crates/calternal-notes-core/src/canvas_export.rs:71

pub fn preflight(scene: &Value) -> Result<(), CanvasError>

Bound both formats before starting a renderer. Padding and rotated corners count toward the raster budget. The browser checks its remeasured bounds too.

Source: crates/calternal-notes-core/src/canvas_export.rs:11