mcut
@mcut/compositor

renderFrame

Generated TypeScript API reference for the public mcut SDK.

mcut SDK


mcut SDK / compositor/src / renderFrame

Function: renderFrame()

function renderFrame(
   ctx,
   project,
   timeMs,
   options?): void;

Defined in: packages/compositor/src/render-frame.ts:26

Render one frame of project at timeMs into ctx (canvas2d path).

Pure with respect to inputs: the same project, time, and frame source produce the same pixels — which is what makes the export path deterministic. The context is expected to be in project coordinates (project.width × project.height); callers rendering at other sizes apply their own transform before calling.

Parameters

ctx

Canvas2D

project

assets

Record<string, { durationMs?: number; hash?: string; height?: number; id: `a-${string}`; kind: "video" | "audio" | "image"; mimeType?: string; name?: string; nativePreview?: boolean; src: string; width?: number; }> = ...

fps

number = ...

height

number = ...

id

string = ...

layouts

object[] = ...

Multicam layout templates this project references. See layouts.ts.

markers

object[] = ...

Timeline markers, sorted by timeMs (the commands keep them sorted).

name

string = ...

presets

object[] = ...

Named inspector value bundles (style presets). See presets.ts.

tracks

object[] = ...

Render order: index 0 is painted first (bottom); last is topmost.

version

1 = ...

Project format version (see migrations.ts). parseProject migrates older documents before validating; the default covers in-memory creation.

width

number = ...

timeMs

number

options?

RenderFrameOptions = {}

Returns

void

On this page