From 2261b1e46cbc97c8c06b13bfdbc4fec01ad1e998 Mon Sep 17 00:00:00 2001 From: Marc MERLIN Date: Sun, 4 Jan 2015 13:55:42 -0800 Subject: [PATCH] Added support for multicolor pixmaps in drawRGBBitmap. --- Adafruit_GFX.cpp | 14 ++++++++++++++ Adafruit_GFX.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/Adafruit_GFX.cpp b/Adafruit_GFX.cpp index d0dce2c..bfb7492 100644 --- a/Adafruit_GFX.cpp +++ b/Adafruit_GFX.cpp @@ -403,6 +403,20 @@ void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y, } } +// Draw colored bitmap (each pixel is a uint16_t, with colors defined by +// the drawpixel method of your graphical backend. +void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y, + const uint16_t *bitmap, int16_t w, int16_t h) { + int16_t i, j; + + for(j=0; j= 100 size_t Adafruit_GFX::write(uint8_t c) { #else diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index 36396d8..4fd5589 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -52,6 +52,8 @@ class Adafruit_GFX : public Print { int16_t w, int16_t h, uint16_t color, uint16_t bg), drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color), + drawRGBBitmap(int16_t x, int16_t y, const uint16_t *bitmap, + int16_t w, int16_t h), drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size), setCursor(int16_t x, int16_t y),