From 8c97cb7858e5d6c35d1a055930904346fb4248db Mon Sep 17 00:00:00 2001 From: UjinT34 <41110182+UjinT34@users.noreply.github.com> Date: Fri, 14 Mar 2025 02:15:18 +0300 Subject: renderer: add simple color management (#9506) Adds proper color management and transformations for CM surfaces. --- src/config/ConfigManager.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2bd793e5..eda5c733 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -692,12 +692,11 @@ CConfigManager::CConfigManager() { registerConfigVar("render:xp_mode", Hyprlang::INT{0}); registerConfigVar("render:ctm_animation", Hyprlang::INT{2}); registerConfigVar("render:allow_early_buffer_release", Hyprlang::INT{1}); + registerConfigVar("render:cm_fs_passthrough", Hyprlang::INT{1}); registerConfigVar("ecosystem:no_update_news", Hyprlang::INT{0}); registerConfigVar("ecosystem:no_donation_nag", Hyprlang::INT{0}); - registerConfigVar("experimental:wide_color_gamut", Hyprlang::INT{0}); - registerConfigVar("experimental:hdr", Hyprlang::INT{0}); registerConfigVar("experimental:xx_color_management_v4", Hyprlang::INT{0}); // devices @@ -2042,6 +2041,32 @@ std::optional CConfigManager::handleMonitor(const std::string& comm } else if (ARGS[argno] == "bitdepth") { newrule.enable10bit = ARGS[argno + 1] == "10"; argno++; + } else if (ARGS[argno] == "cm") { + if (ARGS[argno + 1] == "auto") + newrule.cmType = CM_AUTO; + else if (ARGS[argno + 1] == "srgb") + newrule.cmType = CM_SRGB; + else if (ARGS[argno + 1] == "wide") + newrule.cmType = CM_WIDE; + else if (ARGS[argno + 1] == "edid") + newrule.cmType = CM_EDID; + else if (ARGS[argno + 1] == "hdr") + newrule.cmType = CM_HDR; + else if (ARGS[argno + 1] == "hdredid") + newrule.cmType = CM_HDR_EDID; + else + error = "invalid cm "; + argno++; + } else if (ARGS[argno] == "sdrsaturation") { + try { + newrule.sdrSaturation = stof(ARGS[argno + 1]); + } catch (...) { error = "invalid sdrsaturation "; } + argno++; + } else if (ARGS[argno] == "sdrbrightness") { + try { + newrule.sdrBrightness = stof(ARGS[argno + 1]); + } catch (...) { error = "invalid sdrbrightness "; } + argno++; } else if (ARGS[argno] == "transform") { if (!isNumber(ARGS[argno + 1])) { error = "invalid transform "; -- cgit v1.2.3