#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Backdrop {
AsLit,
#[default]
Grey,
White,
}
impl Backdrop {
#[must_use]
pub const fn level(self) -> f32 {
match self {
Self::AsLit => 0.0,
Self::Grey => crate::optics::raytracer::BACKDROP_GREY,
Self::White => crate::optics::raytracer::BACKDROP_WHITE,
}
}
#[must_use]
pub const fn index(self) -> i32 {
match self {
Self::AsLit => 0,
Self::Grey => 1,
Self::White => 2,
}
}
#[must_use]
pub const fn from_index(index: i32) -> Self {
match index {
0 => Self::AsLit,
2 => Self::White,
_ => Self::Grey,
}
}
}