diff --git a/src/cmm/cmm_render_intent.rs b/src/cmm/cmm_render_intent.rs index b187e83f..fd5cbc35 100644 --- a/src/cmm/cmm_render_intent.rs +++ b/src/cmm/cmm_render_intent.rs @@ -1,15 +1,20 @@ -use crate::{ifs::color_management::RENDER_INTENT_PERCEPTUAL, object::Version}; +use crate::{ + ifs::color_management::{RENDER_INTENT_PERCEPTUAL, RENDER_INTENT_RELATIVE_BPC}, + object::Version, +}; #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Default)] pub enum RenderIntent { #[default] Perceptual, + RelativeBpc, } impl RenderIntent { pub fn from_wayland(intent: u32, _version: Version) -> Option { let res = match intent { RENDER_INTENT_PERCEPTUAL => Self::Perceptual, + RENDER_INTENT_RELATIVE_BPC => Self::RelativeBpc, _ => return None, }; Some(res) @@ -18,12 +23,14 @@ impl RenderIntent { pub fn black_point_compensation(self) -> bool { match self { RenderIntent::Perceptual => true, + RenderIntent::RelativeBpc => true, } } pub fn bradford_adjustment(self) -> bool { match self { RenderIntent::Perceptual => true, + RenderIntent::RelativeBpc => true, } } } diff --git a/src/ifs/color_management/wp_color_manager_v1.rs b/src/ifs/color_management/wp_color_manager_v1.rs index 9610e5ac..44c4480e 100644 --- a/src/ifs/color_management/wp_color_manager_v1.rs +++ b/src/ifs/color_management/wp_color_manager_v1.rs @@ -6,7 +6,8 @@ use { color_management::{ COMPOUND_POWER_2_4_SINCE, FEATURE_EXTENDED_TARGET_VOLUME, FEATURE_SET_MASTERING_DISPLAY_PRIMARIES, FEATURE_SET_TF_POWER, - SRGB_DEPRECATED_SINCE, TRANSFER_FUNCTION_COMPOUND_POWER_2_4, + RENDER_INTENT_RELATIVE_BPC, SRGB_DEPRECATED_SINCE, + TRANSFER_FUNCTION_COMPOUND_POWER_2_4, consts::{ FEATURE_PARAMETRIC, FEATURE_SET_LUMINANCES, FEATURE_SET_PRIMARIES, FEATURE_WINDOWS_SCRGB, PRIMARIES_ADOBE_RGB, PRIMARIES_BT2020, @@ -77,6 +78,7 @@ pub struct WpColorManagerV1 { impl WpColorManagerV1 { fn send_capabilities(&self) { self.send_supported_intent(RENDER_INTENT_PERCEPTUAL); + self.send_supported_intent(RENDER_INTENT_RELATIVE_BPC); self.send_supported_feature(FEATURE_PARAMETRIC); self.send_supported_feature(FEATURE_SET_PRIMARIES); self.send_supported_feature(FEATURE_SET_LUMINANCES);