diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-02 19:32:49 +1100 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-02 19:32:49 +1100 |
| commit | dd5fb05fb732a294727bc595839b274137a7ca06 (patch) | |
| tree | b77d9f5c8c4b5fa40ff871c3d1c50d50bbca703e /include/tinyff/image/bmp.h | |
| parent | e776edfe54ef384535f940c51c8a2798b0322481 (diff) | |
feat(bmp): Make ff_bmp_section_handler lookup table
Diffstat (limited to 'include/tinyff/image/bmp.h')
| -rw-r--r-- | include/tinyff/image/bmp.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/tinyff/image/bmp.h b/include/tinyff/image/bmp.h index bfafcdc..dbc7b3e 100644 --- a/include/tinyff/image/bmp.h +++ b/include/tinyff/image/bmp.h @@ -44,6 +44,27 @@ typedef struct { typedef ff_result (*ff_bmp_section_handler_ptr)(uint8_t *buf, size_t len, ff_bmp_ctx* ctx); +typedef struct { + // Even though the types in bitmaps are invisible (they don't have labels) + // I'll just keep them in for the sake of being in + // And I might just handle the section looping a bit differently + // And their names will be what I saw in the spec + + const char* type; + ff_bmp_section_handler_ptr handler; +} ff_bmp_section_handler; + +const ff_bmp_section_handler ff_png_chunk_handlers[] = { + // TODO: Make handlers + + {"Header", NULL}, + {"InfoHeader", NULL}, + {"ColorTable", NULL}, + {"RasterData", NULL}, + + {NULL, NULL} // Terminator +}; + ff_result ff_bmp_isvalid(ff_stream *stream); ff_result ff_open_bmp(ff_stream *stream, ff_bmp_ctx **out_ctx, ff_flag require_valid); |
