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 684 of file ImageReader.cpp.

685{
686 if (!m_is_open || !m_image_data) {
687 m_last_error = "No image open";
688 return false;
689 }
690
691 if (!buffer || !buffer->is_initialized()) {
692 m_last_error = "Invalid or uninitialized buffer";
693 return false;
694 }
695
696 size_t required_size = m_image_data->byte_size();
697 if (buffer->get_size_bytes() < required_size) {
698 m_last_error = "Buffer too small for image data";
699 return false;
700 }
701
703 m_image_data->data(),
704 required_size,
705 buffer);
706
708 "Loaded image into VKBuffer: {}x{} ({} bytes)",
709 m_image_data->width, m_image_data->height, required_size);
710
711 return true;
712}
#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: