cmm: enable using the display primaries in SDR mode
This commit is contained in:
parent
2b7b3b5310
commit
67760e270e
19 changed files with 259 additions and 21 deletions
|
|
@ -366,6 +366,7 @@ pub struct Output {
|
|||
pub eotf: Option<Eotf>,
|
||||
pub brightness: Option<Option<f64>>,
|
||||
pub blend_space: Option<BlendSpace>,
|
||||
pub use_native_gamut: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use {
|
|||
config::{
|
||||
Output,
|
||||
context::Context,
|
||||
extractor::{Extractor, ExtractorError, fltorint, opt, recover, s32, str, val},
|
||||
extractor::{Extractor, ExtractorError, bol, fltorint, opt, recover, s32, str, val},
|
||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||
parsers::{
|
||||
format::FormatParser,
|
||||
|
|
@ -51,7 +51,7 @@ impl Parser for OutputParser<'_> {
|
|||
let mut ext = Extractor::new(self.cx, span, table);
|
||||
let (
|
||||
(name, match_val, x, y, scale, transform, mode, vrr_val, tearing_val, format_val),
|
||||
(color_space, eotf, brightness_val, blend_space),
|
||||
(color_space, eotf, brightness_val, blend_space, use_native_gamut),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(str("name")),
|
||||
|
|
@ -70,6 +70,7 @@ impl Parser for OutputParser<'_> {
|
|||
recover(opt(str("transfer-function"))),
|
||||
opt(val("brightness")),
|
||||
recover(opt(str("blend-space"))),
|
||||
recover(opt(bol("use-native-gamut"))),
|
||||
),
|
||||
))?;
|
||||
let transform = match transform {
|
||||
|
|
@ -208,6 +209,7 @@ impl Parser for OutputParser<'_> {
|
|||
eotf,
|
||||
brightness,
|
||||
blend_space,
|
||||
use_native_gamut: use_native_gamut.despan(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -862,6 +862,9 @@ impl Output {
|
|||
if let Some(bs) = self.blend_space {
|
||||
c.set_blend_space(bs);
|
||||
}
|
||||
if let Some(use_native_gamut) = self.use_native_gamut {
|
||||
c.set_use_native_gamut(use_native_gamut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue