diff options
| author | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-09 12:59:34 +0700 |
|---|---|---|
| committer | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-10 12:34:37 +0700 |
| commit | 8815700322c0c10cb0528b047b2c7604c2eeb053 (patch) | |
| tree | f1ba04d1c18ac01cb671618309f015599e9da782 /src/xbm.h | |
| parent | f6d84a1ead1a57574c45bb80b6fd450c5b784e09 (diff) | |
Add support for .xbm bitmap file
.xbm is easy to include in C as source file. It could be viewed
and edited directly without need to be converted between images
and C array.
Diffstat (limited to 'src/xbm.h')
| -rw-r--r-- | src/xbm.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xbm.h b/src/xbm.h new file mode 100644 index 0000000..b3f2c52 --- /dev/null +++ b/src/xbm.h @@ -0,0 +1,18 @@ +#ifndef __XBM_H__ +#define __XBM_H__ + +#include <stdint.h> + +typedef struct { + uint8_t *bits; + int w; // Width + int h; // Height + int fh; // Frame height +} xbm_t; + +void xbm2fb(xbm_t *xbm, uint16_t *fb, int col, int row); +void xbm2fb_dirty(xbm_t *xbm, uint16_t *fb, int col, int row); +xbm_t *xbm_croph(xbm_t *xbm, xbm_t *frame, int from_row, int to_row); +xbm_t *extract_frame(xbm_t *xbm, xbm_t *frame, int frame_index); + +#endif /* __XBM_H__ */ |