screen_read_display()

Take a snapshot of the display and stores the result in the provided buffer

Function type:

Apply execution

Synopsis:

#include <screen/screen.h>

int screen_read_display( screen_display_t disp, 
                         screen_buffer_t buf, 
                         int count, 
                         const int *read_rects, 
                         int flags );

Arguments:

disp
The handle of the display to read.
buf
The screen buffer to read.
count
The number of rectangles supplied in the read_rects argument.
read_rects
A pointer to count * 4 integers that define the areas of the display that need to be grabbed.
flags
The mutex flags. Must be 0.

Library

screen

Description

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.

Returns

0
The operation succeeded and pixels are written to the buffer.
-1
An error occurred (errno is set).

Classification

Windowing API

Safety  Value  
Interrupt handler No
Signal handler No
Thread Yes