Skip to main content

Module editor_preview

Module editor_preview 

Source
Expand description

EditorPreview — composes the frame at the playhead for the editor’s preview surface (ED.6 / M-EDIT).

Reuses RecordingCompose — the proven recorder compositor — but sourced from a seekable EditorVideoStream at the editor’s playhead (EditorPlayer::current_frame) rather than from live capture slots. This is the same compose path the export pipeline (ED.20) will drive, so preview and export agree frame-for-frame by construction.

The recorded clip is already a fully-composited screen frame (the cam bubble, if any, was baked in at record time), so the editor preview shows it full-frame; the cam channel of the underlying scene is unused. The cinematic framing controls (background, padding, rounded corners, shadow) layer on in ED.18. The live winit window that presents these composed frames follows the preview crate’s pattern and is verified manually (it can’t run in the headless gate).

Structs§

EditorPreview
Composes the editor preview frame for a source_w × source_h clip into a canvas_w × canvas_h output (the project’s aspect-ratio canvas).

Constants§

CURSOR_BASE_HALF 🔒
Cursor pointer half-extent in NDC at 100 % size and 1× zoom (ED.19). The pointer grows with size_pct and with the zoom (it’s part of the magnified content).
FILL_SCALE 🔒
Base scale that fills the NDC [-1, 1] viewport: the screen sprite is anchored centre with a [0, 1]² local rect, so a scale of 2 maps the full source frame onto [-1, 1].
WALLPAPER_GEN_H 🔒
See WALLPAPER_GEN_W.
WALLPAPER_GEN_W 🔒
Resolution the procedural wallpaper (ISS-15) is generated at — small, since a soft gradient stretches cleanly to fill the frame.

Functions§

aspect_fit_factor 🔒
Per-axis screen shrink that fits a source_w × source_h frame inside a canvas_w × canvas_h output canvas without stretch (AUT-513). The screen sprite’s base transform fills NDC [-1, 1]² (the whole canvas), so when the canvas aspect differs from the source aspect the source would stretch; this factor shrinks the over-long axis so the source keeps its shape and the remainder becomes a matte (letterbox / pillarbox).
background_geometry 🔒
Derive the rounded-corner frame window + corner radius (both NDC) and the per-axis padding shrink factor from the canvas dims and the config’s pixel padding / corner radius (ED.18). Pure — unit-tested without a GPU.
framed_transform 🔒
Build the screen-sprite transform that applies crop then zoom.
framed_transform_padded 🔒
framed_transform with a uniform padding inset folded in (ED.18).
wallpaper_palette 🔒
Three RGB anchor colors for a named wallpaper palette (ISS-15). Unknown names fall to the default “aurora”.
wallpaper_rgba 🔒
Generate a procedural wallpaper backdrop as packed RGBA8 (width*height*4). A soft diagonal three-stop gradient with a faint aurora band, keyed on name’s palette. License-clean (no bundled asset), deterministic, and pure — exhaustively testable. (ISS-15.)