tuupola / hagl

Hardware Agnostic Graphics Library for embedded
https://www.appelsiini.net/tags/hagl/
MIT License
303 stars 49 forks source link

DISPLAY_DEPTH < 8 #47

Closed UncleRus closed 2 years ago

UncleRus commented 3 years ago

How do I write a driver that works with bitmap_t for a 4-bit color display controller? As far as I can see, bitmap_t does not correctly support DISPLAY_DEPTH < 8 bits.

tuupola commented 3 years ago

I have not thought about supporting anything else than multiples of 8 bits yet. This is mostly to keep things simple. Not sure how much 4 bit bitmaps would complicate the code. That said if amount of memory is not a problem then as a workaround even if HAGL internally used 8 bits the HAL could convert the 8 bit colours on the fly to 4 bits before sending them to display.

Which display are you working on btw?

UncleRus commented 3 years ago

SSD1322 - 128x64 4-bit grayscale OLED controller