/** * VAV (Vertex Animation Video) manifest parsing and validation. * * Numerical geometry and per-vertex appearance use exact UTSBM tracks (meshopt-coded block * assets). Optional UV-space appearance is visual media and keeps a byte index for progressive * playback. * * Format specification: docs/formats/vav-manifest.md * * @module VAVManifest */ import type { IndexedMeshoptTrackDescriptor } from '../MotionTracks/IndexedMeshoptTrack.cjs'; /** Manifest `type` discriminator. */ export declare const VAV_MANIFEST_TYPE = "utsubo-vav"; /** Second public VAV manifest schema: numerical tracks travel as UTSBM block assets. */ export declare const VAV_MANIFEST_VERSION = 2; /** One contiguous encoded sample: byte offset, byte length, and keyframe flag. */ export type VAVFrameIndexEntry = [offset: number, length: number, key: 0 | 1]; /** Fields shared by every visual-media VAV track. */ export interface VAVTrackContainer { file: string; codec: string; width: number; height: number; byteLength: number; bodyByteLength: number; gop: number; frames: VAVFrameIndexEntry[]; description?: string; } /** Exact numerical track consumed by the runtime. */ export interface VAVNumericalTrack extends IndexedMeshoptTrackDescriptor { planes: string[]; width: number; height: number; rangeMax?: number[]; } /** A UV-sampled visual appearance track. */ export interface VAVUVTextureTrack extends VAVTrackContainer { components: 1 | 3; rangeMax: number[]; observedMax?: number[]; lighting?: 'full' | 'indirect'; } /** Validated topology sidecar metadata. */ export interface VAVBaseDescriptor { file: string; indexCount: number; hasUV: boolean; byteLength?: number; } /** Validated clip bounds. */ export interface VAVManifestBounds { min: [number, number, number]; max: [number, number, number]; } /** Validated VAV package manifest. */ export interface VAVManifest { type: typeof VAV_MANIFEST_TYPE; version: typeof VAV_MANIFEST_VERSION; frameCount: number; frameRate: number; vertexCount: number; atlasWidth: number; bounds: VAVManifestBounds; base: VAVBaseDescriptor; tracks: { geometry: VAVNumericalTrack; appearance?: VAVNumericalTrack; }; uvTextures?: Record; generator?: string; } /** Parsed topology arrays from `base.bin`. */ export interface VAVBase { indices: Uint32Array; uv: Float32Array | null; } /** * Parse and normalize a VAV manifest, validating the header, the base descriptor, and every * track's plane list + frame index (contiguity, keyframe-first, body coverage). Unknown fields * are ignored; structural problems fail loudly rather than mis-rendering. * * @param {Object|string} input - The manifest object or its JSON text. * @returns {Readonly} The normalized, frozen manifest. */ export declare function parseVAVManifest(input: unknown): Readonly; /** * Parse a `base.bin` topology sidecar: `u32 indexCount · u32 vertexCount · u32 flags` then * `u32 indices[indexCount]` then `f32 uv[2·vertexCount]` when flags bit0 is set (LE). * * @param {ArrayBuffer} buffer - The sidecar bytes. * @param {Object} manifest - The parsed manifest (cross-checked against the header). * @returns {{ indices:Uint32Array, uv:Float32Array|null }} */ export declare function parseVAVBase(buffer: ArrayBuffer, manifest: Readonly>): VAVBase; /** * Serialize a topology sidecar — the writer twin of {@link parseVAVBase}, shared by the * encoder CLI and the tests. * * @param {Uint32Array|number[]} indices - Triangle index buffer. * @param {number} vertexCount - Unique vertex count. * @param {Float32Array|null} [uv=null] - Optional per-vertex UVs (2·vertexCount). * @returns {Uint8Array} The `base.bin` bytes. */ export declare function encodeVAVBase(indices: Uint32Array | number[], vertexCount: number, uv?: Float32Array | null): Uint8Array;