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

◆ download_texture_buffer()

MAYAFLUX_API 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 34 of file ImageExport.cpp.

36{
37 if (!buffer) {
38 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
39 "download_texture_buffer: null buffer");
40 return std::nullopt;
41 }
42
43 auto image = buffer->get_gpu_texture();
44 if (!image) {
45 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
46 "download_texture_buffer: buffer has no GPU texture yet "
47 "(has the buffer been processed at least once?)");
48 return std::nullopt;
49 }
50
51 return download_image(image);
52}
#define MF_ERROR(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:47
std::shared_ptr< NetworkGeometryBuffer > buffer

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

+ Here is the call graph for this function: