sd_read_preview: Read the current preview frame

View source: R/preview.R

sd_read_previewR Documentation

Read the current preview frame

Description

Reads the latest preview PPM written by the running generation and returns it as an sd_image list. Returns NULL if no preview exists yet (e.g. generation has not produced a frame). Optionally writes a PNG copy.

Usage

sd_read_preview(path, png_path = NULL)

Arguments

path

The preview PPM path passed to sd_preview_start.

png_path

Optional path; if set, the frame is also written there as PNG via sd_save_image.

Value

An sd_image list (width, height, channel, data), or NULL if unavailable.

See Also

sd_preview_start


sd2R documentation built on June 19, 2026, 9:08 a.m.