A lightweight BMP parser implementation written in Odin.
- Parses BMP file headers and DIB information headers.
- Validates BMP signatures, offsets, image dimensions, and uncompressed pixel data.
- Supports uncompressed BMP files using
BI_RGBcompression. - Extracts 24-bit RGB and 32-bit BGRA pixel values.
- Provides pixel access with BMP row stride and bottom-up row ordering.
- DIB header sizes:
12,40,52,56,108,124 - Compression:
BI_RGB(no compression) - Bits per pixel:
24,32 - Planes:
1
- Indexed 8-bit palette BMP decoding is recognized but not implemented.
- 16-bit BMP pixel extraction is recognized but not implemented.
- Compressed BMP formats are not supported.
- No packaged CLI or installation workflow yet.
- Odin compiler installed.
From the repository root:
odin run main.odinTest scaffolding is available in tests/bmp/bmp_test.odin.
Add concrete assertions and run your Odin test runner.
main.odin— example entry point and parser demo.bmp/— BMP parser implementation and pixel decoding.reader/— memory-mapped BMP reader utility.tests/— test scaffolding for parser behavior.docs/— design notes, audits, and implementation guides.
This project is licensed under the MIT License. See LICENSE.md.