An mbed library for the Embedded Artists QVGA OLED 2.8 inch panel

Committer:
gbloice
Date:
Wed Mar 09 19:45:23 2011 +0000
Revision:
5:b3f5d19945ff
Parent:
0:ae3d20db48fc
Fixed example with conditional compilation

Who changed what in which revision?

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