From 5690d7d571adcb90fd10ed5a4c18390f6a276541 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Tue, 7 Sep 2021 21:10:50 +1200 Subject: [PATCH] Fix when compiling against pre-3.1 version of Imath 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