summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 5805eff9..3d159042 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -31,6 +31,7 @@
#include "protocols/XDGShell.hpp"
#include "protocols/XDGOutput.hpp"
#include "protocols/SecurityContext.hpp"
+#include "protocols/ColorManagement.hpp"
#include "protocols/core/Compositor.hpp"
#include "protocols/core/Subcompositor.hpp"
#include "desktop/LayerSurface.hpp"
@@ -2985,4 +2986,22 @@ void CCompositor::onNewMonitor(SP<Aquamarine::IOutput> output) {
g_pHyprRenderer->damageMonitor(PNEWMONITOR);
PNEWMONITOR->onMonitorFrame();
+
+ if (PROTO::colorManagement && shouldChangePreferredImageDescription())
+ PROTO::colorManagement->onImagePreferredChanged();
+}
+
+SImageDescription CCompositor::getPreferredImageDescription() {
+ if (!PROTO::colorManagement) {
+ Debug::log(ERR, "FIXME: color management protocol is not enabled, returning empty image description");
+ return SImageDescription{};
+ }
+ Debug::log(WARN, "FIXME: color management protocol is enabled, determine correct preferred image description");
+ // should determine some common settings to avoid unnecessary transformations while keeping maximum displayable precision
+ return SImageDescription{.primaries = NColorPrimaries::BT709};
+}
+
+bool CCompositor::shouldChangePreferredImageDescription() {
+ Debug::log(WARN, "FIXME: color management protocol is enabled and outputs changed, check preferred image description changes");
+ return false;
}