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.
- Version:
- Id
- gfx_p.h 2506 2009-04-15 08:29:07Z duplo
Definition in file gfx_p.h.
Define Documentation
| #define BM_CLEAR | ( | bm, | |||
| x, | |||||
| y | ) | ( *BM_ADDR(bm, x, y) &= ~BM_MASK(bm, x, y) ) |
| #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.
| #define BM_PLOT | ( | bm, | |||
| x, | |||||
| y | ) | ( *BM_ADDR(bm, x, y) |= BM_MASK(bm, x, y) ) |
| #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.
- Returns:
- The returned value is either 0 or 1.
- Note:
- bm is evaluated twice.
- See also:
- BM_DRAWPIXEL
