1
0
Fork 0
forked from wry/wry

color-management-v1: implement target color volume

This commit is contained in:
Julian Orth 2025-03-11 11:41:42 +01:00
parent 5ad5c5cbcf
commit 04f280aabe
10 changed files with 249 additions and 64 deletions

View file

@ -10,6 +10,12 @@ pub struct Luminance {
pub white: F64,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct TargetLuminance {
pub min: F64,
pub max: F64,
}
impl Luminance {
pub const SRGB: Self = Self {
min: F64(0.2),
@ -46,6 +52,15 @@ impl Luminance {
};
}
impl Luminance {
pub fn to_target(&self) -> TargetLuminance {
TargetLuminance {
min: self.min,
max: self.max,
}
}
}
impl Default for Luminance {
fn default() -> Self {
Self::SRGB