The OpenEXR API

There are two separate, independent APIs for reading and writing EXRimage files: the traditional C++ API, and the newer C API, referred toasOpenEXRCore. The C++ API is the original, widely-used interfacefirst released in 2003. It consists of theOpenEXR,Iex, andIlmThread libraries, with functions and classes in theImf::namespace (or “image format”, the original the name of the library atILM prior to its public release).

TheOpenEXRCore library, written primarily by Kimball Thurston atWeta Digital, was introduced in July, 2021. This C-languageimplementation of the file format is the result of a significantre-thinking of image file I/O and access to image data. TheOpenEXRCore library provides thread-safe, non-blocking access tofiles, which was not possible with the older C++ API, where theframebuffer management is separate from read requests. This newlow-level API allows applications to do custom unpacking of EXR data,such as on the GPU, while still benefiting from efficient I/O, filevalidation, and other semantics. It provides efficient direct accessto EXR files in texturing applications. This C library also introducesan easier path to implementing OpenEXR bindings in other languages,such as Rust.

Currently, the two libraries and APIs sit alongside each other,although in future OpenEXR releases, the C++ API will migrate to usethe new core in stages. It is not the intention to entirely deprecatethe C++ API, nor must all applications re-implement EXR I/O in termsof the C library. The C API does not, and will not, provide the richset of utility classes that exist in the C++ layer. TheOpenEXRCore library simply offers new functionality for specialtyapplications seeking the highest possible performance.