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

Method clearPixel

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:157–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void OLEDDisplay::clearPixel(int16_t x, int16_t y) {
158 if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) {
159 switch (color) {
160 case BLACK: buffer[x + (y >> 3) * this->width()] |= (1 << (y & 7)); break;
161 case WHITE: buffer[x + (y >> 3) * this->width()] &= ~(1 << (y & 7)); break;
162 case INVERSE: buffer[x + (y >> 3) * this->width()] ^= (1 << (y & 7)); break;
163 }
164 }
165}
166
167
168// Bresenham's algorithm - thx wikipedia and Adafruit_GFX

Callers

nothing calls this directly

Calls 2

widthMethod · 0.95
heightMethod · 0.95

Tested by

no test coverage detected