/** * Decodes a whole `.asog` file (Animated SOG v1) into flat arrays: the * SOG v2 static attributes (centres, rotations, scales, colours, the SH * palette) and the TRiGS motion per splat, dequantised as format section 4.2 * says. Three-free and worker-safe; zlib streams are inflated with the * platform's `DecompressionStream('deflate')`. * * Ported from the MIT-licensed reference decoder of * [animated-sog](https://github.com/arrival-space/animated-sog) * (`js/src/core/{decode,dequant,planes,inflate}.js`, Copyright (c) 2026 * Arrival.Space). Unlike the reference, which packs half floats for its * GPU textures, the motion is kept in float32, and `m_ref` is computed from * those float32 control points (spec 4.2 asks a reduced-precision decoder * to use the values it stores). */ import { type SplatShData } from '../../core/splat-data'; import { type AsogHeader, type AsogManifest } from './asog-container'; /** * Floats of motion per splat in {@link AsogData.motion} (five RGBA texels): * * | floats | values | * |---|---| * | 0–3 | μ, σ, flags (bit 0 static, bits 1+ clip index), anchor x | * | 4–7 | anchor y, anchor z, O0 x, O0 y | * | 8–11 | O0 z, O1 x, O1 y, O1 z | * | 12–15 | O2 x, O2 y, O2 z, G0 | * | 16–19 | G1, G2, G3, G4 | * * @experimental */ export declare const ASOG_MOTION_FLOATS = 20; /** Offsets into one splat's {@link ASOG_MOTION_FLOATS}. */ export declare const ASOG_MOTION: { readonly mu: 0; readonly sigma: 1; readonly flags: 2; readonly anchor: 3; readonly omega: 6; readonly g: 15; }; /** Floats per clip in {@link AsogData.clips}. */ export declare const ASOG_CLIP_FLOATS = 8; /** * A decoded `.asog` file. * * @experimental */ export interface AsogData { readonly header: AsogHeader; readonly manifest: AsogManifest; /** Splats. */ readonly count: number; /** SH bands beyond DC (0 for none). */ readonly shBands: 0 | 1 | 2 | 3; /** Canonical (unmoved) centres, xyz per splat, in the file's y-down frame. */ readonly centers: Float32Array; /** Canonical rotations, unit quaternions as w x y z per splat. */ readonly rotations: Float32Array; /** Linear scales, xyz per splat. */ readonly scales: Float32Array; /** Base colour (degree 0 SH) and opacity, RGBA bytes per splat. */ readonly colors: Uint8Array; /** Higher-order SH palette and labels, or null without SH. */ readonly sh: SplatShData | null; /** The motion, {@link ASOG_MOTION_FLOATS} floats per splat. */ readonly motion: Float32Array; /** * The clip table, {@link ASOG_CLIP_FLOATS} per clip: time offset, active * start, active end, 0, core start, core end, fade-in and fade-out * (seconds). */ readonly clips: Float32Array; /** The soundtrack, or null when the file has none. */ readonly audio: { readonly mime: string; readonly bytes: Uint8Array; } | null; } /** * Decodes a whole `.asog` file held in memory. * * @throws {Error} on a file that is not version-1 `.asog`, a missing or * misordered stream, or a stream that inflates to the wrong size. * @experimental */ export declare function parseAsog(input: ArrayBuffer | Uint8Array): Promise;