rememberFilmstripFrame

fun rememberFilmstripFrame(renderer: FrameRenderer, composition: EditComposition, at: Duration, heightPx: Int?, exportSpec: ExportSpec = ExportSpec()): ImageBitmap?(source)

Remembers one frame of composition, rendered at at with its effects applied, and closes it when this leaves composition.

For a poster frame, a chapter picker or a clip card, which want the frame covering one exact instant rather than the run of nearest sync samples a strip reads. Each fetch goes through FrameRenderer.frame, so nothing here is shared with rememberFilmstripFrames.

The frame is fetched again whenever at, heightPx, exportSpec or anything that would change a rendered frame changes. An edit that changes nothing a frame is rendered from, such as the audio, keeps the frame already held. The last frame produced stays in place while the next one renders, and a render that fails clears it.

Return

The frame, or null while none has arrived.

Parameters

renderer

What renders the frame, usually the Filmstrip itself.

composition

The edit to render from.

at

Where in the composition to render.

heightPx

The height to render at, in pixels. Null renders at the composition's own output height, and a height of zero or less renders nothing.

exportSpec

The export this frame stands in for, which renders it at the HDR grade that export resolves to.