@@ -462,7 +462,7 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0,
462462// Draw a PROGMEM-resident 1-bit image at the specified (x,y) position,
463463// using the specified foreground color (unset bits are transparent).
464464void Adafruit_GFX::drawBitmap (int16_t x, int16_t y,
465- const uint8_t * bitmap, int16_t w, int16_t h, uint16_t color) {
465+ PROGMEM const uint8_t bitmap[] , int16_t w, int16_t h, uint16_t color) {
466466
467467 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
468468 uint8_t byte = 0 ;
@@ -482,7 +482,8 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
482482// using the specified foreground (for set bits) and background (unset
483483// bits) colors.
484484void Adafruit_GFX::drawBitmap (int16_t x, int16_t y,
485- const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg) {
485+ PROGMEM const uint8_t bitmap[], int16_t w, int16_t h,
486+ uint16_t color, uint16_t bg) {
486487
487488 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
488489 uint8_t byte = 0 ;
@@ -539,9 +540,11 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
539540
540541// Draw PROGMEM-resident XBitMap Files (*.xbm), exported from GIMP,
541542// Usage: Export from GIMP to *.xbm, rename *.xbm to *.c and open in editor.
542- // C Array can be directly used with this function
543+ // C Array can be directly used with this function.
544+ // There is no RAM-resident version of this function; if generating bitmaps
545+ // in RAM, use the format defined by drawBitmap() and call that instead.
543546void Adafruit_GFX::drawXBitmap (int16_t x, int16_t y,
544- const uint8_t * bitmap, int16_t w, int16_t h, uint16_t color) {
547+ PROGMEM const uint8_t bitmap[] , int16_t w, int16_t h, uint16_t color) {
545548
546549 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
547550 uint8_t byte = 0 ;
@@ -563,7 +566,7 @@ void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y,
563566// pos. Specifically for 8-bit display devices such as IS31FL3731;
564567// no color reduction/expansion is performed.
565568void Adafruit_GFX::drawGrayscaleBitmap (int16_t x, int16_t y,
566- const uint8_t * bitmap, int16_t w, int16_t h) {
569+ PROGMEM const uint8_t bitmap[] , int16_t w, int16_t h) {
567570 startWrite ();
568571 for (int16_t j=0 ; j<h; j++, y++) {
569572 for (int16_t i=0 ; i<w; i++ ) {
@@ -593,7 +596,8 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
593596// Specifically for 8-bit display devices such as IS31FL3731;
594597// no color reduction/expansion is performed.
595598void Adafruit_GFX::drawGrayscaleBitmap (int16_t x, int16_t y,
596- const uint8_t *bitmap, const uint8_t *mask, int16_t w, int16_t h) {
599+ PROGMEM const uint8_t bitmap[], PROGMEM const uint8_t mask[],
600+ int16_t w, int16_t h) {
597601 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
598602 uint8_t byte = 0 ;
599603 startWrite ();
@@ -634,7 +638,7 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
634638// Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) at the specified (x,y)
635639// position. For 16-bit display devices; no color reduction performed.
636640void Adafruit_GFX::drawRGBBitmap (int16_t x, int16_t y,
637- const uint16_t * bitmap, int16_t w, int16_t h) {
641+ PROGMEM const uint16_t bitmap[] , int16_t w, int16_t h) {
638642 startWrite ();
639643 for (int16_t j=0 ; j<h; j++, y++) {
640644 for (int16_t i=0 ; i<w; i++ ) {
@@ -662,7 +666,8 @@ void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y,
662666// BOTH buffers (color and mask) must be PROGMEM-resident.
663667// For 16-bit display devices; no color reduction performed.
664668void Adafruit_GFX::drawRGBBitmap (int16_t x, int16_t y,
665- const uint16_t *bitmap, const uint8_t *mask, int16_t w, int16_t h) {
669+ PROGMEM const uint16_t bitmap[], PROGMEM const uint8_t mask[],
670+ int16_t w, int16_t h) {
666671 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
667672 uint8_t byte = 0 ;
668673 startWrite ();
0 commit comments