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

ImageWriter implementation backed by stb_image_write. More...

#include <STBImageWriter.hpp>

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

Public Member Functions

bool can_write (const std::string &filepath) const override
 Check whether this writer handles the given filepath.
 
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).
 
 STBImageWriter ()=default
 
bool write (const std::string &filepath, const ImageData &data, const ImageWriteOptions &options={}) override
 Write image data to disk.
 
 ~STBImageWriter () 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

bool write_bmp (const std::string &filepath, const ImageData &data)
 
bool write_hdr (const std::string &filepath, const ImageData &data)
 
bool write_jpg (const std::string &filepath, const ImageData &data, const ImageWriteOptions &options)
 
bool write_png (const std::string &filepath, const ImageData &data, const ImageWriteOptions &options)
 
bool write_tga (const std::string &filepath, const ImageData &data)
 

Private Attributes

std::string m_last_error
 

Detailed Description

ImageWriter implementation backed by stb_image_write.

Handles PNG, JPG, BMP, TGA, and HDR. Accepts:

  • uint8 ImageData for PNG/JPG/BMP/TGA (RGBA8/RGB8/etc.)
  • float ImageData for HDR (RGB32F/RGBA32F, scanline radiance encoding)

EXR is not handled here. Float data routed to PNG/JPG/BMP/TGA is rejected with a clear error; use EXRWriter for float-precision outputs.

Options honored:

Definition at line 23 of file STBImageWriter.hpp.


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