Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Dependencies a driver needs from the panel. Mostly wrapped panel methods that the driver doesn't construct itself, plus the few recording options that affect per-mode behaviour.

    interface CaptureContext {
        sceneManager: SceneManager;
        fps: number;
        renderFrameToCanvas: () => Promise<HTMLCanvasElement>;
        generateFilename: (ext: string) => string;
        generateFfmpegScript: (frames: number, ext: string) => string;
        downloadBlob: (blob: Blob, filename: string) => void;
        computeVideoBitrate: (width: number, height: number) => number;
        showToast: (msg: string) => void;
        logWarning: (msg: string) => void;
        logError: (msg: string) => void;
        imageQuality: number;
        videoCodec: VideoCodecOption;
        env: {
            showSaveFilePicker?: (opts: unknown) => Promise<FileSystemFileHandle>;
        };
        signal: AbortSignal;
    }
    Index
    sceneManager: SceneManager
    fps: number
    renderFrameToCanvas: () => Promise<HTMLCanvasElement>

    Read the live framebuffer into a 2D canvas. Async to match the underlying post-processing readback (sync today, async under WebGPU).

    generateFilename: (ext: string) => string

    Build a recording filename for a given extension.

    generateFfmpegScript: (frames: number, ext: string) => string

    Build the bundled encode_video.sh script. The panel supplies the recording mode, output naming and (for EXR) the viewer's grade, so the driver only has to say how many frames of what it wrote.

    downloadBlob: (blob: Blob, filename: string) => void

    Trigger a browser download.

    computeVideoBitrate: (width: number, height: number) => number

    Compute the H.264/H.265/etc. bitrate for the canvas size.

    showToast: (msg: string) => void

    Show a non-blocking toast notification.

    logWarning: (msg: string) => void

    Logger for warnings + errors (panel pre-bound to its module tag).

    logError: (msg: string) => void
    imageQuality: number

    Image quality in [0, 1] for jpeg/webp (matches canvas.toBlob); ignored for png.

    videoCodec: VideoCodecOption

    User-selected video codec.

    env: { showSaveFilePicker?: (opts: unknown) => Promise<FileSystemFileHandle> }

    Browser environment for showSaveFilePicker (so tests can stub).

    signal: AbortSignal

    AbortSignal for the offline-capture session. Drivers MAY check signal.aborted in long-running setup/finalize work to short-circuit cleanly when the panel is disposed mid-capture or the user cancels. The panel also checks the signal between frames so abort during an await propagates within ~1 frame.