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

Raw image data loaded from file. More...

#include <ImageReader.hpp>

+ Collaboration diagram for MayaFlux::IO::ImageData:

Public Types

using PixelStorage = std::variant< std::vector< uint8_t >, std::vector< uint16_t >, std::vector< float > >
 

Public Member Functions

std::vector< float > * as_float ()
 
const std::vector< float > * as_float () const
 
std::vector< uint16_t > * as_uint16 ()
 
const std::vector< uint16_t > * as_uint16 () const
 
std::vector< uint8_t > * as_uint8 ()
 
const std::vector< uint8_t > * as_uint8 () const
 Typed accessors.
 
size_t byte_size () const
 Total byte size of pixel storage, dispatched on variant.
 
const void * data () const
 Raw data pointer, dispatched on variant.
 
size_t element_count () const
 Number of pixel elements (not bytes), dispatched on variant.
 
bool is_consistent () const
 Check that the active variant matches the declared format.
 

Public Attributes

uint32_t channels { 0 }
 
Portal::Graphics::ImageFormat format { Portal::Graphics::ImageFormat::RGBA8 }
 
uint32_t height { 0 }
 
PixelStorage pixels
 
uint32_t width { 0 }
 

Detailed Description

Raw image data loaded from file.

Pixel storage is a variant over uint8, uint16, and float, chosen by the loader based on the source format. 8-bit formats (PNG, JPG, BMP, TGA) populate the uint8 variant. 16-bit PNG populates the uint16 variant. Floating-point formats (EXR, HDR) populate the float variant.

The declared ImageFormat must match the active variant. Accessors below enforce this; direct member access is permitted but callers are responsible for consistency.

Definition at line 26 of file ImageReader.hpp.


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