screen_set_buffer_property_*()
Function type:
Immediate execution
Synopsis:
#include <screen/screen.h> int screen_set_buffer_property_cv( screen_buffer_t buf, int pname, int len, const char *param ); int screen_set_buffer_property_iv( screen_buffer_t buf, int pname, const int *param ); int screen_set_buffer_property_llv( screen_buffer_t buf, int pname, const long long *param ); int screen_set_buffer_property_pv( screen_buffer_t buf, int pname, void **param );
Arguments:
- buf
- The handle of the buffer whose property you want to set.
- pname
- The name of the property to set. The properties that you can set with this
function are:
- SCREEN_PROPERTY_BUFFER_SIZE
- A pair of integers containing the width and height of the buffer. param must point to a buffer with enough storage for two integers. This can be set only on buffer handles that are created with screen_create_buffer().
- SCREEN_PROPERTY_FORMAT
- A single integer that indicates the pixel format of the buffer
associated with this buffer. param must point
to a buffer with enough storage for one integer. The format will
be one of:
- SCREEN_FORMAT_BYTE
- SCREEN_FORMAT_RGBA4444
- SCREEN_FORMAT_RGBX4444
- SCREEN_FORMAT_RGBA5551
- SCREEN_FORMAT_RGBX5551
- SCREEN_FORMAT_RGB565
- SCREEN_FORMAT_RGBA8888
- SCREEN_FORMAT_RGBX8888
- SCREEN_FORMAT_YVU9
- SCREEN_FORMAT_YUV420
- SCREEN_FORMAT_NV12
- SCREEN_FORMAT_YV12
- SCREEN_FORMAT_UYVY
- SCREEN_FORMAT_YUY2
- SCREEN_FORMAT_YVYU
- SCREEN_FORMAT_V422
- SCREEN_FORMAT_AYUV
This can be set only on buffer handles that are created with screen_create_buffer()
- SCREEN_PROPERTY_INTERLACED
- A single integer indicating if the buffer contains interlaced fields instead of progressive data. param must point to a buffer with enough storage for one integer.
- SCREEN_PROPERTY_PHYSICALLY_CONTIGUOUS
- A single integer indicating whether the buffer is physically contiguous or not. param must point to a buffer with enough storage for one integer. This can be set only on buffer handles that are created with screen_create_buffer().
- SCREEN_PROPERTY_PLANAR_OFFSETS
- Three integers that provide the offset from the base address for each of the Y, U, and V components of planar YUV formats. param must point to a buffer with enough storage for three integers. This can be set only on buffer handles that are created with screen_create_buffer().
- SCREEN_PROPERTY_POINTER
- A pointer that can be used by software renderers to read from and/or write to the buffer. param must point to a buffer with enough storage for one void pointer. This can be set only on buffer handles that are created with screen_create_buffer().
- SCREEN_PROPERTY_PROTECTED
- A single integer that specifies whether the content of the buffer requires protection or not. param must point to a buffer with enough storage for one integer.
- SCREEN_PROPERTY_STRIDE
- A single integer indicating the number of bytes between the same pixels on adjacent rows. param must point to a buffer with enough storage for one integer. This can be set only on buffer handles that are created with screen_create_buffer()
- param
- A pointer to a buffer containing the new values.
Library:
screen
Description:
These functions set the value of a buffer property from a user-provided array. No more than len bytes will be read from param. Each property must be set with the variant corresponding to the type associated with this property. For example, SCREEN_PROPERTY_STRIDE must be set using the screen_set_buffer_property_iv() function.
The functions and their types are described below:
- screen_set_buffer_property_cv()
- Takes a char value of a given length.
- screen_set_buffer_property_iv()
- Takes an integer value.
- screen_set_buffer_property_llv()
- Takes a long long value.
- screen_set_buffer_property_pv()
- Takes a pointer to an opaque handle type.
Buffer properties can be queried with the screen_get_buffer_property() functions.
Returns:
If the function succeeds, it returns 0 and the value(s) of the buffer property are changed. Otherwise, the function returns -1 and errno is set.
Classification:
Windowing API
Safety | Value |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |