From 501606d57013b4aa60fd152bbaf0157f0df380a1 Mon Sep 17 00:00:00 2001 From: KTOWN Date: Tue, 8 Oct 2013 18:32:31 +0200 Subject: [PATCH] More line helpers --- Adafruit_RA8875.cpp | 30 ++++++++++++++++++++---------- Adafruit_RA8875.h | 4 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Adafruit_RA8875.cpp b/Adafruit_RA8875.cpp index 7e808d4..68e6782 100644 --- a/Adafruit_RA8875.cpp +++ b/Adafruit_RA8875.cpp @@ -242,6 +242,16 @@ void Adafruit_RA8875::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, u } } +void Adafruit_RA8875::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) +{ + drawLine(x, y, x, y+h, color); +} + +void Adafruit_RA8875::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) +{ + drawLine(x, y, x+w, y, color); +} + void Adafruit_RA8875::drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) { rectHelper(x, y, x+w, y+h, color, false); @@ -257,6 +267,16 @@ void Adafruit_RA8875::fillScreen(uint16_t color) rectHelper(0, 0, _width-1, _height-1, color, true); } +void Adafruit_RA8875::drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) +{ + circleHelper(x0, y0, r, color, false); +} + +void Adafruit_RA8875::fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) +{ + circleHelper(x0, y0, r, color, true); +} + void Adafruit_RA8875::circleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t color, bool filled) { /* Set X */ @@ -359,16 +379,6 @@ void Adafruit_RA8875::rectHelper(int16_t x, int16_t y, int16_t w, int16_t h, uin } } -void Adafruit_RA8875::drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) -{ - circleHelper(x0, y0, r, color, false); -} - -void Adafruit_RA8875::fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color) -{ - circleHelper(x0, y0, r, color, true); -} - /************************* Mid Level ***********************************/ void Adafruit_RA8875::GPIOX(boolean on) { diff --git a/Adafruit_RA8875.h b/Adafruit_RA8875.h index 569fdc3..c5b7391 100644 --- a/Adafruit_RA8875.h +++ b/Adafruit_RA8875.h @@ -31,8 +31,8 @@ class Adafruit_RA8875 : public Adafruit_GFX { /* Adafruit_GFX functions */ void drawPixel(int16_t x, int16_t y, uint16_t color); void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); - //void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); - //void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); + void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); + void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); void fillScreen(uint16_t color);