Choose a format
#include <gf/gf.h>
unsigned gf_layer_choose_format (
gf_layer_t layer,
gf_format_t format[],
size_t nformat,
const unsigned * criteria );
- layer
- The handle for the layer, returned by gf_layer_attach().
- format
- An array of gf_format_t that the function fills with the formats that the layer supports and that satisfy the specified criteria.
- nformat
- The size of format array. No more than nformat formats will be returned.
- criteria
- A list of criteria to facilitate the selection of appropriate formats. The list takes the form of an array of unsigned values and is interpreted as a list of key/value pairs. The list must be terminated with a key of GF_NONE (no value needs to be specified). The valid manifests for keys and their corresponding values include:
- GF_2D_RENDERABLE — choose formats based on whether or not they can be rendered to using the 2D engine. The value can be either:
- GF_TRUE — choose formats that can be rendered to using the 2D engine.
- GF_FALSE — choose formats that cannot be rendered to using the 2D engine.
- GF_RED_SIZE — choose formats that support at least “value” bits of red per pixel.
- GF_GREEN_SIZE — choose formats that support at least “value” bits of green per pixel.
- GF_BLUE_SIZE — choose formats that support at least “value” bits of blue per pixel.
- GF_ALPHA_SIZE — choose formats that support at least “value” bits of alpha per pixel.
gf
This function chooses a format based on a layer's capabilities and application requirements.
The number of formats that satisfied the criteria and were placed into the formats array. A 0 means that the layer does not support any formats that satisfy all the specified criteria.
QNX Graphics Framework
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
gf_format_t,
gf_layer_attach()