BarGraph

Dependencies:   mbed

Committer:
Wizo
Date:
Thu Nov 15 17:23:34 2018 +0000
Revision:
0:a4839c6a1bf5
BarGraph

Who changed what in which revision?

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