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

◆ to_image() [2/2]

std::shared_ptr< Core::VKImage > MayaFlux::Kakshya::WindowContainer::to_image ( const std::shared_ptr< Buffers::VKBuffer > &  staging) const

Refresh the full surface VKImage, reusing a caller-supplied persistent staging buffer.

The container retains the image. The supplied staging buffer is used for this upload.

Parameters
stagingHost-visible staging VKBuffer sized to at least width * height * bytes_per_pixel.
Returns
Cached VKImage, or nullptr on failure.

Definition at line 201 of file WindowContainer.cpp.

203{
204 auto pixels = snapshot_pixels();
205 if (!pixels)
206 return nullptr;
207
208 const auto format = get_image_format();
209 Memory::SerializedSeqlockWriteGuard image_guard(m_image_cache_lock);
211 m_surface_image, sampled_image_key(pixels->width, pixels->height, format),
212 pixels->pixels, staging);
213}
const std::vector< float > * pixels
Definition Decoder.cpp:48
bool format
std::optional< PixelSnapshot > snapshot_pixels(std::optional< uint32_t > frame_index=std::nullopt) const
ImageFormat get_image_format() const
Portal ImageFormat corresponding to the live swapchain surface format.
Portal::Graphics::ImageCacheEntry m_surface_image
std::shared_ptr< Core::VKImage > refresh_cached_image(ImageCacheEntry &entry, const ImageKey &key, std::span< const uint8_t > pixels, const std::shared_ptr< Buffers::VKBuffer > &staging={})
Refresh a sampled image in an owner-held cache entry.

References format, get_image_format(), MayaFlux::Portal::Graphics::TextureLoom::instance(), m_image_cache_lock, m_surface_image, pixels, MayaFlux::Portal::Graphics::TextureLoom::refresh_cached_image(), and snapshot_pixels().

+ Here is the call graph for this function: