Skip to main content

Module metamer

Module metamer 

Source
Expand description

P7.1 — Metamers as the affine fibre of the colour-matching projection. P7.1 — Metamers as the affine fibre of the colour-matching projection.

Two SPDs are metameric if they project to the same XYZ tristimulus values under the CIE CMFs. The set of all SPDs mapping to a given XYZ is an affine fibre: particular + span(kernel).

§Linear algebra

The CMF projection is a linear map P: R^41 → R^3 (SPD → XYZ).

  • Particular solution: spd = P⁺ · xyz (pseudo-inverse)
  • Kernel basis: ker(P) = all SPDs that project to (0,0,0)
  • Fibre: spd = particular + Σ c_i · ker_i for any coefficients c_i

A metameric-black SPD is an element of the kernel (projects to zero).

§Determinism

All operations are deterministic: the CMF matrix is a compile-time constant, and the pseudo-inverse is computed via fixed-point iteration.

Enums§

MetamerError
Metamer computation error.

Functions§

fibre_spd
Construct a fibre element: particular + Σ c_i · ker_i.
is_metameric
Check if an SPD is metameric to a target XYZ (projects to the same XYZ).
is_metameric_black
Check if an SPD is metameric-black (projects to approximately zero).
metamer_kernel_basis
Compute a basis for the kernel of the CMF projection (metameric-black SPDs).
min_norm_spd_for_xyz
Compute the minimum-norm particular solution: the SPD with least energy that projects to the target XYZ.