diff options
Diffstat (limited to 'src/render/Renderer.cpp')
| -rw-r--r-- | src/render/Renderer.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index ad0ebeac..1c9dde53 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2220,8 +2220,8 @@ SCMSettings IHyprRenderer::getCMSettings(const NColorManagement::PImageDescripti const bool needsSDRmod = modifySDR && isSDR2HDR(imageDescription->value(), targetImageDescription->value()); const bool needsHDRmod = !needsSDRmod && isHDR2SDR(imageDescription->value(), targetImageDescription->value()); const float maxLuminance = needsHDRmod ? - imageDescription->value().getTFMaxLuminance(-1) : - (imageDescription->value().luminances.max > 0 ? imageDescription->value().luminances.max : imageDescription->value().luminances.reference); + imageDescription->value().getTFMaxLuminance(-1) : + (imageDescription->value().luminances.max > 0 ? imageDescription->value().luminances.max : imageDescription->value().luminances.reference); const auto dstMaxLuminance = targetImageDescription->value().luminances.max > 0 ? targetImageDescription->value().luminances.max : 10000; auto matrix = imageDescription->getPrimaries()->convertMatrix(targetImageDescription->getPrimaries()); @@ -2556,30 +2556,30 @@ static hdr_output_metadata createHDRMetadata(SImageDescription settings, S auto colorimetry = settings.getPrimaries(); auto luminances = settings.masteringLuminances.max > 0 ? settings.masteringLuminances : - (settings.luminances != SImageDescription::SPCLuminances{} ? - SImageDescription::SPCMasteringLuminances{.min = settings.luminances.min, .max = settings.luminances.max} : - SImageDescription::SPCMasteringLuminances{.min = monitor->minLuminance(), .max = monitor->maxLuminance(10000)}); + (settings.luminances != SImageDescription::SPCLuminances{} ? + SImageDescription::SPCMasteringLuminances{.min = settings.luminances.min, .max = settings.luminances.max} : + SImageDescription::SPCMasteringLuminances{.min = monitor->minLuminance(), .max = monitor->maxLuminance(10000)}); Log::logger->log(Log::TRACE, "ColorManagement primaries {},{} {},{} {},{} {},{}", colorimetry.red.x, colorimetry.red.y, colorimetry.green.x, colorimetry.green.y, - colorimetry.blue.x, colorimetry.blue.y, colorimetry.white.x, colorimetry.white.y); + colorimetry.blue.x, colorimetry.blue.y, colorimetry.white.x, colorimetry.white.y); Log::logger->log(Log::TRACE, "ColorManagement min {}, max {}, cll {}, fall {}", luminances.min, luminances.max, settings.maxCLL, settings.maxFALL); return hdr_output_metadata{ - .metadata_type = 0, - .hdmi_metadata_type1 = + .metadata_type = 0, + .hdmi_metadata_type1 = hdr_metadata_infoframe{ - .eotf = eotf, - .metadata_type = 0, - .display_primaries = - { + .eotf = eotf, + .metadata_type = 0, + .display_primaries = + { {.x = to16Bit(colorimetry.red.x), .y = to16Bit(colorimetry.red.y)}, {.x = to16Bit(colorimetry.green.x), .y = to16Bit(colorimetry.green.y)}, {.x = to16Bit(colorimetry.blue.x), .y = to16Bit(colorimetry.blue.y)}, }, - .white_point = {.x = to16Bit(colorimetry.white.x), .y = to16Bit(colorimetry.white.y)}, - .max_display_mastering_luminance = toNits(luminances.max), - .min_display_mastering_luminance = toNits(luminances.min * 10000), - .max_cll = toNits(settings.maxCLL > 0 ? settings.maxCLL : monitor->maxCLL()), - .max_fall = toNits(settings.maxFALL > 0 ? settings.maxFALL : monitor->maxFALL()), + .white_point = {.x = to16Bit(colorimetry.white.x), .y = to16Bit(colorimetry.white.y)}, + .max_display_mastering_luminance = toNits(luminances.max), + .min_display_mastering_luminance = toNits(luminances.min * 10000), + .max_cll = toNits(settings.maxCLL > 0 ? settings.maxCLL : monitor->maxCLL()), + .max_fall = toNits(settings.maxFALL > 0 ? settings.maxFALL : monitor->maxFALL()), }, }; } |
