1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! Chromatic adaptation transforms XYZ tristimulus values from one
//! illuminant to another.
//!
//! Each adaptation method defines a cone response matrix M. The adaptation
//! matrix for a given illuminant pair is computed at compile time via `colr::operations::adapt::adapt`.
//! Callers pass `WHITE_POINT_XYZ` values from the [`Illuminant`] trait directly
//! to ensure numerical consistency with specification-defined white points.
//!
//! Bradford is mandated by ICC, ACES, and CSS Color Level 4 and is the
//! correct default for all standard RGB space work.
//!
//! | Type | Specification |
//! |-------------|------------------------------------------------------------------|
//! | [`Bradford`]| ICC.1:2022, Annex E |
//! | [`Cat02`] | CIE 159:2004 |
//! | [`Cat16`] | Li et al., Color Research and Application, 2017 |
//! | [`VonKries`]| Süsstrunk et al., IS&T/SPIE Electronic Imaging, 1999 |
//!
//! [`Illuminant`]: crate::illuminant::Illuminant
/// A chromatic adaptation method defined by its cone response matrix.
///
/// Only `M` is required. The inverse is derived by `colr::operations::adapt::adapt` at compile time
/// via `Mat3::invert`, ensuring consistency and eliminating the possibility
/// of a mismatched inverse.
/// Bradford chromatic adaptation.
///
/// A sharpened von Kries model using a non-diagonal cone response matrix.
/// More accurate than von Kries for large illuminant changes. Mandated by
/// ICC, ACES, and CSS Color Level 4.
///
/// Reference: ICC.1:2022, Annex E.
;
/// CAT02 chromatic adaptation.
///
/// Used in CIECAM02 and ICC v4 appearance models. Provides better hue
/// constancy than Bradford in some gamut mapping contexts.
///
/// Reference: CIE 159:2004.
;
/// CAT16 chromatic adaptation.
///
/// Used in CAM16. Successor to CAT02 with improved accuracy for large
/// chromatic differences and reduced numerical instability.
///
/// Reference: Li et al., "Comprehensive colour appearance model (CAM16)",
/// Color Research and Application, 2017.
;
/// Von Kries chromatic adaptation.
///
/// Diagonal-only scaling of cone channels using the Süsstrunk et al. matrix.
/// Less accurate than Bradford or CAT02 for large illuminant changes.
///
/// Reference: Süsstrunk et al., "A Standard Default Color Space for the
/// Internet — sRGB", IS&T/SPIE Electronic Imaging, 1999.
;