Upload the full surface readback to a new VKImage.
Requires at least one completed readback (processed_data[0] non-empty and of type vector<uint8_t>). A fresh VKImage is created and uploaded on each call via TextureLoom; callers driving a per-frame path should prefer the staging-buffer overload to avoid per-call VkBuffer churn.
184{
185 std::shared_ptr<Core::VKImage> img;
188 MF_RT_WARN(Journal::Component::Kakshya, Journal::Context::ContainerProcessing,
189 "WindowContainer::to_image : no readback data available for '{}'",
190 m_window->get_create_info().title);
191 return;
192 }
193
197 "WindowContainer::to_image : processed_data[0] is not uint8_t or is empty for '{}'",
199 return;
200 }
201
205
206 if (!img) {
208 "WindowContainer::to_image : TextureLoom::create_2d failed for '{}'",
210 }
211 });
212 return img;
213}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
const std::vector< float > * pixels
std::shared_ptr< Core::Window > m_window
Memory::Seqlock m_data_lock
std::vector< DataVariant > m_processed_data
ContainerDataStructure m_structure
static TextureLoom & instance()
std::shared_ptr< Core::VKImage > create_2d(uint32_t width, uint32_t height, ImageFormat format=ImageFormat::RGBA8, const void *data=nullptr, uint32_t mip_levels=1)
Create a 2D texture.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
Core::GraphicsSurfaceInfo::SurfaceFormat query_surface_format(const std::shared_ptr< Core::Window > &window)
Query the actual vk::Format in use by the window's live swapchain, translated back to the MayaFlux su...
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
static uint64_t get_height(const std::vector< DataDimension > &dimensions)
Extract height from image/video dimensions.
static uint64_t get_width(const std::vector< DataDimension > &dimensions)
Extract width from image/video dimensions.