screen_blit()

Copy pixel data from one buffer to another

Synopsis:

#include <screen/screen.h>
int screen_blit(screen_context_t ctx,
                screen_buffer_t dst,
                screen_buffer_t src,
                const int *attribs)

Arguments:

ctx
A connection to Screen
dst
The buffer which data is copied to. The source rectangle must be located entirely within the source buffer (src) and the destination rectangle must be located entirely within the destination buffer (dst); otherwise screen_blit() returns an error.
src
The buffer which the pixels is copied from.
attribs
A list that contains the attributes that define the blit. This list must consist of a series of token-value pairs terminated with a SCREEN_BLIT_END token. The tokens used in this list must be of type Screen blit types.

Library:

libscreen

Description:

Function Type: Delayed Execution

This function requests pixels from one buffer be copied to another. The operation isn't executed until an API function that flushes blits is called.

The attribs argument is allowed to be NULL or empty (i.e. contains a single element that is set to SCREEN_BLIT_END). If attribs is empty, then the following defaults are applied:
  • the source rectangle's vertical and horizontal positions are 0
  • the destination rectangle's vertical and horizontal positions are 0
  • the source rectangle includes the entire source buffer
  • the destination buffer includes the entire destination buffer
  • the transparency is SCREEN_TRANSPARENCY_NONE
  • the global alpha value is 255 (or opaque)
  • the scale quality is SCREEN_QUALITY_NORMAL.

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).