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
//! Standard colorimetric observers.
//!
//! A standard observer is an empirical model of human color vision expressed
//! as three spectral sensitivity functions x-bar(lambda), y-bar(lambda),
//! z-bar(lambda), collectively the color matching functions (CMFs). Integrating
//! a spectral power distribution against these functions yields CIE XYZ
//! tristimulus values. Because the functions differ between observers, the
//! XYZ values for the same spectrum differ between observers and the two
//! spaces are not interchangeable.
//!
//! | Type | Field | Specification |
//! |-------------|--------|---------------|
//! | [`Cie1931`] | 2-deg | CIE 015:2018 |
//! | [`Cie1964`] | 10-deg | CIE 015:2018 |
//!
//! # Which observer to use
//!
//! Every standard RGB color space (sRGB, Rec. 709, Rec. 2020, Display P3,
//! ACES, ProPhoto) is defined relative to [`Cie1931`]. The ICC profile
//! connection space is [`Cie1931`]. Use [`Cie1931`] for display and imaging
//! pipelines.
//!
//! [`Cie1964`] is recommended by CIE 015:2018 for surface color evaluation
//! of object colors subtending more than roughly 4 degrees of visual field:
//! textiles, paints, plastics, printed matter viewed at close range.
//! Industrial spectrophotometers routinely report results under both observers.
//! ISO 105-J01 (textile color fastness) mandates [`Cie1964`].
//!
//! # Converting between observers
//!
//! There is no general lossless conversion between observer spaces at the
//! tristimulus level. The only correct path is to return to the original
//! spectral data and integrate against the target observer's CMFs. Once a
//! spectrum has been collapsed to XYZ, the information needed to reconstruct
//! it is gone. Observer adaptation transforms (approximate 3x3 matrices)
//! appear in some literature but they do not preserve metamerism and are not
//! standardized. This crate does not provide them.
/// Marker for a CIE standard colorimetric observer.
///
/// Implemented by [`Cie1931`] and [`Cie1964`]. Participates in the types of
/// [`Xyz`], [`Illuminant`], and [`WavelengthGrid`] to prevent mixing values
/// from different XYZ spaces at compile time.
///
/// [`Xyz`]: crate::model::Xyz
/// [`Illuminant`]: crate::illuminant::Illuminant
/// [`WavelengthGrid`]: crate::model::WavelengthGrid
/// CIE 1931 2-degree standard observer (CIE 015:2018).
///
/// Derived from color matching experiments over a 2-degree bipartite field,
/// covering the fovea. The basis of all standard RGB color spaces and the
/// ICC profile connection space.
;
/// CIE 1964 10-degree supplementary standard observer (CIE 015:2018).
///
/// Derived from color matching experiments over a 10-degree bipartite field,
/// including the parafovea. More representative of large-area viewing.
/// Recommended for surface color evaluation of textiles, paints, and plastics,
/// and required by ISO 105-J01 for textile color fastness testing.
;