Skip to main content

render_scene_png

Function render_scene_png 

Source
pub fn render_scene_png(
    scene: &RenderScene,
    width: u32,
    height: u32,
) -> Option<Vec<u8>>
Expand description

Render a RenderScene contract headlessly and return raw PNG bytes.

This is blocking — it builds a GPU device and drives a synchronous readback (device.poll(Wait)), so it must be called off the UI thread (e.g. a worker thread or spawn_blocking). Native-only.