| 519 | } |
| 520 | |
| 521 | void 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 | |
| 540 | void OLEDDisplay::drawIco16x16(int16_t xMove, int16_t yMove, const uint8_t *ico, bool inverse) { |
| 541 | uint16_t data; |
nothing calls this directly
no test coverage detected