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
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Copyright (c) 2024-2025, Harbers Bik LLC
//! Traits for spectrally-defined light sources and partially absorbing media
//! =========================================================================
//!
//! This module defines two key traits:
//!
//! - [`Light`]: a trait for anything that emits and can be described by a spectral power distribution.
//! - [`Filter`]: a trait for anything that (partially) absorbs light spectra, such as dyes and pigments.
//!
//! The [`Light`] trait is primarily used to represent illuminants or display pixel emissions,
//! providing tristimulus values for a given [`Observer`] through spectral integration.
//! This enables color calculations that are not limited to the CIE 1931 standard observer,
//! allowing modeling for animal vision, wide-field observers, or custom visual systems.
//!
//! You can implement `Light` for types that contain or can generate a [`Spectrum`].
//! For standard illuminants like D65, the trait is often implemented using lookup tables
//! or hard-coded spectral curves via the [`Illuminant`] type.
//!
//! ## Conversion
//! Any `Light` can be converted into an [`Illuminant`] using the `From` implementation.
//!
//! ## Related Types
//! - [`Spectrum`]: Represents sampled spectral data across wavelengths.
//! - [`Observer`]: Encapsulates color matching functions for various observers.
//! - [`Illuminant`]: Represents standard light sources such as D65 or A.
//!
//! [`Spectrum`]: crate::spectrum::Spectrum
//! [`Observer`]: crate::observer::Observer
//! [`Illuminant`]: crate::illuminant::Illuminant
use Cow;
use crate::;
/**
Spectral representation of Lights, typically in form of (standard) Illuminants.
Also allows to use lookup tristimulus values, such as the very common
[`D65`](crate::illuminant::CieIlluminant::D65) illuminant
(see [`CieIlluminant`](crate::illuminant::CieIlluminant) implemention).
Calculating them from a spectrum is the default implementation.
*/