gf_draw_bitmap()

Draw a bitmap

Synopsis:

#include <gf/gf.h>

int gf_draw_bitmap( gf_context_t context,
                    const uint8_t *image,
                    unsigned stride,
                    unsigned bit0_offset,
                    int x,
                    int y,
                    unsigned w,
                    unsigned h,
                    unsigned flags );

Arguments:

context
A handle for the draw context to use.
image
A buffer that contains the bitmap data.
stride
The width of a line of pixel data, in bytes.
bit0_offset
An index into the first byte of the source bitmap. For each scanline of the bitmap that's drawn, this index specifies the bit within the first byte of the scanline's source data that corresponds to the first pixel of the scanline that's drawn.
x, y
The coordinates of the pixel offset within the draw surface where the bitmap is drawn.
w, h
The width and height of the bitmap, in pixels.
flags
Flags affecting rendering. One flag is defined:

Library:

gf

Description:

This function draws a bitmap using the given draw context at the position x, y. Bitmaps are simple, one-bit-per-pixel images that are described by a series of bytes, each packing 8 pixels per byte. There may be padding bytes between successive lines. These padding bytes are accounted for in the stride. The bitmap uses the current foreground color as the “on” color (high bits) and the current background color as the “off” color (low bits — if the transparent member in the bitmap structure isn't set).


Note: This function ignores any ROP and pattern that has been set for the draw context.

Returns:

GF_ERR_OK
Success.
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_blit1(), gf_draw_blit2(), gf_draw_blitscaled()