import { DataTable } from '../data-table';
import { type CameraBasis } from './camera';
/**
 * Number of SH coefficients per color channel for the scene's SH band
 * count. Matches the `f_rest_*` layout in DataTable (channel-major).
 *
 * @param bands - 0–3.
 * @returns Coefficient count per channel.
 */
declare const numSHCoeffsPerChannel: (bands: number) => number;
/**
 * Floats per gaussian in the chunk input buffer that gets uploaded to the
 * GPU project shader. Layout:
 *   [0..2]   pos.xyz
 *   [3..6]   rot.w, rot.x, rot.y, rot.z  (rot_0..rot_3)
 *   [7..9]   log_scale.xyz
 *   [10]     opacity (logit)
 *   [11..13] f_dc.rgb
 *   [14..14+3·N-1]  SH coefficients, channel-major: R[0..N-1], G[0..N-1], B[0..N-1]
 *
 * @param numSHBands - 0–3.
 * @returns Per-gaussian stride in 32-bit floats.
 */
declare const splatInputStride: (numSHBands: number) => number;
/**
 * Reusable scratch buffers for `sortCandidatesByDepth`. One instance is
 * created per render in the orchestrator and reused across every group's
 * sort to avoid allocating multi-MB typed arrays on every call. All
 * buffers grow on demand and never shrink.
 */
declare class SortScratch {
    /** Float32 depths derived from candidate positions; aliased over `keys`. */
    depth: Float32Array;
    /** Sortable u32 reinterpretation of `depth`. Same backing buffer. */
    keys: Uint32Array;
    /** Ping-pong buffer for radix sort (keys / indices). */
    keysAlt: Uint32Array;
    indicesAlt: Uint32Array;
    /** Per-byte histogram, reused across passes. */
    counts: Uint32Array;
    constructor();
    ensure(count: number): void;
}
/**
 * Sort `candidateIndices[0..count)` by camera-space depth ascending
 * (front-to-back) so chunked dispatches process splats in correct blend
 * order. Mutates `candidateIndices` in place.
 *
 * Depth is `forward · (pos − eye)` — no projection needed.
 *
 * Uses a 4-pass LSD radix sort on the bit-pattern of the depth as a
 * sortable u32. For mixed-sign IEEE 754 floats this requires flipping
 * either the sign bit (positive) or every bit (negative); the result is
 * monotonic in float order, so a radix sort on the u32 reinterprets
 * cleanly. At ~250K candidates per group this is ~20× faster than a JS
 * comparator sort.
 *
 * @param cols - Pre-resolved column references (only `x`, `y`, `z` are read).
 * @param candidateIndices - Indices into dataTable rows (mutated).
 * @param count - Number of valid entries.
 * @param camera - Camera basis (only forward + eye used).
 * @param scratch - Reusable scratch buffers, grown on demand.
 */
declare const sortCandidatesByDepth: (cols: SplatColumnRefs, candidateIndices: Uint32Array, count: number, camera: CameraBasis, scratch: SortScratch) => void;
/**
 * Cached typed-array references for the columns that `packChunkInput`
 * reads. Built once per render in the orchestrator and reused across
 * every group/chunk to avoid `getColumnByName` lookups and the SH-rest
 * array allocation on the hot path.
 */
type SplatColumnRefs = {
    x: Float32Array;
    y: Float32Array;
    z: Float32Array;
    rotW: Float32Array;
    rotX: Float32Array;
    rotY: Float32Array;
    rotZ: Float32Array;
    scaleX: Float32Array;
    scaleY: Float32Array;
    scaleZ: Float32Array;
    opacity: Float32Array;
    fdcR: Float32Array;
    fdcG: Float32Array;
    fdcB: Float32Array;
    /** Channel-major SH coefficients: indices `[0..N-1]` red, then green, then blue. Empty when `numSHBands === 0`. */
    shRest: Float32Array[];
};
/**
 * Resolve the typed-array references for every column `packChunkInput`
 * touches. Call once per render; reuse the result across all chunks.
 *
 * @param dataTable - Source splat data.
 * @param numSHBands - Scene's SH band count (0–3).
 * @returns Cached column references.
 */
declare const getSplatColumnRefs: (dataTable: DataTable, numSHBands: number) => SplatColumnRefs;
/**
 * Pack a chunk's raw splat fields into a flat Float32Array suitable for
 * upload to the GPU project shader. The layout matches `splatInputStride`.
 *
 * @param cols - Pre-resolved column references (build once via `getSplatColumnRefs`).
 * @param chunkIndices - Indices into dataTable for this chunk's splats.
 * @param chunkStart - Offset into `chunkIndices` where the chunk begins.
 * @param chunkSize - Number of splats in this chunk.
 * @param numSHBands - Scene's SH band count (0–3).
 * @param out - Output buffer, length ≥ `chunkSize · stride`.
 */
declare const packChunkInput: (cols: SplatColumnRefs, chunkIndices: Uint32Array, chunkStart: number, chunkSize: number, numSHBands: number, out: Float32Array) => void;
/**
 * Convenience: derive the scene's SH band count from the DataTable's
 * `f_rest_*` columns. Used by the renderer to size the input stride.
 *
 * @param dataTable - Splat data.
 * @returns SH band count clamped to 0–3.
 */
declare const sceneSHBands: (dataTable: DataTable) => 0 | 1 | 2 | 3;
export { splatInputStride, numSHCoeffsPerChannel, sortCandidatesByDepth, SortScratch, getSplatColumnRefs, packChunkInput, sceneSHBands, type SplatColumnRefs };
