/** * GltfGaussianSplatCodec - glTF Container Codec for Gaussian Splats * * Parses glTF 2.0 JSON and GLB binary containers carrying Gaussian splat data * via the KHR_gaussian_splatting extension family: * * 1. **Baseline (uncompressed)**: Reads KHR_gaussian_splatting attributes * directly from glTF accessors/bufferViews (POSITION, _ROTATION, _SCALE, * _OPACITY, SH_DEGREE_N_COEF_M). * * 2. **SPZ-compressed**: Detects KHR_gaussian_splatting_compression_spz * extension, extracts the SPZ payload from the referenced bufferView, * and delegates decompression to the existing SpzCodec. * * GLB Detection: * Magic bytes: 0x46546C67 ("glTF" in ASCII, little-endian) at offset 0. * GLB header: magic (4 bytes) + version (4 bytes) + length (4 bytes) = 12 bytes. * * Color Space Support: * - srgb_rec709_display: BT.709 sRGB display-referred (default) * - lin_rec709_display: BT.709 linear display-referred * * References: * - KHR_gaussian_splatting (Khronos glTF extension, RC Q1 2026) * - KHR_gaussian_splatting_compression_spz (SPZ compression extension) * - W.038: Dual standardization track codec abstraction * * @module gpu/codecs * @version 1.0.0 */ import { AbstractGaussianCodec } from './IGaussianCodec.js'; import type { GaussianSplatData, GaussianCodecCapabilities, GaussianDecodeOptions, CodecResult, CodecMetadata } from './types.js'; export declare class GltfGaussianSplatCodec extends AbstractGaussianCodec { private readonly codecId; private readonly spzCodec; constructor(); getCapabilities(): GaussianCodecCapabilities; /** * Check if a buffer contains a GLB file by inspecting the magic bytes, * or if it starts with a JSON object (potential .gltf). */ canDecode(buffer: ArrayBuffer): boolean; extractMetadata(buffer: ArrayBuffer): Promise; decode(buffer: ArrayBuffer, options?: GaussianDecodeOptions): Promise>; initialize(): Promise; dispose(): void; /** * Parse a glTF container, handling both GLB and JSON-only formats. * * @returns Parsed glTF JSON and optional binary buffer */ private parseGltfContainer; /** * Parse a GLB binary container. * * GLB layout: * [Header: 12 bytes] magic(4) + version(4) + length(4) * [JSON chunk: 8 + N bytes] chunkLength(4) + chunkType(4) + jsonData(N) * [BIN chunk: 8 + M bytes] chunkLength(4) + chunkType(4) + binData(M) */ private parseGlb; /** * Parse a JSON-only glTF file. */ private parseGltfJson; /** * Find the first mesh primitive that carries KHR_gaussian_splatting. * * @throws CodecDecodeError if no Gaussian splatting primitive is found */ private findGaussianPrimitive; /** * Extract raw bytes from a glTF bufferView. */ private extractBufferViewData; /** * Resolve a glTF buffer index to its ArrayBuffer data. * * For GLB: buffer 0 is the BIN chunk. * For external URIs: not supported (would require async fetch). */ private resolveBuffer; /** * Decode a data URI to an ArrayBuffer. */ private decodeDataUri; /** * Read accessor data as a Float32Array. * * Handles component type conversion and normalization for: * - FLOAT: Direct read * - BYTE/SHORT (normalized): Scale to [-1, 1] * - UNSIGNED_BYTE/UNSIGNED_SHORT (normalized): Scale to [0, 1] * - BYTE/SHORT/UNSIGNED_BYTE/UNSIGNED_SHORT (non-normalized): Direct int-to-float */ private readAccessorFloat32; /** * Decode uncompressed KHR_gaussian_splatting attributes from glTF accessors. */ private decodeBaseline; /** * Detect the highest SH degree present in a primitive's attributes. */ private detectShDegree; /** * Convert color array from linear RGB to sRGB in-place. */ private convertColorsLinearToSrgb; } //# sourceMappingURL=GltfGaussianSplatCodec.d.ts.map