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

◆ to_image() [1/2]

std::shared_ptr< Core::VKImage > MayaFlux::Kakshya::WindowContainer::to_image ( ) const

Upload the full surface readback to a container-owned VKImage.

Requires at least one completed readback (processed_data[0] non-empty and of type vector<uint8_t>). Reuses the image while dimensions and format match. The returned image is refreshed in place by later calls, so it is a live image rather than a snapshot.

Returns
Cached VKImage, or nullptr on failure.

Definition at line 188 of file WindowContainer.cpp.

189{
190 auto pixels = snapshot_pixels();
191 if (!pixels)
192 return nullptr;
193
194 const auto format = get_image_format();
195 Memory::SerializedSeqlockWriteGuard image_guard(m_image_cache_lock);
197 m_surface_image, sampled_image_key(pixels->width, pixels->height, format),
198 pixels->pixels);
199}
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: