summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tinyff/image/bmp.h5
-rw-r--r--src/format/image/bmp.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/include/tinyff/image/bmp.h b/include/tinyff/image/bmp.h
index 1cf9f31..80aaa4d 100644
--- a/include/tinyff/image/bmp.h
+++ b/include/tinyff/image/bmp.h
@@ -11,6 +11,11 @@
#include <tinyff/stream.h>
#include <tinyff/image/generic.h>
+#define FF_BMP_HEADER_SIZE 14
+#define FF_BMP_INFO_SIZE 40
+#define FF_BMP_COLOR_TABLE_SIZE(bpp, clrused) \
+ ((bpp) <= 8 ? (4 * ((clrused) ? (clrused) : (1u << (bpp)))) : 0)
+
static const unsigned char BMP_SIGNATURE[2] = {
'B', 'M'
};
diff --git a/src/format/image/bmp.c b/src/format/image/bmp.c
index 7dfaa76..4a0ca95 100644
--- a/src/format/image/bmp.c
+++ b/src/format/image/bmp.c
@@ -61,4 +61,10 @@ ff_result ff_open_bmp(ff_stream *stream, ff_bmp_ctx **out_ctx, ff_flag require_v
ff_dprintf("bmp: open_bmp reached WIP end\n");
return FF_RESULT_WARN_NO_IMPL;
+}
+
+ff_result ff_bmp_header_handler(uint8_t *buf, size_t len, ff_bmp_ctx *ctx) {
+ if (len != 14) {
+
+ }
} \ No newline at end of file