class new in Git masterOpenExrImporter
OpenEXR importer plugin.
Supports single-part OpenEXR (
*.exr) images with half-float, float and unsigned integer channels. You can use OpenExrImageConverter to encode images into this format.
This plugin depends on the Trade library and is built if
WITH_OPENEXRIMPORTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load
"OpenExrImporter" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following. Using OpenEXR itself as a CMake subproject isn't tested at the moment, so you need to provide it as a system dependency and point
CMAKE_PREFIX_PATH to its installation dir if necessary.
set(WITH_OPENEXRIMPORTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::OpenExrImporter)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake and FindOpenEXR.cmake into your
modules/ directory, request the
OpenExrImporter component of the
MagnumPlugins package in CMake and link to the
find_package(MagnumPlugins REQUIRED OpenExrImporter) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::OpenExrImporter)
A channels are imported as PixelFormat::
If neither of the color channels is present and a a
Z channel is present instead, the image is imported as PixelFormat::
If a file doesn't match ither of the above, custom channel mapping can be supplied in the configuration.
Images with custom layers (for example with separate channels for a left and right view) can be imported by specifying the
layer configuration option.
Multipart images are not supported right now.
Deep images are not supported right now, cube map and environment map images are currently imported as two-dimensional images without any indication of image type.
It's possible to tune various options mainly for channel mapping through configuration(). See below for all options and their default values:
[configuration] # Import channels of given layer layer= # Mapping of channel names to output image channels. All channels have to have # the same type; empty names will cause that channel to not be imported at all, # leaving the memory zeroed out. See also forceChannelCount. r=R g=G b=B a=A # If the file doesn't contain any of the channel names specified in r, g, b or # a, depth is tried instead, in which case it's expected to be a 32-bit float # and is imported as PixelFormat::Depth32F. depth=Z # If any of the channels specified in r, g, b, a don't exist, they will be # filled with the following values. rFill=0.0 gFill=0.0 bFill=0.0 aFill=1.0 # Override channel count for RGBA. Allowed values are 0-4, with zero being the # default where channel count corresponds to the last name in r, g, b, a that # exists. So for example if a file has only R and B channels, it's imported as # RGB with G filled with the gFill value. forceChannelCount=0
- class AbstractImporter
- Base for importer plugins.