From 16948ca81c19a84b35a47c96382a25c02acac83e Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 17 Nov 2024 10:19:00 +1300 Subject: [PATCH] Add `DISPLAY - CIE-XYZ-D65_to_DisplayP3-HDR` builtin transform. References AcademySoftwareFoundation/OpenColorIO-Config-ACES#130 Signed-off-by: Thomas Mansencal --- src/OpenColorIO/transforms/builtins/Displays.cpp | 6 ++++++ tests/cpu/transforms/BuiltinTransform_tests.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/OpenColorIO/transforms/builtins/Displays.cpp b/src/OpenColorIO/transforms/builtins/Displays.cpp index e2bfdddd3..bd6f0c5e7 100644 --- a/src/OpenColorIO/transforms/builtins/Displays.cpp +++ b/src/OpenColorIO/transforms/builtins/Displays.cpp @@ -358,6 +358,12 @@ void RegisterAll(BuiltinTransformRegistryImpl & registry) noexcept registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_DisplayP3", "Convert CIE XYZ (D65 white) to Apple Display P3", CIE_XYZ_D65_to_DisplayP3_Functor); + + // NOTE: This builtin is defined to be able to partition SDR and HDR view transforms under two separate + // displays rather than a single one. + registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_DisplayP3-HDR", + "Convert CIE XYZ (D65 white) to Apple Display P3 (HDR)", + CIE_XYZ_D65_to_DisplayP3_Functor); } { diff --git a/tests/cpu/transforms/BuiltinTransform_tests.cpp b/tests/cpu/transforms/BuiltinTransform_tests.cpp index ce0267c8a..e46bd74fe 100644 --- a/tests/cpu/transforms/BuiltinTransform_tests.cpp +++ b/tests/cpu/transforms/BuiltinTransform_tests.cpp @@ -626,6 +626,9 @@ AllValues UnitTestValues { "DISPLAY - CIE-XYZ-D65_to_DisplayP3", { 1.0e-6f, { 0.5f, 0.4f, 0.3f }, { 0.882580907776f, 0.581526360743f, 0.5606367050000f } } }, + { "DISPLAY - CIE-XYZ-D65_to_DisplayP3-HDR", + { 1.0e-6f, + { 0.5f, 0.4f, 0.3f }, { 0.882580907776f, 0.581526360743f, 0.5606367050000f } } }, { "CURVE - ST-2084_to_LINEAR", { 4.0e-5f,