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

    Function coerceColorsToFloat32

    • Coerce a (possibly quantized) color buffer to Float32 in [0, 1]. F32 inputs are assumed pre-normalized and pass through unchanged; Uint8 inputs are scaled by 1/255; Uint16 inputs are scaled by 1/65535.

      The downstream WASM color helpers (e.g. interpolate_colors_batch) and the shaders that consume their output interpret values as [0, 1]. Worker and main-thread paths share this helper so the normalization can't drift between them.

      Parameters

      • colors:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>

      Returns Float32Array