summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-08-22 13:13:55 +0300
committerGitHub <noreply@github.com>2025-08-22 11:13:55 +0100
commit4e8875b5e9700c81ca4e169dc7b85bb5b3c8cb7a (patch)
treebc3f021c02b7f9c0c452332627421f64ed7a2394 /src/helpers/Monitor.cpp
parentfdf1612f0f0c3a1ffc221a0d9d589a9b4a2af982 (diff)
hdr: scRGB, HLG and SDR -> HDR fixes (#11499)
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 10897cad..c24ad103 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -42,6 +42,7 @@ using namespace Hyprutils::String;
using namespace Hyprutils::Utils;
using namespace Hyprutils::OS;
using enum NContentType::eContentType;
+using namespace NColorManagement;
CMonitor::CMonitor(SP<Aquamarine::IOutput> output_) : m_state(this), m_output(output_) {
g_pAnimationManager->createAnimation(0.f, m_specialFade, g_pConfigManager->getAnimationPropertyConfig("specialWorkspaceIn"), AVARDAMAGE_NONE);
@@ -1686,6 +1687,18 @@ int CMonitor::maxAvgLuminance(int defaultValue) {
(m_output->parsedEDID.hdrMetadata.has_value() ? m_output->parsedEDID.hdrMetadata->desiredMaxFrameAverageLuminance : defaultValue);
}
+bool CMonitor::wantsWideColor() {
+ return supportsWideColor() && (wantsHDR() || m_imageDescription.primariesNamed == CM_PRIMARIES_BT2020);
+}
+
+bool CMonitor::wantsHDR() {
+ return supportsHDR() && inHDR();
+}
+
+bool CMonitor::inHDR() {
+ return m_output->state->state().hdrMetadata.hdmi_metadata_type1.eotf == 2;
+}
+
CMonitorState::CMonitorState(CMonitor* owner) : m_owner(owner) {
;
}