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

◆ load_into_buffer()

bool MayaFlux::IO::ImageReader::load_into_buffer ( const std::shared_ptr< Buffers::VKBuffer > &  buffer)

Load image directly into an existing VKBuffer.

Parameters
bufferTarget buffer (must be large enough)
Returns
True if load succeeded

Definition at line 683 of file ImageReader.cpp.

684{
685 if (!m_is_open || !m_image_data) {
686 m_last_error = "No image open";
687 return false;
688 }
689
690 if (!buffer || !buffer->is_initialized()) {
691 m_last_error = "Invalid or uninitialized buffer";
692 return false;
693 }
694
695 size_t required_size = m_image_data->byte_size();
696 if (buffer->get_size_bytes() < required_size) {
697 m_last_error = "Buffer too small for image data";
698 return false;
699 }
700
702 m_image_data->data(),
703 required_size,
704 buffer);
705
707 "Loaded image into VKBuffer: {}x{} ({} bytes)",
708 m_image_data->width, m_image_data->height, required_size);
709
710 return true;
711}
#define MF_INFO(comp, ctx,...)
std::optional< ImageData > m_image_data
void upload_to_gpu(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging)
Upload raw data to GPU buffer (auto-detects host-visible vs device-local)
@ 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, MF_INFO, and MayaFlux::Buffers::upload_to_gpu().

+ Here is the call graph for this function: