Skip to main content

Module spectral_kernel

Module spectral_kernel 

Source
Expand description

P7.0 — Spectral-space kernel: SPD/CMF POD types + CIE linear-projection. P7.0 — Spectral-space kernel: SPD/CMF POD types + CIE linear-projection.

Structs§

LinearRgb
Linear sRGB (no gamma encoding). POD, f32.
Spd
Spectral Power Distribution: radiant power at 41 wavelength samples (380–780 nm, 10 nm steps). POD, zero-heap, stack-allocated.
Xyz
CIE XYZ tristimulus values. POD, f32.

Constants§

CIE_1931_CMF_X
CIE 1931 2-degree observer colour matching functions, tabulated at 10 nm intervals from 380–780 nm.
CIE_1931_CMF_Y
CIE_1931_CMF_Z
CIE_D65_X
CIE D65 illuminant white point (normalised, Y=1).
CIE_D65_Y
CIE_D65_Z
LAMBDA_MAX
Ending wavelength (nm).
LAMBDA_MIN
Starting wavelength (nm).
LAMBDA_STEP
Wavelength step (nm).
SPD_SAMPLES
Number of spectral samples (380–780 nm at 10 nm intervals).

Functions§

ciede2000
CIEDE2000 colour difference between two XYZ values (in Lab space).
delta_e_76
CIE76 ΔE colour difference between two XYZ values (in Lab space).
emf_to_linear_rgb
Full EMF → linear sRGB pipeline.
emf_to_spd
Convert an EMF payload [α, μ, σ] to a Spectral Power Distribution.
flat_spd_to_xyz
Project a flat (equal-energy) SPD to verify the D65 white point.
gaussian_vs_tabulated_delta_e
Compute the ΔE between the tabulated CMF projection and the existing Gaussian approximation in spectral::sigma.
linear_rgb_to_display
Convert linear sRGB to 8-bit display sRGB (gamma-encoded, normalised).
linear_to_srgb_channel
Apply sRGB gamma encoding to a single linear channel.
spd_to_xyz
Project an SPD through the CIE 1931 2-degree CMFs to obtain XYZ tristimulus values.
ssim_rgba8
Structural Similarity Index (SSIM) between two RGBA8 image buffers.
xyz_to_lab
Convert XYZ to CIELAB (D65 reference white).
xyz_to_linear_srgb
Convert CIE XYZ to linear sRGB using the standard sRGB matrix.