afiskon / stm32-ssd1306

STM32 library for working with OLEDs based on SSD1306, SH1106, SH1107 and SSD1309, supports I2C and SPI
https://eax.me/stm32-ssd1306/
MIT License
740 stars 206 forks source link

add invert rectangle function #83

Closed kossnikita closed 5 months ago

kossnikita commented 5 months ago

Inverts the color of pixels in rectangle. Useful for progress bar and menu selection.

An optimized algorithm used instead of inverting each pixel by coordinate.

SSD1306_Error_t ssd1306_InvertRectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
afiskon commented 5 months ago

Looks good. Please add a call of the new function to ssd1306_TestAll().

kossnikita commented 5 months ago

Added tests

afiskon commented 5 months ago

👍