color-management-v1: implement target color volume
This commit is contained in:
parent
5ad5c5cbcf
commit
04f280aabe
10 changed files with 249 additions and 64 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue