MayaFlux 0.3.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 447 of file ImageReader.cpp.

448{
449 if (!m_is_open || !m_image_data) {
450 m_last_error = "No image open";
451 return nullptr;
452 }
453
454 auto tex_buffer = std::make_shared<Buffers::TextureBuffer>(
455 m_image_data->width,
456 m_image_data->height,
457 m_image_data->format,
458 m_image_data->pixels.data());
459
461 "Created TextureBuffer from image: {}x{} ({} bytes)",
462 m_image_data->width, m_image_data->height, tex_buffer->get_size_bytes());
463
464 return tex_buffer;
465}
#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.