mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

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