RenderToolbox / RenderToolbox4

Matlab toolbox for managing 3D scenes and physically-based rendering.
MIT License
48 stars 7 forks source link

Refactor ReadMultichannelEXR as a stand-alone utility. #22

Open benjamin-heasly opened 7 years ago

benjamin-heasly commented 7 years ago

Currently, Matlab interfaces with the OpenEXR library via the in-memory mex function interface. This is an efficient interface.

However, it has become difficult to build, maintain, and distribute mex functions that use shared libraries like OpenEXR. Two main reasons are:

To alleviate these problems, we should decouple ReadMultichannelEXR from the Matlab mex function interface. We should make ReadMultichannelEXR into a stand-alone utility for reading and writing OpenEXR files to and from a simple structured representation, like ubjson.

We could continue to use ReadMultichannelEXR from Matlab by reading and writing ubjson files or streams, for example with jsonlab. We could choose the format of the ubjson representation to match the current ReadMultichannelEXR data format. We could include an m-function wrapper with the same behaviors as the current ReadMultichannelEXR mex-function, and minimize the impact on existing ReadMultichannelEXR code.

As a stand-alone tool, the ubjson version of ReadMultichannelEXR would have several advantages: