A test example using the OLED display on the Embedded Artists Xpresso baseboard

Dependencies:   mbed

Committer:
simon
Date:
Sun Feb 28 16:04:59 2010 +0000
Revision:
0:f42b25503fd1

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:f42b25503fd1 1 /* mbed GraphicsDisplay Display Library Base Class
simon 0:f42b25503fd1 2 * Copyright (c) 2007-2009 sford
simon 0:f42b25503fd1 3 * Released under the MIT License: http://mbed.org/license/mit
simon 0:f42b25503fd1 4 *
simon 0:f42b25503fd1 5 * A library for providing a common base class for Graphics displays
simon 0:f42b25503fd1 6 * To port a new display, derive from this class and implement
simon 0:f42b25503fd1 7 * the constructor (setup the display), pixel (put a pixel
simon 0:f42b25503fd1 8 * at a location), width and height functions. Everything else
simon 0:f42b25503fd1 9 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
simon 0:f42b25503fd1 10 * will come for free. You can also provide a specialised implementation
simon 0:f42b25503fd1 11 * of window and putp to speed up the results
simon 0:f42b25503fd1 12 */
simon 0:f42b25503fd1 13
simon 0:f42b25503fd1 14 #ifndef MBED_GRAPHICSDISPLAY_H
simon 0:f42b25503fd1 15 #define MBED_GRAPHICSDISPLAY_H
simon 0:f42b25503fd1 16
simon 0:f42b25503fd1 17 #include "TextDisplay.h"
simon 0:f42b25503fd1 18
simon 0:f42b25503fd1 19 class GraphicsDisplay : public TextDisplay {
simon 0:f42b25503fd1 20
simon 0:f42b25503fd1 21 public:
simon 0:f42b25503fd1 22
simon 0:f42b25503fd1 23 GraphicsDisplay();
simon 0:f42b25503fd1 24
simon 0:f42b25503fd1 25 virtual void pixel(int x, int y, int colour) = 0;
simon 0:f42b25503fd1 26 virtual int width() = 0;
simon 0:f42b25503fd1 27 virtual int height() = 0;
simon 0:f42b25503fd1 28
simon 0:f42b25503fd1 29 virtual void window(int x, int y, int w, int h);
simon 0:f42b25503fd1 30 virtual void putp(int colour);
simon 0:f42b25503fd1 31
simon 0:f42b25503fd1 32 virtual void cls();
simon 0:f42b25503fd1 33 virtual void fill(int x, int y, int w, int h, int colour);
simon 0:f42b25503fd1 34 virtual void blit(int x, int y, int w, int h, const int *colour);
simon 0:f42b25503fd1 35 virtual void blitbit(int x, int y, int w, int h, const char* colour);
simon 0:f42b25503fd1 36
simon 0:f42b25503fd1 37 virtual void character(int column, int row, int value);
simon 0:f42b25503fd1 38 virtual int columns();
simon 0:f42b25503fd1 39 virtual int rows();
simon 0:f42b25503fd1 40
simon 0:f42b25503fd1 41 protected:
simon 0:f42b25503fd1 42
simon 0:f42b25503fd1 43 // pixel location
simon 0:f42b25503fd1 44 short _x;
simon 0:f42b25503fd1 45 short _y;
simon 0:f42b25503fd1 46
simon 0:f42b25503fd1 47 // window location
simon 0:f42b25503fd1 48 short _x1;
simon 0:f42b25503fd1 49 short _x2;
simon 0:f42b25503fd1 50 short _y1;
simon 0:f42b25503fd1 51 short _y2;
simon 0:f42b25503fd1 52
simon 0:f42b25503fd1 53 };
simon 0:f42b25503fd1 54
simon 0:f42b25503fd1 55 #endif