diff options
author | Martijn Berger <martijn.berger@gmail.com> | 2015-03-12 16:02:33 +0300 |
---|---|---|
committer | Martijn Berger <martijn.berger@gmail.com> | 2015-03-12 16:02:33 +0300 |
commit | ae45496812a46b084e3c31948029efd8b5409b68 (patch) | |
tree | 2246580f9e6268a66a079272803b9e4eaf25809d /source/blender/imbuf/intern/openexr | |
parent | 2814039ee3e86105eb3dd978bc715b204407f91e (diff) |
OpenEXR 2.2 add support for Dreamworks DWAA / DWAB compression
This patch makes it possible for the user to select all supported compression types in OpenEXR 2.2
Discussion points:
- B44 is only defined for half's it compresses to a fixed representation of 44% of the halfs. We do currently not reflect in the UI that in the case of float32's it will be equal to compression = NONE
- ZIPS is single scanline zip and is supposed to be useful in cases where importing in Nuke happens.
- The new Dreamworks formats, are the worth exposing etc etc
Reviewers: campbellbarton, sergey
Reviewed By: sergey
Projects: #bf_blender
Differential Revision: https://developer.blender.org/D1050
Diffstat (limited to 'source/blender/imbuf/intern/openexr')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 5de243845a4..45eae89ad9d 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -38,6 +38,8 @@ #include <errno.h> #include <algorithm> +#include "DNA_scene_types.h" /* For OpenEXR compression constants */ + #include <openexr_api.h> #if defined (WIN32) && !defined(FREE_WINDOWS) @@ -284,21 +286,38 @@ int imb_is_a_openexr(unsigned char *mem) static void openexr_header_compression(Header *header, int compression) { switch (compression) { - case 0: + case R_IMF_EXR_CODEC_NONE: header->compression() = NO_COMPRESSION; break; - case 1: + case R_IMF_EXR_CODEC_PXR24: header->compression() = PXR24_COMPRESSION; break; - case 2: + case R_IMF_EXR_CODEC_ZIP: header->compression() = ZIP_COMPRESSION; break; - case 3: + case R_IMF_EXR_CODEC_PIZ: header->compression() = PIZ_COMPRESSION; break; - case 4: + case R_IMF_EXR_CODEC_RLE: header->compression() = RLE_COMPRESSION; break; + case R_IMF_EXR_CODEC_ZIPS: + header->compression() = ZIPS_COMPRESSION; + break; + case R_IMF_EXR_CODEC_B44: + header->compression() = B44_COMPRESSION; + break; + case R_IMF_EXR_CODEC_B44A: + header->compression() = B44A_COMPRESSION; + break; +#if OPENEXR_VERSION_MAJOR >= 2 && OPENEXR_VERSION_MINOR >= 2 + case R_IMF_EXR_CODEC_DWAA: + header->compression() = DWAA_COMPRESSION; + break; + case R_IMF_EXR_CODEC_DWAB: + header->compression() = DWAB_COMPRESSION; + break; +#endif default: header->compression() = ZIP_COMPRESSION; break; |