Execute a full-surface pixel readback.
Allocates a format-appropriate DataVariant and updates container ProcessingState: PROCESSING → PROCESSED.
55{
56 auto wc = std::dynamic_pointer_cast<WindowContainer>(container);
57 if (!wc) {
59 "WindowAccessProcessor::process — container is not a WindowContainer");
60 return;
61 }
62
63 const auto& window = wc->get_window();
64
67 "WindowAccessProcessor: no completed frame available for '{}'",
68 window->get_create_info().title);
69 return;
70 }
71
76
78
80 "WindowAccessProcessor: '{}' resized to {}x{} format={}",
83 }
84
87
88 auto& processed = container->get_processed_data();
89 processed.resize(1);
90
93
94 if (result.element_count() == 0) {
96 "WindowAccessProcessor: readback returned no data for '{}'",
97 window->get_create_info().title);
100 return;
101 }
102
106
109}
#define MF_INFO(comp, ctx,...)
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
#define MF_RT_TRACE(comp, ctx,...)
size_t m_last_readback_bytes
Core::GraphicsSurfaceInfo::SurfaceFormat m_surface_format
std::atomic< bool > m_is_processing
vk::Format to_vk_format(GraphicsSurfaceInfo::SurfaceFormat fmt)
uint32_t vk_format_bytes_per_pixel(vk::Format fmt)
Byte width of a single pixel for a given Vulkan format.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ ERROR
Container is in an error state and cannot proceed.
@ PROCESSING
Container is actively being processed.
@ PROCESSED
Container has completed processing and results are available.
bool is_readback_available(const std::shared_ptr< Core::Window > &window)
Check whether a completed frame is currently available for readback.
std::pair< uint32_t, uint32_t > query_surface_extent(const std::shared_ptr< Core::Window > &window)
Query the current pixel dimensions of the window's swapchain.
DataAccess readback_region(const std::shared_ptr< Core::Window > &window, uint32_t x_offset, uint32_t y_offset, uint32_t pixel_width, uint32_t pixel_height, DataVariant &out_variant)
Read a pixel rectangle from the last completed swapchain frame into a DataVariant whose element type ...
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...