use std::{ops::RangeInclusive, sync::OnceLock};
pub mod cie1931;
pub use cie1931::CIE1931;
pub mod cie1964;
pub use cie1964::CIE1964;
pub mod cie2015;
pub use cie2015::CIE2015;
pub mod cie2015_10;
pub use cie2015_10::CIE2015_10;
use nalgebra::SMatrix;
use crate::{
observer::{Observer, SpectralLocus},
spectrum::NS,
xyz::XYZ,
};
pub struct ObserverData {
pub data: SMatrix<f64, 3, NS>,
pub lumconst: f64,
pub tag: Observer,
pub name: &'static str,
pub d65: OnceLock<XYZ>,
pub d50: OnceLock<XYZ>,
pub spectral_locus: OnceLock<SpectralLocus>,
pub spectral_locus_range: RangeInclusive<usize>,
}
impl ObserverData {
const fn new(
tag: Observer,
name: &'static str,
lumconst: f64,
spectral_locus_range: RangeInclusive<usize>,
data: SMatrix<f64, 3, NS>,
) -> Self {
Self {
data,
lumconst,
tag,
name,
d65: OnceLock::new(),
d50: OnceLock::new(),
spectral_locus_range,
spectral_locus: OnceLock::new(),
}
}
}