gf_draw_image()

Render an image

Synopsis:

#include <gf/gf.h>

extern int gf_draw_image( gf_context_t context,
                          const uint8_t *pixels,
                          gf_format_t format,
                          unsigned stride,
                          int x,
                          int y,
                          unsigned w,
                          unsigned h,
                          unsigned flags );


Arguments:

context
Handle for the draw context to use.
pixels
A pointer to a buffer that contains the image data.
format
The pixel format of the image. See gf_format_t for supported formats.

Note: The GF_FORMAT_PAL8 format isn't supported by this function.

stride
The image stride, which is the number of bytes per scanline. This is only required if the image height is greater than one.
x, y
The coordinates of the upper-left corner of the destination of the rendered image.
w, h
The width and height of the image, in pixels.
flags
Flags affecting rendering. No flags are currently defined; pass this argument as 0.

Library:

gf

Description:

This function renders an image using the given draw context at the position x, y. There may be padding bytes between successive lines. These padding bytes are accounted for in the stride.


Note: This function is provided for convenience only. It will always use a software blit to render an image, as the type of memory which holds the image data is unknown.

Returns:

GF_ERR_OK
Success.
GF_ERR_PARM
Invalid format.
GF_ERR_NOLOCK
The hardware isn't locked; check to ensure gf_draw_begin() was called successfully.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_draw_bitmap()