From 886d280ce1c50d5e9112dd69305dcab96bcce9f1 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Wed, 4 Mar 2026 18:31:53 +1100 Subject: feat(bmp): Create section handler's and implement into handler lookup table --- include/tinyff/image/bmp.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/tinyff/image/bmp.h b/include/tinyff/image/bmp.h index dbc7b3e..1cf9f31 100644 --- a/include/tinyff/image/bmp.h +++ b/include/tinyff/image/bmp.h @@ -54,13 +54,17 @@ typedef struct { ff_bmp_section_handler_ptr handler; } ff_bmp_section_handler; -const ff_bmp_section_handler ff_png_chunk_handlers[] = { - // TODO: Make handlers +ff_result ff_bmp_header_handler(uint8_t *buf, size_t len, ff_bmp_ctx* ctx); +ff_result ff_bmp_info_handler(uint8_t *buf, size_t len, ff_bmp_ctx* ctx); +ff_result ff_bmp_color_handler(uint8_t *buf, size_t len, ff_bmp_ctx* ctx); +ff_result ff_bmp_data_handler(uint8_t *buf, size_t len, ff_bmp_ctx* ctx); + +const ff_bmp_section_handler ff_bmp_section_handlers[] = { - {"Header", NULL}, - {"InfoHeader", NULL}, - {"ColorTable", NULL}, - {"RasterData", NULL}, + {"Header", ff_bmp_header_handler}, + {"InfoHeader", ff_bmp_info_handler}, + {"ColorTable", ff_bmp_color_handler}, + {"RasterData", ff_bmp_data_handler}, {NULL, NULL} // Terminator }; -- cgit v1.2.3