import { type CsgsSectionInfo } from './csgs-gpu-playback'; import type { SplatClip, SplatClipLoadOptions } from './splat-clip'; /** * One section entry of a {@link CsgsSceneFile}. * * @experimental */ export interface CsgsSceneSection { /** `.csgs` section file, relative to the scene file. */ url: string; /** First frame of the section. */ g0: number; /** Frames the section spans. */ nframes: number; } /** * One of a {@link CsgsSceneFile}'s test cameras: an OpenCV pose and pinhole * intrinsics, as Faltwerk renders its reference views. * * @experimental */ export interface CsgsTestCamera { name: string; /** World → camera rotation, OpenCV axes (x right, y down, z forward). */ R: number[][]; t: number[]; fx: number; fy: number; cx: number; cy: number; w: number; h: number; } /** * A Faltwerk `scene_*.json`: the clip's sections, frame rate, a default * orbit view and test cameras. * * @experimental */ export interface CsgsSceneFile { fps: number; sections: CsgsSceneSection[]; /** A default orbit view; `front` points from the subject toward its front camera. */ orbit?: { center: number[]; up: number[]; front: number[]; dist: number; fovy_deg: number; }; testcams?: CsgsTestCamera[]; } /** * A decoded `.csgs` clip: a {@link SplatClip} plus what only this format has. * * @experimental */ export interface CsgsClip extends SplatClip { readonly format: 'csgs'; /** The scene file the clip was loaded from. */ readonly scene: CsgsSceneFile; /** The clip's sections, in frame order: spans of frames played by one set of splats. */ readonly sections: readonly CsgsSectionInfo[]; /** Whether the GPU path can play every section (see {@link CsgsSectionInfo.gpuEligible}). */ readonly gpuEligible: boolean; } /** * Options of {@link loadCsgsClip}: progress counts sections fetched, then * sections decoded. * * @experimental */ export interface LoadCsgsClipOptions extends SplatClipLoadOptions { /** An already-fetched scene file (a host that reads test cameras first). */ scene?: CsgsSceneFile; } /** * Fetches a Faltwerk `scene_*.json`. * * @experimental */ export declare function fetchCsgsScene(url: URL | string, signal?: AbortSignal): Promise; /** * Whether parsed JSON is a Faltwerk scene file: a frame rate and a non-empty * list of `.csgs` sections, each with a URL and its frame span. */ export declare function isCsgsSceneFile(value: unknown): value is CsgsSceneFile; /** * Loads a `.csgs` clip: fetches its Faltwerk `scene_*.json` (unless * `options.scene` is given) and every section, and decodes them in the * clip's own worker, which keeps them for playback. Play the result with a * `SplatClipMesh`; {@link CsgsClip.dispose} terminates the worker. * * Every section is fetched and decoded up front (0.4 to 0.8 s per section of * 60k to 110k splats). Only version-1 containers are supported. * * @example * ```ts * import { loadCsgsClip, SplatClipMesh } from '@voluma/vlam/dynamic'; * * const clip = await loadCsgsClip('https://example.com/scene_female.json', { * onProgress: ({ message }) => (status.textContent = message), * }); * const mesh = new SplatClipMesh(clip, { renderer, orientation: 'source', shBands: 3 }); * ``` * * @experimental The API may change in a minor release. */ export declare function loadCsgsClip(url: URL | string, options?: LoadCsgsClipOptions): Promise;