BeRTOS
Defines
gfx_p.h File Reference

Graphics private header. More...

#include <gfx/gfx.h>

Go to the source code of this file.

Defines

#define BM_PLOT(bm, x, y)   ( *BM_ADDR(bm, x, y) |= BM_MASK(bm, x, y) )
 Plot a pixel in bitmap bm.
#define BM_CLEAR(bm, x, y)   ( *BM_ADDR(bm, x, y) &= ~BM_MASK(bm, x, y) )
 Clear a pixel in bitmap bm.
#define BM_DRAWPIXEL(bm, x, y, fg_pen)
 Set a pixel in bitmap bm to the specified color.
#define BM_READPIXEL(bm, x, y)   ( *BM_ADDR(bm, x, y) & BM_MASK(bm, x, y) ? 1 : 0 )
 Get the value of the pixel in bitmap bm.

Detailed Description

Graphics private header.

Author:
Bernie Innocenti <bernie@codewiz.org>

Definition in file gfx_p.h.


Define Documentation

#define BM_CLEAR (   bm,
  x,
 
)    ( *BM_ADDR(bm, x, y) &= ~BM_MASK(bm, x, y) )

Clear a pixel in bitmap bm.

Note:
bm is evaluated twice.
See also:
BM_PLOT BM_DRAWPIXEL

Definition at line 108 of file gfx_p.h.

#define BM_DRAWPIXEL (   bm,
  x,
  y,
  fg_pen 
)
Value:
do { \
        uint8_t *p = BM_ADDR(bm, x, y); \
        uint8_t mask = BM_MASK(bm, x, y); \
        *p = (*p & ~mask) | ((fg_pen) ? mask : 0); \
    } while (0)

Set a pixel in bitmap bm to the specified color.

Note:
bm is evaluated twice.
This macro is somewhat slower than BM_PLOT and BM_CLEAR.
See also:
BM_PLOT BM_CLEAR

Definition at line 118 of file gfx_p.h.

#define BM_PLOT (   bm,
  x,
 
)    ( *BM_ADDR(bm, x, y) |= BM_MASK(bm, x, y) )

Plot a pixel in bitmap bm.

Note:
bm is evaluated twice.
See also:
BM_CLEAR BM_DRAWPIXEL

Definition at line 99 of file gfx_p.h.

#define BM_READPIXEL (   bm,
  x,
 
)    ( *BM_ADDR(bm, x, y) & BM_MASK(bm, x, y) ? 1 : 0 )

Get the value of the pixel in bitmap bm.

Returns:
The returned value is either 0 or 1.
Note:
bm is evaluated twice.
See also:
BM_DRAWPIXEL

Definition at line 133 of file gfx_p.h.