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

◆ download_texture_buffer()

std::optional< ImageData > MayaFlux::IO::download_texture_buffer ( const std::shared_ptr< Buffers::TextureBuffer > &  buffer)

Download a TextureBuffer's GPU texture into host ImageData.

Convenience wrapper over download_image() that pulls the VKImage from TextureBuffer::get_gpu_texture(). Returns nullopt if the texture is not yet allocated (buffer has not been processed at least once).

Definition at line 124 of file ImageExport.cpp.

126{
127 if (!buffer) {
128 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
129 "download_texture_buffer: null buffer");
130 return std::nullopt;
131 }
132
133 auto image = buffer->get_gpu_texture();
134 if (!image) {
135 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
136 "download_texture_buffer: buffer has no GPU texture yet "
137 "(has the buffer been processed at least once?)");
138 return std::nullopt;
139 }
140
141 return download_image(image);
142}
#define MF_ERROR(comp, ctx,...)
IO::ImageData image

References download_image(), MayaFlux::Journal::FileIO, image, MayaFlux::Journal::IO, and MF_ERROR.

+ Here is the call graph for this function: