#include <screen/screen.h> int screen_read_display( screen_display_t disp, screen_buffer_t buf, int count, const int *read_rects, int flags );
- The handle of the display to read.
- The screen buffer to read.
- The number of rectangles supplied in the read_rects argument.
- A pointer to count * 4 integers that define the areas of the display that need to be grabbed.
- The mutex flags. Must be 0.
This function takes a snapshot of a display and stores the result in a user-provided buffer. The buffer can be a pixmap buffer or a window buffer. The buffer must be created with the SCREEN_USAGE_NATIVE usage in order for the operation to succeed. The call blocks until the operation is completed. If count is 0 and read_rects is NULL, the entire display is grabbed. Otherwise, read_rects must point to count * 4 integers defining rectangles in screen coordinates that need to be grabbed. Note that the buffer size does not have to match the display size. Scaling will be applied to make the snapshot fit into the buffer provided.
- The operation succeeded and pixels are written to the buffer.
- An error occurred (errno is set).