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

File reader for image formats (PNG, JPG, BMP, TGA, etc.) More...

#include <ImageReader.hpp>

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

Public Member Functions

 ImageReader ()
 
 ~ImageReader () override
 
bool can_read (const std::string &filepath) const override
 Check if a file can be read by this reader.
 
bool open (const std::string &filepath, FileReadOptions options=FileReadOptions::ALL) override
 Open a file for reading.
 
void close () override
 Close the currently open file.
 
bool is_open () const override
 Check if a file is currently open.
 
std::optional< FileMetadataget_metadata () const override
 Get metadata from the open file.
 
std::vector< FileRegionget_regions () const override
 Get semantic regions from the file.
 
std::vector< Kakshya::DataVariantread_all () override
 Read all data from the file into memory.
 
std::vector< Kakshya::DataVariantread_region (const FileRegion &region) override
 Read a specific region of data.
 
std::shared_ptr< Kakshya::SignalSourceContainercreate_container () override
 Create and initialize a container from the file.
 
bool load_into_container (std::shared_ptr< Kakshya::SignalSourceContainer > container) override
 Load file data into an existing container.
 
std::vector< uint64_t > get_read_position () const override
 Get current read position in primary dimension.
 
bool seek (const std::vector< uint64_t > &position) override
 Seek to a specific position in the file.
 
std::vector< std::string > get_supported_extensions () const override
 Get supported file extensions for this reader.
 
std::type_index get_data_type () const override
 Get the data type this reader produces.
 
std::type_index get_container_type () const override
 Get the container type this reader creates.
 
std::string get_last_error () const override
 Get the last error message.
 
bool supports_streaming () const override
 Check if streaming is supported for the current file.
 
uint64_t get_preferred_chunk_size () const override
 Get the preferred chunk size for streaming.
 
size_t get_num_dimensions () const override
 Get the dimensionality of the file data.
 
std::vector< uint64_t > get_dimension_sizes () const override
 Get size of each dimension in the file data.
 
std::optional< ImageDataget_image_data () const
 Get the loaded image data.
 
std::shared_ptr< Buffers::TextureBuffercreate_texture_buffer ()
 Create a VKBuffer containing the loaded image pixel data.
 
bool load_into_buffer (const std::shared_ptr< Buffers::VKBuffer > &buffer)
 Load image directly into an existing VKBuffer.
 
- Public Member Functions inherited from MayaFlux::IO::FileReader
virtual ~FileReader ()=default
 

Static Public Member Functions

static std::optional< ImageDataload_from_memory (const void *data, size_t size)
 Load image from memory (static utility)
 
static std::optional< ImageDataload (const std::string &path, int desired_channels=4)
 Load image from file (static utility)
 
static std::optional< ImageDataload (const std::filesystem::path &path, int desired_channels=4)
 Load image from file (static utility)
 
static std::shared_ptr< Core::VKImageload_texture (const std::string &path)
 Load image directly into GPU texture (static utility)
 

Private Attributes

std::string m_filepath
 
std::optional< ImageDatam_image_data
 
std::string m_last_error
 
bool m_is_open
 

Additional Inherited Members

- Static Protected Member Functions inherited from MayaFlux::IO::FileReader
static std::unordered_map< std::string, Kakshya::RegionGroupregions_to_groups (const std::vector< FileRegion > &regions)
 Convert file regions to region groups.
 

Detailed Description

File reader for image formats (PNG, JPG, BMP, TGA, etc.)

Uses STB Image library for decoding. Supports:

  • PNG, JPG, BMP, TGA, PSD, GIF, HDR, PIC, PNM
  • Automatic format detection
  • Channel conversion (force RGBA, etc.)
  • Direct GPU texture creation

Implements the FileReader interface for consistency with other readers.

Definition at line 37 of file ImageReader.hpp.


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