pub mod emit;
pub mod golden;
pub mod lut;
pub mod matrix;
pub mod oklab;
pub mod srgb;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BakeError {
SingularMatrix,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Xy {
pub x: f64,
pub y: f64,
}
impl Xy {
#[must_use]
pub const fn new(x: f64, y: f64) -> Self {
Self { x, y }
}
#[must_use]
pub fn from_millionths(x_millionths: u32, y_millionths: u32) -> Self {
Self {
x: f64::from(x_millionths) / 1_000_000.0,
y: f64::from(y_millionths) / 1_000_000.0,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Primaries {
pub r: Xy,
pub g: Xy,
pub b: Xy,
pub white: Xy,
}
impl Primaries {
#[must_use]
pub fn srgb() -> Self {
Self {
r: Xy::new(0.64, 0.33),
g: Xy::new(0.30, 0.60),
b: Xy::new(0.15, 0.06),
white: Xy::new(0.3127, 0.3290),
}
}
}