Expand description
Kubelka-Munk spectral pigment mixing crate.
Structs§
- KsSpectrum
- K/S spectrum representation (164 bytes per color).
- Pigment
- Bundled pigment holding the original sRGB, sigmoid coefficients, and K/S spectrum.
- RgbTransform
- Precomputed spectral-to-linear-RGB transform matrix for a given illuminant.
- Sigmoid
Coeffs - Jakob sigmoid coefficients (12 bytes per color).
Enums§
- Pigment
Error - Error type for neco-pigment.
Constants§
- LAMBDAS
- Wavelength array [380, 390, …, 780] nm.
- LAMBDA_
MAX - LAMBDA_
MIN - LAMBDA_
STEP - N_
SPECTRAL - Spectral discretization constants.
Functions§
- illuminant_
a - Return the cached RGB transform matrix for illuminant A.
- illuminant_
d50 - Return the cached RGB transform matrix for illuminant D50.
- illuminant_
d65 - Return the cached RGB transform matrix for illuminant D65.
- illuminant_
e - Return the cached RGB transform matrix for equal-energy illuminant E.
- ks_mix
- Linear interpolation in K/S space.
tis not clamped (caller’s responsibility). - ks_
mix_ weighted - Weighted blend of multiple colors in K/S space. Weights are not normalized.
- ks_
to_ reflectance - K/S to reflectance (KM infinite thickness).
- ks_
to_ srgb - Convert K/S spectrum to sRGB (using LUT gamma).
- linear_
to_ srgb - linear_
to_ srgb_ lut - Linear to sRGB conversion using LUT with linear interpolation.
- reflectance_
to_ ks - Reflectance to K/S conversion (per wavelength, KM infinite thickness).
- rgb_
to_ ks - Convert sRGB to K/S spectrum (handles black/white analytically).
- rgb_
to_ sigmoid - Fit Jakob sigmoid coefficients to an sRGB color via Gauss-Newton optimization.
- sigmoid_
to_ spectrum - Convert sigmoid coefficients to a reflectance spectrum.
- spectrum_
to_ linear_ rgb - Convert a reflectance spectrum to linear sRGB via dot product with the precomputed matrix.
- srgb_
to_ linear - srgb_
to_ linear_ lut - sRGB to linear conversion using LUT with linear interpolation.
- to_u8