bmp-format
Installation
SKILL.md
BMP Format Integration Skill (wlframe/C Style)
When to Apply
Use this skill when implementing, integrating, or reviewing BMP read/write C code in wlframe, especially in image/, buffer/, or related modules.
BMP Format Essentials
- BMP (Bitmap) is a simple, uncompressed or RLE-compressed raster image format.
- File starts with 'BM' signature, followed by file header, DIB header, pixel data.
- Supports various bit depths (1, 4, 8, 16, 24, 32 bpp), optional color palette.
- Rows are aligned to 4-byte boundaries (may include padding).
Integration & API Design
- Parse headers carefully; validate all fields (size, offset, bit depth, compression).
- Support bottom-up (default) and top-down (negative height) row order.
- Handle palette for indexed color images.
- Convert pixel data to wlframe's internal format as needed.
- API prefix:
wlf_bmp_. Useinit/createandfinish/destroypatterns. - Struct layout: hot fields first, group pointers/handles/flags, hide implementation details via
implpointer.