BeRTOS
Functions
bitmap.c File Reference

Bitmap manipulation routines. More...

#include "gfx.h"
#include "gfx_p.h"
#include "cfg/cfg_gfx.h"
#include <cfg/macros.h>
#include <cfg/debug.h>
#include <cpu/attr.h>
#include <string.h>

Go to the source code of this file.

Functions

void gfx_bitmapInit (Bitmap *bm, uint8_t *raster, coord_t w, coord_t h)
 Initialize a Bitmap structure with the provided parameters.
void gfx_bitmapClear (Bitmap *bm)
 Clear the whole bitmap surface to the background color.
void gfx_blit (Bitmap *dst, const Rect *rect, const Bitmap *src, coord_t srcx, coord_t srcy)
 Copy a rectangular area of a bitmap on another bitmap.
void gfx_blitRaster (Bitmap *dst, coord_t dxmin, coord_t dymin, const uint8_t *raster, coord_t w, coord_t h, coord_t stride)
 Blit a raster to a Bitmap.
void gfx_blitImage (Bitmap *dst, coord_t dxmin, coord_t dymin, const Image *image)
 Blit an Image to a Bitmap.

Detailed Description

Bitmap manipulation routines.

Author:
Bernie Innocenti <bernie@codewiz.org>
Stefano Fedrigo <aleph@develer.com>
See also:
gfx.h

Definition in file bitmap.c.


Function Documentation

void gfx_bitmapClear ( Bitmap bm)

Clear the whole bitmap surface to the background color.

Note:
This function does not update the current pen position.
This function bypasses the current clipping area.

Definition at line 97 of file bitmap.c.

void gfx_bitmapInit ( Bitmap bm,
uint8_t *  raster,
coord_t  w,
coord_t  h 
)

Initialize a Bitmap structure with the provided parameters.

Note:
The pen position is reset to the origin.

Definition at line 62 of file bitmap.c.

void gfx_blit ( Bitmap dst,
const Rect rect,
const Bitmap src,
coord_t  srcx,
coord_t  srcy 
)

Copy a rectangular area of a bitmap on another bitmap.

Blitting is a common copy operation involving two bitmaps. A rectangular area of the source bitmap is copied bit-wise to a different position in the destination bitmap.

Note:
Using the same bitmap for src and dst is unsupported.
Parameters:
dstBitmap where the operation writes.
rectThe (xmin;ymin) coordinates provide the top/left offset for drawing in the destination bitmap. If the source bitmap is larger than the rectangle, drawing is clipped.
srcBitmap containing the source pixels.
srcxStarting X offset in the source bitmap.
srcyStarting Y offset in the source bitmap.

Definition at line 164 of file bitmap.c.

void gfx_blitImage ( Bitmap dst,
coord_t  dxmin,
coord_t  dymin,
const Image image 
)

Blit an Image to a Bitmap.

See also:
gfx_blit()

Definition at line 222 of file bitmap.c.

void gfx_blitRaster ( Bitmap dst,
coord_t  dxmin,
coord_t  dymin,
const uint8_t *  raster,
coord_t  w,
coord_t  h,
coord_t  stride 
)

Blit a raster to a Bitmap.

See also:
gfx_blit()

Definition at line 197 of file bitmap.c.