mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-16 04:12:03 +00:00
[idd/client] correct HDR luminance when PQ conversion is in use
This commit is contained in:
committed by
Geoffrey McRae
parent
1b3305e1dc
commit
05d8bc5311
@@ -286,7 +286,7 @@ void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
|||||||
if (wlWm.cmHasLuminances)
|
if (wlWm.cmHasLuminances)
|
||||||
wp_image_description_creator_params_v1_set_luminances(
|
wp_image_description_creator_params_v1_set_luminances(
|
||||||
wlWm.hdrImageCreator,
|
wlWm.hdrImageCreator,
|
||||||
minDisplayLuminance > 0 ? minDisplayLuminance / 10000 : 50,
|
minDisplayLuminance > 0 ? minDisplayLuminance : 50,
|
||||||
maxDisplayLuminance > 0 ? maxDisplayLuminance / 10000 : 1000,
|
maxDisplayLuminance > 0 ? maxDisplayLuminance / 10000 : 1000,
|
||||||
hdrPQ ? 203 : 80);
|
hdrPQ ? 203 : 80);
|
||||||
|
|
||||||
@@ -295,6 +295,7 @@ void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
|||||||
// primaries from the metadata (even if zero, in which case the
|
// primaries from the metadata (even if zero, in which case the
|
||||||
// compositor uses its own defaults).
|
// compositor uses its own defaults).
|
||||||
if (wlWm.cmHasMasteringPrimaries)
|
if (wlWm.cmHasMasteringPrimaries)
|
||||||
|
{
|
||||||
wp_image_description_creator_params_v1_set_mastering_display_primaries(
|
wp_image_description_creator_params_v1_set_mastering_display_primaries(
|
||||||
wlWm.hdrImageCreator,
|
wlWm.hdrImageCreator,
|
||||||
displayPrimary[0][0], displayPrimary[0][1],
|
displayPrimary[0][0], displayPrimary[0][1],
|
||||||
@@ -302,6 +303,15 @@ void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
|||||||
displayPrimary[2][0], displayPrimary[2][1],
|
displayPrimary[2][0], displayPrimary[2][1],
|
||||||
whitePoint[0], whitePoint[1]);
|
whitePoint[0], whitePoint[1]);
|
||||||
|
|
||||||
|
// Set mastering luminance range so the compositor knows the target
|
||||||
|
// color volume for tone mapping. min_lum is in ×10000 units (0.0001 cd/m²),
|
||||||
|
// max_lum is in unscaled cd/m².
|
||||||
|
wp_image_description_creator_params_v1_set_mastering_luminance(
|
||||||
|
wlWm.hdrImageCreator,
|
||||||
|
minDisplayLuminance > 0 ? minDisplayLuminance : 50,
|
||||||
|
maxDisplayLuminance > 0 ? maxDisplayLuminance / 10000 : 1000);
|
||||||
|
}
|
||||||
|
|
||||||
if (maxCLL > 0)
|
if (maxCLL > 0)
|
||||||
wp_image_description_creator_params_v1_set_max_cll(wlWm.hdrImageCreator, maxCLL);
|
wp_image_description_creator_params_v1_set_max_cll(wlWm.hdrImageCreator, maxCLL);
|
||||||
if (maxFALL > 0)
|
if (maxFALL > 0)
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ class CHDR16to10Effect : public CComputeEffect
|
|||||||
private:
|
private:
|
||||||
struct Consts
|
struct Consts
|
||||||
{
|
{
|
||||||
float ReferenceWhiteNits; // scRGB reference white in nits (typically 80)
|
float ReferenceWhiteNits; // scRGB reference white in nits (BT.2408 recommends 203)
|
||||||
} m_consts = { 80.0f };
|
} m_consts = { 203.0f };
|
||||||
ComPtr<ID3D12Resource> m_constBuffer;
|
ComPtr<ID3D12Resource> m_constBuffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user