diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-03-04 19:50:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-04 19:50:28 +0000 |
| commit | 10754745a97c99449ef40db58bd425f5a91f9993 (patch) | |
| tree | 8aa9f57bcfb2157b9fbdc387c9021db6e6a38e46 /src/config/ConfigManager.cpp | |
| parent | 8271cfc97b76d573f9122032d6cf5db256d63470 (diff) | |
render/cm: add ICC profile pipeline (#12711)
Adds an ICC profile pipeline, loading via config and applying via 3D LUTs.
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index cb38154e..e62130a4 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -797,6 +797,7 @@ CConfigManager::CConfigManager() { registerConfigVar("render:non_shader_cm", Hyprlang::INT{3}); registerConfigVar("render:cm_sdr_eotf", {"default"}); registerConfigVar("render:commit_timing_enabled", Hyprlang::INT{1}); + registerConfigVar("render:icc_vcgt_enabled", Hyprlang::INT{1}); registerConfigVar("ecosystem:no_update_news", Hyprlang::INT{0}); registerConfigVar("ecosystem:no_donation_nag", Hyprlang::INT{0}); @@ -871,6 +872,7 @@ CConfigManager::CConfigManager() { m_config->addSpecialConfigValue("monitorv2", "min_luminance", Hyprlang::FLOAT{-1.0}); m_config->addSpecialConfigValue("monitorv2", "max_luminance", Hyprlang::INT{-1}); m_config->addSpecialConfigValue("monitorv2", "max_avg_luminance", Hyprlang::INT{-1}); + m_config->addSpecialConfigValue("monitorv2", "icc", Hyprlang::STRING{""}); // windowrule v3 m_config->addSpecialCategory("windowrule", {.key = "name"}); @@ -1257,6 +1259,10 @@ std::optional<std::string> CConfigManager::handleMonitorv2(const std::string& ou if (VAL && VAL->m_bSetByUser) parser.rule().maxAvgLuminance = std::any_cast<Hyprlang::INT>(VAL->getValue()); + VAL = m_config->getSpecialConfigValuePtr("monitorv2", "icc", output.c_str()); + if (VAL && VAL->m_bSetByUser) + parser.rule().iccFile = std::any_cast<Hyprlang::STRING>(VAL->getValue()); + auto newrule = parser.rule(); std::erase_if(m_monitorRules, [&](const auto& other) { return other.name == newrule.name; }); @@ -2275,6 +2281,15 @@ bool CMonitorRuleParser::parseVRR(const std::string& value) { return true; } +bool CMonitorRuleParser::parseICC(const std::string& val) { + if (val.empty()) { + m_error += "invalid icc "; + return false; + } + m_rule.iccFile = val; + return true; +} + void CMonitorRuleParser::setDisabled() { m_rule.disabled = true; } @@ -2369,6 +2384,9 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm } else if (ARGS[argno] == "vrr") { parser.parseVRR(std::string(ARGS[argno + 1])); argno++; + } else if (ARGS[argno] == "icc") { + parser.parseICC(std::string(ARGS[argno + 1])); + argno++; } else if (ARGS[argno] == "workspace") { const auto& [id, name, isAutoID] = getWorkspaceIDNameFromString(std::string(ARGS[argno + 1])); |
