MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_texture_buffer()

std::shared_ptr< Buffers::TextureBuffer > MayaFlux::IO::ImageReader::create_texture_buffer ( )

Create a VKBuffer containing the loaded image pixel data.

Returns
VKBuffer with pixel data ready for GPU processing

Creates a buffer suitable for:

  • Transfer operations (upload to VKImage)
  • Direct compute shader processing
  • Buffer processor chains (treat pixels as samples)

Definition at line 664 of file ImageReader.cpp.

665{
666 if (!m_is_open || !m_image_data) {
667 m_last_error = "No image open";
668 return nullptr;
669 }
670
671 auto tex_buffer = std::make_shared<Buffers::TextureBuffer>(
672 m_image_data->width,
673 m_image_data->height,
674 m_image_data->format,
675 m_image_data->data());
676
678 "Created TextureBuffer from image: {}x{} ({} bytes)",
679 m_image_data->width, m_image_data->height, tex_buffer->get_size_bytes());
680
681 return tex_buffer;
682}
#define MF_INFO(comp, ctx,...)
std::optional< ImageData > m_image_data
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.

References MayaFlux::Journal::FileIO, MayaFlux::Journal::IO, m_image_data, m_is_open, m_last_error, and MF_INFO.