1
0
Fork 0
forked from wry/wry

cmm: enable using the display primaries in SDR mode

This commit is contained in:
Julian Orth 2025-12-04 17:08:05 +01:00
parent 2b7b3b5310
commit 67760e270e
19 changed files with 259 additions and 21 deletions

View file

@ -1124,6 +1124,13 @@ impl ConfigClient {
});
}
pub fn connector_set_use_native_gamut(&self, connector: Connector, use_native_gamut: bool) {
self.send(&ClientMessage::ConnectorSetUseNativeGamut {
connector,
use_native_gamut,
});
}
pub fn connector_get_scale(&self, connector: Connector) -> f64 {
let res = self.send_with_response(&ClientMessage::ConnectorGetScale { connector });
get_response!(res, 1.0, ConnectorGetScale { scale });

View file

@ -816,6 +816,10 @@ pub enum ClientMessage<'a> {
position: BarPosition,
},
GetBarPosition,
ConnectorSetUseNativeGamut {
connector: Connector,
use_native_gamut: bool,
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -338,6 +338,26 @@ impl Connector {
pub fn connector_in_direction(self, direction: Direction) -> Connector {
get!(Connector(0)).get_connector_in_direction(self, direction)
}
/// Configures whether the display primaries are used.
///
/// By default, Jay pretends that the display uses sRGB primaries. This is also how
/// most other systems behave. In reality, most displays use a much larger gamut. For
/// example, they advertise that they support 95% of the DCI-P3 gamut. If the display
/// is interpreting colors in their native gamut, then colors will appear more
/// saturated than their specification.
///
/// If this is set to `true`, Jay assumes that the display uses the primaries
/// advertised in its EDID. This might produce more accurate colors while also
/// allowing color-managed applications to use the full gamut of the display.
///
/// This setting has no effect when the display is explicitly operating in a wide
/// color space.
///
/// The default is `false`.
pub fn set_use_native_gamut(self, use_native_gamut: bool) {
get!().connector_set_use_native_gamut(self, use_native_gamut);
}
}
/// Returns all available DRM devices.