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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user