|
MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API DataAccess MayaFlux::Kakshya::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 matches the live swapchain format.
Format → DataVariant mapping: B8G8R8A8_SRGB / R8G8B8A8_SRGB / B8G8R8A8_UNORM / R8G8B8A8_UNORM → std::vector<uint8_t> (4 bytes/pixel) R16G16B16A16_SFLOAT → std::vector<uint16_t> (8 bytes/pixel, raw half-float bits) A2B10G10R10_UNORM → std::vector<uint32_t> (4 bytes/pixel, packed word) R32G32B32A32_SFLOAT → std::vector<float> (16 bytes/pixel)
"Last completed frame" semantics: the swapchain image whose in-flight fence has already signaled. Safe to call without stalling the render pipeline.
Dimensions on the returned DataAccess (IMAGE_COLOR convention): [0] SPATIAL_Y — pixel_height [1] SPATIAL_X — pixel_width [2] CHANNEL — channel_count derived from format traits
| window | Window whose surface is being read. |
| x_offset | Left edge of the pixel rectangle (inclusive). |
| y_offset | Top edge of the pixel rectangle (inclusive). |
| pixel_width | Width of the rectangle in pixels. |
| pixel_height | Height of the rectangle in pixels. |
| out_variant | Receives the typed pixel data. Left unchanged on failure. |
Definition at line 122 of file SurfaceUtils.cpp.
References MayaFlux::Journal::ContainerProcessing, MayaFlux::Buffers::create_staging_buffer(), MayaFlux::Core::from_vk_format(), MayaFlux::Core::get_surface_format_traits(), IMAGE_COLOR, MayaFlux::Journal::Kakshya, MF_RT_ERROR, UNKNOWN, and MayaFlux::Core::vk_format_bytes_per_pixel().
Referenced by MayaFlux::Kakshya::WindowAccessProcessor::process().
Here is the call graph for this function:
Here is the caller graph for this function: