From 8815700322c0c10cb0528b047b2c7604c2eeb053 Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen-Phu Date: Sun, 9 Jun 2024 12:59:34 +0700 Subject: 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. --- src/xbm.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/xbm.h (limited to 'src/xbm.h') 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 + +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__ */ -- cgit v1.2.3