Fix OpenCV build with OpenEXR before 2.2.0.

This commit is contained in:
Alexander Smorkalov
2021-04-28 10:41:59 +03:00
parent 15e2f991dd
commit 083a7c8f0a
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -64,6 +64,7 @@
#include <ImfStandardAttributes.h>
#include <half.h>
#include "grfmt_exr.hpp"
#include "OpenEXRConfig.h"
#if defined _WIN32
@@ -649,12 +650,14 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& params )
case IMWRITE_EXR_COMPRESSION_B44A:
header.compression() = B44A_COMPRESSION;
break;
#if ((OPENEXR_VERSION_MAJOR * 1000 + OPENEXR_VERSION_MINOR) >= (2 * 1000 + 2)) // available since version 2.2.0
case IMWRITE_EXR_COMPRESSION_DWAA:
header.compression() = DWAA_COMPRESSION;
break;
case IMWRITE_EXR_COMPRESSION_DWAB:
header.compression() = DWAB_COMPRESSION;
break;
#endif
default:
CV_Error(Error::StsBadArg, "IMWRITE_EXR_COMPRESSION is invalid or not supported");
}