renderer: add simple color management (#9506)
Adds proper color management and transformations for CM surfaces.
This commit is contained in:
parent
e86d3a14e4
commit
8c97cb7858
14 changed files with 823 additions and 179 deletions
|
|
@ -1378,6 +1378,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||
.type = CONFIG_OPTION_BOOL,
|
||||
.data = SConfigOptionDescription::SBoolData{true},
|
||||
},
|
||||
SConfigOptionDescription{
|
||||
.value = "render:cm_fs_passthrough",
|
||||
.description = "Passthrough color settings for fullscreen apps when possible",
|
||||
.type = CONFIG_OPTION_BOOL,
|
||||
.data = SConfigOptionDescription::SBoolData{true},
|
||||
},
|
||||
|
||||
/*
|
||||
* cursor:
|
||||
|
|
@ -1764,18 +1770,6 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||
.type = CONFIG_OPTION_BOOL,
|
||||
.data = SConfigOptionDescription::SBoolData{true},
|
||||
},
|
||||
SConfigOptionDescription{
|
||||
.value = "experimental:wide_color_gamut",
|
||||
.description = "force wide color gamut for all supported outputs",
|
||||
.type = CONFIG_OPTION_BOOL,
|
||||
.data = SConfigOptionDescription::SBoolData{false},
|
||||
},
|
||||
SConfigOptionDescription{
|
||||
.value = "experimental:hdr",
|
||||
.description = "force static hdr for all supported outputs",
|
||||
.type = CONFIG_OPTION_BOOL,
|
||||
.data = SConfigOptionDescription::SBoolData{false},
|
||||
},
|
||||
SConfigOptionDescription{
|
||||
.value = "experimental:xx_color_management_v4",
|
||||
.description = "enable color management protocol",
|
||||
|
|
|
|||
|
|
@ -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<std::string> 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 ";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue