mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-17 04:42:01 +00:00
[client] fix the HDR colorspace mapping to SDR
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
@@ -102,7 +102,12 @@ vec3 bt2020to709(vec3 bt2020)
|
|||||||
vec3 mapToSDR(vec3 color, float gain, bool pq)
|
vec3 mapToSDR(vec3 color, float gain, bool pq)
|
||||||
{
|
{
|
||||||
if (pq)
|
if (pq)
|
||||||
|
{
|
||||||
|
// HDR10: PQ-encoded BT.2020. Linearise then convert the gamut to BT.709.
|
||||||
color = pq2lin(color.rgb, gain);
|
color = pq2lin(color.rgb, gain);
|
||||||
color = bt2020to709(color);
|
color = bt2020to709(color);
|
||||||
|
}
|
||||||
|
// else: scRGB is already linear BT.709 (1.0 == SDR white), so no EOTF or
|
||||||
|
// gamut conversion is required - only highlight compression below.
|
||||||
return lin2srgb(compress(color));
|
return lin2srgb(compress(color));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user