|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| std::optional< ImageData > MayaFlux::IO::download_image | ( | const std::shared_ptr< Core::VKImage > & | image | ) |
Download pixel data from a GPU-resident VKImage into host ImageData.
Performs a blocking GPU->host transfer via TextureLoom::download_data, allocating a host buffer of the appropriate variant for the image format. The source image is restored to eShaderReadOnlyOptimal / eFragmentShader after the copy; pass a different restore layout/stage via the overload if the image was, for example, in a compute write state.
Multi-layer and multi-mip images are downloaded at layer 0, mip 0 only. Array and mipmap export is a separate concern.
| image | Fully-initialized VKImage to read from. |
Definition at line 51 of file ImageExport.cpp.
References MayaFlux::IO::ImageData::channels, MayaFlux::IO::ImageData::data(), MayaFlux::Journal::FileIO, MayaFlux::IO::ImageData::format, MayaFlux::Portal::Graphics::TextureLoom::from_vulkan_format(), MayaFlux::Portal::Graphics::TextureLoom::get_channel_count(), MayaFlux::IO::ImageData::height, image, MayaFlux::Journal::IO, MayaFlux::IO::ImageData::is_consistent(), MF_DEBUG, MF_ERROR, MayaFlux::IO::ImageData::width, and width.
Referenced by download_texture_buffer(), save_image(), and MayaFlux::IO::IOManager::save_image().
Here is the call graph for this function:
Here is the caller graph for this function: