1
0
Fork 0
forked from wry/wry

color-management: use more consistent naming

This commit is contained in:
Julian Orth 2025-09-05 13:45:09 +02:00
parent 32db933242
commit 83e79b68e6
65 changed files with 439 additions and 510 deletions

View file

@ -33,7 +33,7 @@ use {
logging::LogLevel,
status::MessageFormat,
theme::Color,
video::{ColorSpace, Format, GfxApi, TearingMode, TransferFunction, Transform, VrrMode},
video::{ColorSpace, Eotf, Format, GfxApi, TearingMode, Transform, VrrMode},
window::{ContentType, TileState, WindowType},
workspace::WorkspaceDisplayOrder,
xwayland::XScalingMode,
@ -347,7 +347,7 @@ pub struct Output {
pub tearing: Option<Tearing>,
pub format: Option<Format>,
pub color_space: Option<ColorSpace>,
pub transfer_function: Option<TransferFunction>,
pub eotf: Option<Eotf>,
pub brightness: Option<Option<f64>>,
}

View file

@ -19,7 +19,7 @@ use {
},
},
indexmap::IndexMap,
jay_config::video::{ColorSpace, TransferFunction, Transform},
jay_config::video::{ColorSpace, Eotf, Transform},
thiserror::Error,
};
@ -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, transfer_function, brightness_val),
(color_space, eotf, brightness_val),
) = ext.extract((
(
opt(str("name")),
@ -103,17 +103,13 @@ impl Parser for OutputParser<'_> {
}
},
};
let transfer_function = match transfer_function {
let eotf = match eotf {
None => None,
Some(tf) => match tf.value {
"default" => Some(TransferFunction::DEFAULT),
"pq" => Some(TransferFunction::PQ),
"default" => Some(Eotf::DEFAULT),
"pq" => Some(Eotf::PQ),
_ => {
log::warn!(
"Unknown transfer function {}: {}",
tf.value,
self.cx.error3(tf.span)
);
log::warn!("Unknown EOTF {}: {}", tf.value, self.cx.error3(tf.span));
None
}
},
@ -193,7 +189,7 @@ impl Parser for OutputParser<'_> {
tearing,
format,
color_space,
transfer_function,
eotf,
brightness,
})
}

View file

@ -44,7 +44,7 @@ use {
theme::{reset_colors, reset_font, reset_sizes, set_font},
toggle_float_above_fullscreen, toggle_show_bar,
video::{
ColorSpace, Connector, DrmDevice, TransferFunction, connectors, drm_devices,
ColorSpace, Connector, DrmDevice, Eotf, connectors, drm_devices,
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
on_new_connector, on_new_drm_device, set_direct_scanout_enabled, set_gfx_api,
set_tearing_mode, set_vrr_cursor_hz, set_vrr_mode,
@ -769,9 +769,9 @@ impl Output {
if let Some(format) = self.format {
c.set_format(format);
}
if self.color_space.is_some() || self.transfer_function.is_some() {
if self.color_space.is_some() || self.eotf.is_some() {
let cs = self.color_space.unwrap_or(ColorSpace::DEFAULT);
let tf = self.transfer_function.unwrap_or(TransferFunction::DEFAULT);
let tf = self.eotf.unwrap_or(Eotf::DEFAULT);
c.set_colors(cs, tf);
}
if let Some(brightness) = self.brightness {