hdr: scRGB, HLG and SDR -> HDR fixes (#11499)

This commit is contained in:
UjinT34 2025-08-22 13:13:55 +03:00 committed by GitHub
parent fdf1612f0f
commit 4e8875b5e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 67 additions and 38 deletions

View file

@ -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) {
;
}