mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-08 10:18:05 +02:00
default to gamma22
This commit is contained in:
parent
a7e0afe9de
commit
a6c4f7a095
6 changed files with 8 additions and 7 deletions
|
|
@ -1562,10 +1562,10 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||
},
|
||||
SConfigOptionDescription{
|
||||
.value = "render:cm_sdr_eotf",
|
||||
.description = "Default transfer function for displaying SDR apps. 0 - Treat unspecified as sRGB, 1 - Treat unspecified as Gamma 2.2, 2 - Treat "
|
||||
"unspecified and sRGB as Gamma 2.2",
|
||||
.description = "Default transfer function for displaying SDR apps. 0 - Use default value (Gamma 2.2), 1 - Treat unspecified as Gamma 2.2, 2 - Treat "
|
||||
"unspecified and sRGB as Gamma 2.2, 3 - Treat unspecified as sRGB",
|
||||
.type = CONFIG_OPTION_CHOICE,
|
||||
.data = SConfigOptionDescription::SChoiceData{0, "srgb,gamma22,gamma22force"},
|
||||
.data = SConfigOptionDescription::SChoiceData{0, "default,gamma22,gamma22force,srgb"},
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
|||
void CMonitor::applyCMType(NCMType::eCMType cmType, int cmSdrEotf) {
|
||||
auto oldImageDescription = m_imageDescription;
|
||||
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
|
||||
auto chosenSdrEotf = cmSdrEotf == 0 ? (*PSDREOTF > 0 ? NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22 : NColorManagement::CM_TRANSFER_FUNCTION_SRGB) :
|
||||
auto chosenSdrEotf = cmSdrEotf == 0 ? (*PSDREOTF != 3 ? NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22 : NColorManagement::CM_TRANSFER_FUNCTION_SRGB) :
|
||||
(cmSdrEotf == 1 ? NColorManagement::CM_TRANSFER_FUNCTION_SRGB : NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22);
|
||||
|
||||
switch (cmType) {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ namespace NColorManagement {
|
|||
|
||||
bool windowsScRGB = false;
|
||||
|
||||
eTransferFunction transferFunction = CM_TRANSFER_FUNCTION_SRGB;
|
||||
eTransferFunction transferFunction = CM_TRANSFER_FUNCTION_GAMMA22;
|
||||
float transferFunctionPower = 1.0f;
|
||||
|
||||
bool primariesNameSet = false;
|
||||
|
|
|
|||
|
|
@ -1717,7 +1717,7 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c
|
|||
shader->setUniformInt(SHADER_TEX_TYPE, texType);
|
||||
if (data.cmBackToSRGB) {
|
||||
static auto PSDREOTF = CConfigValue<Hyprlang::INT>("render:cm_sdr_eotf");
|
||||
auto chosenSdrEotf = *PSDREOTF > 0 ? NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22 : NColorManagement::CM_TRANSFER_FUNCTION_SRGB;
|
||||
auto chosenSdrEotf = *PSDREOTF != 3 ? NColorManagement::CM_TRANSFER_FUNCTION_GAMMA22 : NColorManagement::CM_TRANSFER_FUNCTION_SRGB;
|
||||
passCMUniforms(*shader, imageDescription, NColorManagement::SImageDescription{.transferFunction = chosenSdrEotf}, true, -1, -1);
|
||||
} else
|
||||
passCMUniforms(*shader, imageDescription);
|
||||
|
|
|
|||
|
|
@ -1515,6 +1515,7 @@ static const hdr_output_metadata NO_HDR_METADATA = {.hdmi_metadata_type1 = hdr_m
|
|||
static hdr_output_metadata createHDRMetadata(SImageDescription settings, SP<CMonitor> monitor) {
|
||||
uint8_t eotf = 0;
|
||||
switch (settings.transferFunction) {
|
||||
case CM_TRANSFER_FUNCTION_GAMMA22:
|
||||
case CM_TRANSFER_FUNCTION_SRGB: eotf = 0; break; // used to send primaries and luminances to AQ. ignored for now
|
||||
case CM_TRANSFER_FUNCTION_ST2084_PQ: eotf = 2; break;
|
||||
case CM_TRANSFER_FUNCTION_EXT_LINEAR:
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ vec4 okLabAToSrgb(vec4 lab) {
|
|||
l * 4.0767416621 + m * -3.3077115913 + s * 0.2309699292,
|
||||
l * (-1.2684380046) + m * 2.6097574011 + s * (-0.3413193965),
|
||||
l * (-0.0041960863) + m * (-0.7034186147) + s * 1.7076147010
|
||||
), CM_TRANSFER_FUNCTION_SRGB
|
||||
), CM_TRANSFER_FUNCTION_GAMMA22
|
||||
), lab[3]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue