MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / drawXbm

Method drawXbm

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:521–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521void OLEDDisplay::drawXbm(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const uint8_t *xbm) {
522 int16_t widthInXbm = (width + 7) / 8;
523 uint8_t data = 0;
524
525 for(int16_t y = 0; y < height; y++) {
526 for(int16_t x = 0; x < width; x++ ) {
527 if (x & 7) {
528 data >>= 1; // Move a bit
529 } else { // Read new data every 8 bit
530 data = pgm_read_byte(xbm + (x / 8) + y * widthInXbm);
531 }
532 // if there is a bit draw it
533 if (data & 0x01) {
534 setPixel(xMove + x, yMove + y);
535 }
536 }
537 }
538}
539
540void OLEDDisplay::drawIco16x16(int16_t xMove, int16_t yMove, const uint8_t *ico, bool inverse) {
541 uint16_t data;

Callers

nothing calls this directly

Calls 1

pgm_read_byteFunction · 0.85

Tested by

no test coverage detected