Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    The pool surface the dispatcher needs (a port, so tests can fake it).

    interface CodecPoolPort {
        isInitialized(): boolean;
        getIdleWarmWorkerCount(): number;
        ensureCodecsWarm(): boolean;
        runDecode<T>(
            op: string,
            fn: (
                api: Remote<
                    {
                        initialize: (
                            wasmPath?: string,
                            wasmModule?: Module,
                        ) => Promise<WorkerInitResult>;
                        decodeQuantized: (
                            p: {
                                data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                                bounds: [number, number];
                                dtype: "uint8" | "uint16";
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodeLogScalar: (
                            p: {
                                data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                                maxLog: number;
                                dtype: "uint8" | "uint16";
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodeGeologScalar: (
                            p: {
                                data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                                minLog: number;
                                maxLog: number;
                                dtype: "uint8" | "uint16";
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodePerChannel: (
                            p: {
                                data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                                kind: PerChannelKind;
                                colLo: Float64Array;
                                colHi: Float64Array;
                                zeroLevel: boolean;
                                colOffset: number;
                                bits: 8 | 16;
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodeLUT: (
                            p: {
                                indices:
                                    | Uint8Array<ArrayBufferLike>
                                    | Uint16Array<ArrayBufferLike>;
                                lut: number[];
                                k: number;
                                lutMode: "row" | "scalar";
                                dtype?: "uint8" | "uint16";
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodeBroadcasted: (
                            p: {
                                value: Float32Array;
                                numPoints: number;
                                elementsPerPoint: number;
                            },
                        ) => Promise<Float32Array<ArrayBufferLike>>;
                        decodeBloscBatch: (
                            items: BloscBatchItem[],
                        ) => Promise<BloscBatchResult[]>;
                        warmCodecs: () => Promise<void>;
                        projectLinesTo3D: (
                            p: {
                                positions: Float32Array;
                                segments: Uint32Array;
                                widths: Float32Array;
                                colors:
                                    | Uint8Array<ArrayBufferLike>
                                    | Float32Array<ArrayBufferLike>
                                    | Uint16Array<ArrayBufferLike>
                                    | null;
                                sharpness: Float32Array<ArrayBufferLike> | null;
                                scalars:
                                    | Uint8Array<ArrayBufferLike>
                                    | Float32Array<ArrayBufferLike>
                                    | Float16Array<ArrayBufferLike>
                                    | null;
                                viewState: ProjectionViewState;
                                ndim: number;
                                segmentCount: number;
                                colorComponents?: 4 | 3;
                                emitSourceIndices?: boolean;
                            },
                        ) => Promise<
                            {
                                startPositions: Float32Array;
                                endPositions: Float32Array;
                                startColors: Float32Array;
                                endColors: Float32Array;
                                startWidths: Float32Array;
                                endWidths: Float32Array;
                                startSharpness: Float32Array;
                                endSharpness: Float32Array;
                                startScalars: Float32Array;
                                endScalars: Float32Array;
                                startAlphas: Float32Array;
                                endAlphas: Float32Array;
                                segmentLengths: Float32Array;
                                startJointCode: Float32Array;
                                endJointCode: Float32Array;
                                visibleSegmentCount: number;
                                bounds?: LinesProjectionBounds;
                                sourceSegmentIndices?: Uint32Array<ArrayBufferLike>;
                            },
                        >;
                        projectGSplatsTo3D: (
                            p: {
                                positions: Float32Array;
                                choleskyFactors: Float32Array;
                                amplitudes: Float32Array;
                                colors:
                                    | Uint8Array<ArrayBufferLike>
                                    | Float32Array<ArrayBufferLike>
                                    | Uint16Array<ArrayBufferLike>
                                    | null;
                                sharpness: Float32Array<ArrayBufferLike> | null;
                                viewState: ProjectionViewState;
                                ndim: number;
                                splatCount: number;
                                discreteDims?: readonly number[];
                                discreteSteps?: Record<number, number>;
                                extendToAllDims?: readonly number[];
                                truncate?: number;
                                minAmplitude?: number;
                                colorComponents?: 4 | 3;
                                emitSourceIndices?: boolean;
                            },
                        ) => Promise<
                            {
                                centers3D: Float32Array;
                                choleskyFactors3D: Float32Array;
                                amplitudes: Float32Array;
                                colors: Float32Array;
                                visibleCount: number;
                                bounds?: GSplatsProjectionBounds;
                                sourceIndices?: Uint32Array<ArrayBufferLike>;
                            },
                        >;
                    },
                >,
            ) => Promise<T>,
        ): Promise<T>;
    }
    Index
    • Run fn on the least-busy WARM worker (timeout-guarded, never pool-aborted).

      Type Parameters

      • T

      Parameters

      • op: string
      • fn: (
            api: Remote<
                {
                    initialize: (
                        wasmPath?: string,
                        wasmModule?: Module,
                    ) => Promise<WorkerInitResult>;
                    decodeQuantized: (
                        p: {
                            data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                            bounds: [number, number];
                            dtype: "uint8" | "uint16";
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodeLogScalar: (
                        p: {
                            data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                            maxLog: number;
                            dtype: "uint8" | "uint16";
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodeGeologScalar: (
                        p: {
                            data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                            minLog: number;
                            maxLog: number;
                            dtype: "uint8" | "uint16";
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodePerChannel: (
                        p: {
                            data: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                            kind: PerChannelKind;
                            colLo: Float64Array;
                            colHi: Float64Array;
                            zeroLevel: boolean;
                            colOffset: number;
                            bits: 8 | 16;
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodeLUT: (
                        p: {
                            indices: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
                            lut: number[];
                            k: number;
                            lutMode: "row" | "scalar";
                            dtype?: "uint8" | "uint16";
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodeBroadcasted: (
                        p: {
                            value: Float32Array;
                            numPoints: number;
                            elementsPerPoint: number;
                        },
                    ) => Promise<Float32Array<ArrayBufferLike>>;
                    decodeBloscBatch: (
                        items: BloscBatchItem[],
                    ) => Promise<BloscBatchResult[]>;
                    warmCodecs: () => Promise<void>;
                    projectLinesTo3D: (
                        p: {
                            positions: Float32Array;
                            segments: Uint32Array;
                            widths: Float32Array;
                            colors:
                                | Uint8Array<ArrayBufferLike>
                                | Float32Array<ArrayBufferLike>
                                | Uint16Array<ArrayBufferLike>
                                | null;
                            sharpness: Float32Array<ArrayBufferLike> | null;
                            scalars:
                                | Uint8Array<ArrayBufferLike>
                                | Float32Array<ArrayBufferLike>
                                | Float16Array<ArrayBufferLike>
                                | null;
                            viewState: ProjectionViewState;
                            ndim: number;
                            segmentCount: number;
                            colorComponents?: 4 | 3;
                            emitSourceIndices?: boolean;
                        },
                    ) => Promise<
                        {
                            startPositions: Float32Array;
                            endPositions: Float32Array;
                            startColors: Float32Array;
                            endColors: Float32Array;
                            startWidths: Float32Array;
                            endWidths: Float32Array;
                            startSharpness: Float32Array;
                            endSharpness: Float32Array;
                            startScalars: Float32Array;
                            endScalars: Float32Array;
                            startAlphas: Float32Array;
                            endAlphas: Float32Array;
                            segmentLengths: Float32Array;
                            startJointCode: Float32Array;
                            endJointCode: Float32Array;
                            visibleSegmentCount: number;
                            bounds?: LinesProjectionBounds;
                            sourceSegmentIndices?: Uint32Array<ArrayBufferLike>;
                        },
                    >;
                    projectGSplatsTo3D: (
                        p: {
                            positions: Float32Array;
                            choleskyFactors: Float32Array;
                            amplitudes: Float32Array;
                            colors:
                                | Uint8Array<ArrayBufferLike>
                                | Float32Array<ArrayBufferLike>
                                | Uint16Array<ArrayBufferLike>
                                | null;
                            sharpness: Float32Array<ArrayBufferLike> | null;
                            viewState: ProjectionViewState;
                            ndim: number;
                            splatCount: number;
                            discreteDims?: readonly number[];
                            discreteSteps?: Record<number, number>;
                            extendToAllDims?: readonly number[];
                            truncate?: number;
                            minAmplitude?: number;
                            colorComponents?: 4 | 3;
                            emitSourceIndices?: boolean;
                        },
                    ) => Promise<
                        {
                            centers3D: Float32Array;
                            choleskyFactors3D: Float32Array;
                            amplitudes: Float32Array;
                            colors: Float32Array;
                            visibleCount: number;
                            bounds?: GSplatsProjectionBounds;
                            sourceIndices?: Uint32Array<ArrayBufferLike>;
                        },
                    >;
                },
            >,
        ) => Promise<T>

      Returns Promise<T>