Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RGB_matrix_Panel RGB_matrix_Panel_modif RGB_matrix_Panel Pmod_OLEDrgb_ALS1_K64F ... more
Diff: Adafruit_GFX.h
- Revision:
- 3:3ffdf181555c
- Parent:
- 2:66a3fe0dc83a
- Child:
- 4:ca74c390a0de
diff -r 66a3fe0dc83a -r 3ffdf181555c Adafruit_GFX.h
--- a/Adafruit_GFX.h Mon May 26 09:14:33 2014 +0000
+++ b/Adafruit_GFX.h Tue May 27 10:47:49 2014 +0000
@@ -1,19 +1,20 @@
#ifndef _ADAFRUIT_GFX_H
#define _ADAFRUIT_GFX_H
+
+#include "mbed.h"
+#include "glcdfont.h"
+
#define BLACK 0
#define WHITE 1
#ifndef _BV
#define _BV(bit) (1<<(bit))
#endif
+#define swap(a, b) { int16_t t = a; a = b; b = t; }
-#define swap(a, b) { int16_t t = a; a = b; b = t; }
-/** Adafruit_GFX class
-* This is the Adafruit_GFX class.\n
-* drawPixel(int16_t x,int16_t y,uint16_t color) needing implementation in derived implementation class
+/** Adafruit_GFX class. This is the Adafruit_GFX class.\n drawPixel(int16_t x,int16_t y,uint16_t color) needing implementation in derived implementation class
*/
class Adafruit_GFX : public Stream
{
-
public:
Adafruit_GFX(int16_t w, int16_t h)
: _rawWidth(w),_rawHeight(h)
@@ -25,21 +26,21 @@
,wrap(true)
{};
- /** @fn void RGBmatrixPanel::drawPixel(int16_t x, int16_t y, uint16_t color) = 0
+ /** @fn void Adafruit_GFX::drawPixel(int16_t x, int16_t y, uint16_t color) = 0
* @bref This MUST be defined by the subclass!
* @param x x
* @param y y
* @param color 16bit color
*/
virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;
-
+// These are overridden for the Stream subclass
virtual int _putc(int value) {
return writeChar(value);
};
virtual int _getc() {
return -1;
};
- /** @fn void RGBmatrixPanel::invertDisplay(bool i)
+ /** @fn void Adafruit_GFX::invertDisplay(bool i)
* @bref Do nothing, must be subclassed if supported
* @param i invert
*/
@@ -55,7 +56,7 @@
virtual void fillScreen(uint16_t color);
//These exist only with Adafruit_GFX (no subclass overrides)
- /** @fn void RGBmatrixPanel::drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
+ /** @fn void Adafruit_GFX::drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
* @bref draw a circle outline from the coordinates of the center.
* @param x0 x position
* @param y0 y position
@@ -64,7 +65,7 @@
*/
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
- /** @fn void RGBmatrixPanel::fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
+ /** @fn void Adafruit_GFX::fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
* @bref draw a circle from the coordinates of the center.
* @param x0 x position
* @param y0 y position
@@ -74,7 +75,7 @@
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
- /** @fn void RGBmatrixPanel::drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
+ /** @fn void Adafruit_GFX::drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
* @bref draw a triangle outline from the vertex with color.
* @param x0 first vertex x
* @param y0 first vertex y
@@ -85,7 +86,7 @@
* @param color 16bit color
*/
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
- /** @fn void RGBmatrixPanel::fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
+ /** @fn void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
* @bref draw a triangle from the vertex with color.
* @param x0 first vertex x
* @param y0 first vertex y
@@ -97,7 +98,7 @@
*/
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
- /** @fn void RGBmatrixPanel::drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
+ /** @fn void Adafruit_GFX::drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
* @bref draw a round rectangle outline with color.
* @param x0 first vertex x
* @param y0 first vertex y
@@ -107,7 +108,7 @@
* @param color 16bit color
*/
void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
- /** @fn void RGBmatrixPanel::drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
+ /** @fn void Adafruit_GFX::drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
* @bref draw a round rectangle with color.
* @param x0 first vertex x
* @param y0 first vertex y