From a4c24a865363f0c21d4ad7ae19fb4072c08be7f0 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Fri, 10 Sep 2021 02:15:48 +1200 Subject: [PATCH] Fix when compiling against pre-3.1 version of Imath (#1145) Signed-off-by: Kimball Thurston --- src/test/OpenEXRCoreTest/compression.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/OpenEXRCoreTest/compression.cpp b/src/test/OpenEXRCoreTest/compression.cpp index aed0257ff3..14f09e5246 100644 --- a/src/test/OpenEXRCoreTest/compression.cpp +++ b/src/test/OpenEXRCoreTest/compression.cpp @@ -49,6 +49,15 @@ using namespace IMATH_NAMESPACE; namespace IMF = OPENEXR_IMF_NAMESPACE; using namespace IMF; +#if (IMATH_VERSION_MAJOR < 3) || (IMATH_VERSION_MAJOR == 3 && IMATH_VERSION_MINOR < 1) +inline float imath_half_to_float( uint16_t a ) +{ + half tmp; + tmp.setBits( a ); + return static_cast( tmp ); +} +#endif + //////////////////////////////////////// inline int