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§
- Editor
Preview - Composes the editor preview frame for a
source_w × source_hclip into acanvas_w × canvas_houtput (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_pctand 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 of2maps 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_hframe inside acanvas_w × canvas_houtput 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
cropthenzoom. - framed_
transform_ 🔒padded framed_transformwith 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 onname’s palette. License-clean (no bundled asset), deterministic, and pure — exhaustively testable. (ISS-15.)