Expand description
RecordingScene — composes the recorder’s two visible streams
(full-screen capture + circular webcam bubble) into a single
Stage ready to render to a wgpu::TextureView (M-EXPORT.0 of
M-RECORD-EXPORT).
Reusable composition primitive: the recorder feeds it new BGRA
frames from the per-channel capture pipelines; the future editor
preview lane will instantiate the same scene from decoded
recording frames. Keeping composition inside wisp (rather than
in screen-app) keeps the recorder + editor visually consistent
and lets the storybook drive snapshot tests without booting Tauri.
§Layout
- Screen frame is the fullscreen background — a
Spriteanchored centre, scaled to fill NDC[-1, 1]². - Camera frame is a smaller
Spriteinside aContainerwhoseclipis aMaskShape::Ellipsewith half-extents aspect-compensated for the output canvas, so the bubble is a true circle in pixels (an NDCCirclewould stretch into an ellipse on a non-square frame). Default position is the bottom-left corner with a small margin; theCamLayoutstruct exposes this so the future editor can re-anchor.
`set_screen_frame` / `set_camera_frame` overwrite the GPU
texture in place — no queueing. The encoder reads at its own
frame rate (30 fps in M-EXPORT.1's default) regardless of source
FPS; uploads from faster sources just write the most recent
frame, slower sources show the last upload until a new one
lands.Structs§
- CamLayout
- Position + size of the circular webcam bubble within the composed
frame. All coordinates are NDC —
(-1, -1)bottom-left,(1, 1)top-right. - Cursor
Ripple - One click ripple to draw under the cursor (ED.19): an expanding,
fading ring centered at a click, in output NDC. The app derives these
from the click log (
edit::telemetry::ripples_at) —centeris already mapped through the screen transform,radiusgrows with age,alphafades1 → 0. - Recording
Scene - Two-stream composition: fullscreen screen-capture + circular
webcam bubble. Owns the
Stage+ the per-streamVideoTextures. - Stream
Dimensions - Dimensions for one of the composed input streams. Used at
RecordingScene::newtime to allocate the backingVideoTextures; subsequentset_*_framecalls must pass a BGRA buffer matchingwidth * height * 4.
Functions§
- draw_
pointer 🔒 - Append the arrow-cursor silhouette to
g: a classic pointer filled withcolor, sized by NDC half-extenthalf, anchored at its hot-spottip. - flip_
bgra_ 🔒rows_ top_ down_ to_ bottom_ up - Copy a packed BGRA buffer (
width * height * 4bytes, no row padding) into a freshly-allocatedVec<u8>with rows reversed so the output is bottom-up.