feat(openexr): Support for idManifest and deepImageState #4877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support for retrieving and setting the idManifest for deep image files with object ID channels. This is an OpenEXR feature where the image header can contian metadata that maps all the object ID channel integer codes to strings of the object names.
We report this in the ImageSpec as the metadata "openexr:compressedIDManifest", whose type is an array of uint8 (byte) values. It is encoded the same way it appears in the exr file itself: the first 8 bytes are a little endian uint64_t giving the uncompressed size of a serialized OpenEXR IDManifest object, and then starting at byte 8, the zip-compressed seriailized IDManifest. Therefore, the compressed block size is the size of the metadata blob, minus 8 bytes for the length. It is up to the caller to use the OpenEXR APIs to turn this compressed serialized IDManifest into a fully expanded IDManifest, if that's what they want to do.
It works for output, too, so it should copy the manifests correctly between files, even if the app doesn't know what to do with the binary data it contains.
Also added support for deepImageState, which we previously had ignored. We report this as the metadata "openexr:deepImageState", a string, which if present has one of the values "messy", "sorted", "non_overlapping", or "tidy".