renderer/cm: add more monitor cm options (#11861)

Adds more cm options for monitors: DCIP3, Apple P3, Adobe
This commit is contained in:
UjinT34 2025-09-29 15:22:42 +03:00 committed by GitHub
parent 4d82cc5957
commit 0959672591
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 0 deletions

View file

@ -2263,6 +2263,12 @@ bool CMonitorRuleParser::parseCM(const std::string& value) {
m_rule.cmType = CM_HDR;
else if (value == "hdredid")
m_rule.cmType = CM_HDR_EDID;
else if (value == "dcip3")
m_rule.cmType = CM_DCIP3;
else if (value == "dp3")
m_rule.cmType = CM_DP3;
else if (value == "adobe")
m_rule.cmType = CM_ADOBE;
else {
m_error += "invalid cm ";
return false;

View file

@ -474,6 +474,21 @@ void CMonitor::applyCMType(eCMType cmType) {
.primariesNamed = NColorManagement::CM_PRIMARIES_BT2020,
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_BT2020)};
break;
case CM_DCIP3:
m_imageDescription = {.primariesNameSet = true,
.primariesNamed = NColorManagement::CM_PRIMARIES_DCI_P3,
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_DCI_P3)};
break;
case CM_DP3:
m_imageDescription = {.primariesNameSet = true,
.primariesNamed = NColorManagement::CM_PRIMARIES_DISPLAY_P3,
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_DISPLAY_P3)};
break;
case CM_ADOBE:
m_imageDescription = {.primariesNameSet = true,
.primariesNamed = NColorManagement::CM_PRIMARIES_ADOBE_RGB,
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_ADOBE_RGB)};
break;
case CM_EDID:
m_imageDescription = {.primariesNameSet = false,
.primariesNamed = NColorManagement::CM_PRIMARIES_BT2020,

View file

@ -42,6 +42,9 @@ enum eCMType : uint8_t {
CM_EDID, // primaries from edid (known to be inaccurate)
CM_HDR, // wide color gamut and HDR PQ transfer function
CM_HDR_EDID, // same as CM_HDR with edid primaries
CM_DCIP3, // movie theatre with greenish white point
CM_DP3, // applle P3 variant with blueish white point
CM_ADOBE, // adobe colorspace
};
struct SMonitorRule {