1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #22790 from reunanen:add-capability-to-set-DWA-compression-level-in-OpenEXR-encoding

OpenEXR encoder: add capability to set the DWA compression level

* OpenEXR encoder: add capability to set the DWA compression level from outside

* Do not try to call `header.dwaCompressionLevel()` if OpenEXR is not version 3 or later

* Minor cleanup
This commit is contained in:
Juha Reunanen
2022-11-11 10:40:53 +02:00
committed by GitHub
parent 2aad039b4f
commit 1ba0984203
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -691,6 +691,14 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& params )
CV_Error(Error::StsBadArg, "IMWRITE_EXR_COMPRESSION is invalid or not supported");
}
}
if (params[i] == IMWRITE_EXR_DWA_COMPRESSION_LEVEL)
{
#if OPENEXR_VERSION_MAJOR >= 3
header.dwaCompressionLevel() = params[i + 1];
#else
CV_LOG_ONCE_WARNING(NULL, "Setting `IMWRITE_EXR_DWA_COMPRESSION_LEVEL` not supported in OpenEXR version " + std::to_string(OPENEXR_VERSION_MAJOR) + " (version 3 is required)");
#endif
}
}
if( channels == 3 || channels == 4 )