Skip to main content

Module spectral_lut

Module spectral_lut 

Source
Expand description

Pure-Rust Levenberg-Marquardt spectral inversion solver, 32x32x32 LUT baker, and zero-heap trilinear sampler. Deterministic Zero-Heap Spectral Inversion LUT & Levenberg-Marquardt Solver in Pure Rust.

Enums§

SpectralLutError

Constants§

LUT_BYTES_PER_VOXEL
LUT_RES
LUT_TOTAL_BYTE_SIZE
LUT_TOTAL_VOXELS
M_XYZ_TO_SRGB
Standard sRGB to XYZ (D65) transformation matrix.

Functions§

bake_spectral_inversion_lut
Bake a full 32x32x32 spectral inversion LUT into a caller-supplied buffer in IEEE 754 f16 format.
bake_srgb_spectral_lut
Alias for bake_spectral_inversion_lut.
f16_to_f32
Convert a 16-bit half-precision float (IEEE 754 binary16) to f32.
f32_to_f16
Convert an f32 to a 16-bit half-precision float (IEEE 754 binary16). Pure-Rust implementation with no external dependency.
invert_srgb_to_coeffs
Solve for the Jakob-Hanika coefficients matching a target linear sRGB color.
project_coeffs_to_srgb
Forward projection: evaluates sRGB from polynomial coefficients $(c_0, c_1, c_2)$.
sample_spectral_lut_trilinear
Sample coefficients from pre-baked LUT slice using trilinear interpolation. Zero heap.