From 34812c33dbfdac33093c84b3edf5076838cbf2a6 Mon Sep 17 00:00:00 2001 From: Filip Mikina Date: Fri, 24 Oct 2025 21:18:39 +0200 Subject: hyprctl: include color management presets and sdr information (#12019) * move string parsing for eCMType to its own namespace, similar to how `src/protocols/types/ContentType.cpp` is done * expose cm type and sdr settings in `hyprctl monitors`, format floats to .2f --- src/helpers/Monitor.hpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/helpers/Monitor.hpp') diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp index d112f747..687fc049 100644 --- a/src/helpers/Monitor.hpp +++ b/src/helpers/Monitor.hpp @@ -8,6 +8,7 @@ #include "WLClasses.hpp" #include #include "AnimatedVariable.hpp" +#include "CMType.hpp" #include #include "time/Timer.hpp" @@ -35,18 +36,6 @@ enum eAutoDirs : uint8_t { DIR_AUTO_CENTER_RIGHT }; -enum eCMType : uint8_t { - CM_AUTO = 0, // subject to change. srgb for 8bpc, wide for 10bpc if supported - CM_SRGB, // default, sRGB primaries - CM_WIDE, // wide color gamut, BT2020 primaries - 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 { eAutoDirs autoDir = DIR_AUTO_NONE; std::string name = ""; @@ -58,7 +47,7 @@ struct SMonitorRule { wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; std::string mirrorOf = ""; bool enable10bit = false; - eCMType cmType = CM_SRGB; + NCMType::eCMType cmType = NCMType::CM_SRGB; float sdrSaturation = 1.0f; // SDR -> HDR float sdrBrightness = 1.0f; // SDR -> HDR @@ -141,7 +130,7 @@ class CMonitor { bool m_dpmsStatus = true; bool m_vrrActive = false; // this can be TRUE even if VRR is not active in the case that this display does not support it. bool m_enabled10bit = false; // as above, this can be TRUE even if 10 bit failed. - eCMType m_cmType = CM_SRGB; + NCMType::eCMType m_cmType = NCMType::CM_SRGB; float m_sdrSaturation = 1.0f; float m_sdrBrightness = 1.0f; float m_sdrMinLuminance = 0.2f; @@ -283,7 +272,7 @@ class CMonitor { // methods void onConnect(bool noRule); void onDisconnect(bool destroy = false); - void applyCMType(eCMType cmType); + void applyCMType(NCMType::eCMType cmType); bool applyMonitorRule(SMonitorRule* pMonitorRule, bool force = false); void addDamage(const pixman_region32_t* rg); void addDamage(const CRegion& rg); -- cgit v1.2.3