MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::IO::EXRWriter Class Reference

ImageWriter implementation backed by tinyexr. More...

#include <EXRWriter.hpp>

+ Inheritance diagram for MayaFlux::IO::EXRWriter:
+ Collaboration diagram for MayaFlux::IO::EXRWriter:

Public Member Functions

bool can_write (const std::string &filepath) const override
 Check whether this writer handles the given filepath.
 
 EXRWriter ()=default
 
std::string get_last_error () const override
 Last error message or empty string.
 
std::vector< std::string > get_supported_extensions () const override
 File extensions handled by this writer (without dot).
 
bool write (const std::string &filepath, const ImageData &data, const ImageWriteOptions &options={}) override
 Write image data to disk.
 
 ~EXRWriter () override=default
 
- Public Member Functions inherited from MayaFlux::IO::ImageWriter
virtual ~ImageWriter ()=default
 

Static Public Member Functions

static void register_with_registry ()
 Register this writer with the ImageWriterRegistry.
 

Private Member Functions

std::vector< std::string > resolve_channel_names (const ImageData &data, const ImageWriteOptions &options) const
 Resolve channel name list based on options and channel count.
 

Static Private Member Functions

static std::vector< std::vector< float > > deinterleave (const std::vector< float > &src, uint32_t width, uint32_t height, uint32_t channels, bool flip_vertically)
 Deinterleave source float buffer into N planar channel buffers.
 

Private Attributes

std::string m_last_error
 

Detailed Description

ImageWriter implementation backed by tinyexr.

Writes OpenEXR single-part scanline images with 32-bit float pixel data. Handles arbitrary channel counts with named channels. State textures use named channels like "position.x", "entity_id", "trigger_kind" directly, so the file is partly self-documenting.

Accepts float ImageData only. Integer variants (uint8, uint16) are rejected: EXR is a floating-point format and storing integer data via reinterpret would produce files no viewer reads sensibly.

Channel naming:

  • ImageWriteOptions::channel_names, if non-empty and sized to match data.channels, is used verbatim.
  • Otherwise defaults are applied by channel count: 1 : "Y" 2 : "Y", "A" 3 : "B", "G", "R" (EXR convention) 4 : "A", "B", "G", "R" (EXR convention) N (>4) : "C0", "C1", ... "C(N-1)"

Compression:

  • ImageWriteOptions::compression is the tinyexr TINYEXR_COMPRESSIONTYPE_* value. -1 (default) maps to TINYEXR_COMPRESSIONTYPE_ZIP (scanline block zip, widest viewer support).

Vertical flip:

Limitations:

  • Single-part only. Multi-part EXR is deferred; for layered state textures, write multiple EXR files with a companion schema/manifest.
  • No tiled output, no deep images.
  • Half precision output not yet exposed (requires uint16 ImageData and TINYEXR_PIXELTYPE_HALF plumbing; deferred).

Definition at line 45 of file EXRWriter.hpp.


The documentation for this class was generated from the following files: