Skip to content

Commit 0959672

Browse files
authored
renderer/cm: add more monitor cm options (#11861)
Adds more cm options for monitors: DCIP3, Apple P3, Adobe
1 parent 4d82cc5 commit 0959672

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/config/ConfigManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,12 @@ bool CMonitorRuleParser::parseCM(const std::string& value) {
22632263
m_rule.cmType = CM_HDR;
22642264
else if (value == "hdredid")
22652265
m_rule.cmType = CM_HDR_EDID;
2266+
else if (value == "dcip3")
2267+
m_rule.cmType = CM_DCIP3;
2268+
else if (value == "dp3")
2269+
m_rule.cmType = CM_DP3;
2270+
else if (value == "adobe")
2271+
m_rule.cmType = CM_ADOBE;
22662272
else {
22672273
m_error += "invalid cm ";
22682274
return false;

src/helpers/Monitor.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,21 @@ void CMonitor::applyCMType(eCMType cmType) {
474474
.primariesNamed = NColorManagement::CM_PRIMARIES_BT2020,
475475
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_BT2020)};
476476
break;
477+
case CM_DCIP3:
478+
m_imageDescription = {.primariesNameSet = true,
479+
.primariesNamed = NColorManagement::CM_PRIMARIES_DCI_P3,
480+
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_DCI_P3)};
481+
break;
482+
case CM_DP3:
483+
m_imageDescription = {.primariesNameSet = true,
484+
.primariesNamed = NColorManagement::CM_PRIMARIES_DISPLAY_P3,
485+
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_DISPLAY_P3)};
486+
break;
487+
case CM_ADOBE:
488+
m_imageDescription = {.primariesNameSet = true,
489+
.primariesNamed = NColorManagement::CM_PRIMARIES_ADOBE_RGB,
490+
.primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_ADOBE_RGB)};
491+
break;
477492
case CM_EDID:
478493
m_imageDescription = {.primariesNameSet = false,
479494
.primariesNamed = NColorManagement::CM_PRIMARIES_BT2020,

src/helpers/Monitor.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ enum eCMType : uint8_t {
4242
CM_EDID, // primaries from edid (known to be inaccurate)
4343
CM_HDR, // wide color gamut and HDR PQ transfer function
4444
CM_HDR_EDID, // same as CM_HDR with edid primaries
45+
CM_DCIP3, // movie theatre with greenish white point
46+
CM_DP3, // applle P3 variant with blueish white point
47+
CM_ADOBE, // adobe colorspace
4548
};
4649

4750
struct SMonitorRule {

0 commit comments

Comments
 (0)