Token returned by captureFramebufferAsync(). More...
#include <kanzi/core.ui/graphics2d/screen_capture.hpp>
Public Member Functions | |
| CaptureRequest ()=default | |
| Default constructor. Creates an invalid token. | |
| CaptureRequest (gfx::GpuFenceHandleGuard fence, gfx::BufferHandleGuard readbackBuffer, size_t width, size_t height, GraphicsFormat format, GraphicsFormat readFormat, ImageFlipAxis flipAxis) | |
| Constructor. | |
| KZ_NO_DISCARD BitmapImageUniquePtr | tryGetResult () const |
| Polls the GPU fence and, if the readback is complete, returns the captured image. | |
Token returned by captureFramebufferAsync().
Use tryGetResult() to poll for the captured image. The token is copyable; copies share the underlying GPU resources via ref-counted handles.
|
default |
Default constructor. Creates an invalid token.
| kanzi::CaptureRequest::CaptureRequest | ( | gfx::GpuFenceHandleGuard | fence, |
| gfx::BufferHandleGuard | readbackBuffer, | ||
| size_t | width, | ||
| size_t | height, | ||
| GraphicsFormat | format, | ||
| GraphicsFormat | readFormat, | ||
| ImageFlipAxis | flipAxis ) |
Constructor.
| fence | GPU fence to poll for readback completion. |
| readbackBuffer | Buffer containing the readback pixel data. |
| width | Capture area width. |
| height | Capture area height. |
| format | Requested graphics format. |
| readFormat | Actual read format from the framebuffer (may differ for surfaces). |
| flipAxis | Flip axis to apply when creating the image. |
| KZ_NO_DISCARD BitmapImageUniquePtr kanzi::CaptureRequest::tryGetResult | ( | ) | const |
Polls the GPU fence and, if the readback is complete, returns the captured image.
Each call creates a fresh BitmapImage from the GPU buffer. Returns nullptr if the capture is still pending or has failed.