Utility library for HSP SPo2 HR demo including user interface, board support adn accelerometer.
demoUI/screen/GraphicsDisplay.h@0:a12d6976d64c, 2018-12-17 (annotated)
- Committer:
- gmehmet
- Date:
- Mon Dec 17 13:58:56 2018 +0300
- Revision:
- 0:a12d6976d64c
create and put source to HSP demo utility repo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gmehmet | 0:a12d6976d64c | 1 | /* mbed GraphicsDisplay Display Library Base Class |
gmehmet | 0:a12d6976d64c | 2 | * Copyright (c) 2007-2009 sford |
gmehmet | 0:a12d6976d64c | 3 | * Released under the MIT License: http://mbed.org/license/mit |
gmehmet | 0:a12d6976d64c | 4 | * |
gmehmet | 0:a12d6976d64c | 5 | * A library for providing a common base class for Graphics displays |
gmehmet | 0:a12d6976d64c | 6 | * To port a new display, derive from this class and implement |
gmehmet | 0:a12d6976d64c | 7 | * the constructor (setup the display), pixel (put a pixel |
gmehmet | 0:a12d6976d64c | 8 | * at a location), width and height functions. Everything else |
gmehmet | 0:a12d6976d64c | 9 | * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) |
gmehmet | 0:a12d6976d64c | 10 | * will come for free. You can also provide a specialised implementation |
gmehmet | 0:a12d6976d64c | 11 | * of window and putp to speed up the results |
gmehmet | 0:a12d6976d64c | 12 | */ |
gmehmet | 0:a12d6976d64c | 13 | |
gmehmet | 0:a12d6976d64c | 14 | #ifndef MBED_GRAPHICSDISPLAY_H |
gmehmet | 0:a12d6976d64c | 15 | #define MBED_GRAPHICSDISPLAY_H |
gmehmet | 0:a12d6976d64c | 16 | |
gmehmet | 0:a12d6976d64c | 17 | #include "../screen/TextDisplay.h" |
gmehmet | 0:a12d6976d64c | 18 | |
gmehmet | 0:a12d6976d64c | 19 | class GraphicsDisplay : public TextDisplay { |
gmehmet | 0:a12d6976d64c | 20 | |
gmehmet | 0:a12d6976d64c | 21 | public: |
gmehmet | 0:a12d6976d64c | 22 | |
gmehmet | 0:a12d6976d64c | 23 | GraphicsDisplay(const char* name); |
gmehmet | 0:a12d6976d64c | 24 | |
gmehmet | 0:a12d6976d64c | 25 | virtual void pixel(int x, int y, int colour) = 0; |
gmehmet | 0:a12d6976d64c | 26 | virtual int width() = 0; |
gmehmet | 0:a12d6976d64c | 27 | virtual int height() = 0; |
gmehmet | 0:a12d6976d64c | 28 | |
gmehmet | 0:a12d6976d64c | 29 | virtual void window(int x, int y, int w, int h); |
gmehmet | 0:a12d6976d64c | 30 | virtual void putp(int colour); |
gmehmet | 0:a12d6976d64c | 31 | |
gmehmet | 0:a12d6976d64c | 32 | virtual void cls(); |
gmehmet | 0:a12d6976d64c | 33 | virtual void rect(int x0, int y0, int x1, int y1, int colour); |
gmehmet | 0:a12d6976d64c | 34 | virtual void fillrect(int x0, int y0, int w, int h, int colour); |
gmehmet | 0:a12d6976d64c | 35 | // fill equals fillrect, name has been kept to not break compatibility |
gmehmet | 0:a12d6976d64c | 36 | virtual void fill(int x, int y, int w, int h, int colour); |
gmehmet | 0:a12d6976d64c | 37 | |
gmehmet | 0:a12d6976d64c | 38 | // To draw circle using ellipse, set a and b to the same values |
gmehmet | 0:a12d6976d64c | 39 | virtual void ellipse(int xc, int yc, int a, int b, unsigned int colour); |
gmehmet | 0:a12d6976d64c | 40 | virtual void fillellipse(int xc, int yc, int a, int b, unsigned int colour); |
gmehmet | 0:a12d6976d64c | 41 | virtual void circle(int x, int y, int r, int colour); |
gmehmet | 0:a12d6976d64c | 42 | |
gmehmet | 0:a12d6976d64c | 43 | virtual void hline(int x0, int x1, int y, int colour); |
gmehmet | 0:a12d6976d64c | 44 | virtual void vline(int x0, int y0, int y1, int colour); |
gmehmet | 0:a12d6976d64c | 45 | virtual void line(int x0, int y0, int x1, int y1, int colour); |
gmehmet | 0:a12d6976d64c | 46 | |
gmehmet | 0:a12d6976d64c | 47 | virtual void blit(int x, int y, int w, int h, const int *colour); |
gmehmet | 0:a12d6976d64c | 48 | virtual void blitbit(int x, int y, int w, int h, const char* colour); |
gmehmet | 0:a12d6976d64c | 49 | |
gmehmet | 0:a12d6976d64c | 50 | virtual void character(int column, int row, int value); |
gmehmet | 0:a12d6976d64c | 51 | virtual int columns(); |
gmehmet | 0:a12d6976d64c | 52 | virtual int rows(); |
gmehmet | 0:a12d6976d64c | 53 | |
gmehmet | 0:a12d6976d64c | 54 | protected: |
gmehmet | 0:a12d6976d64c | 55 | |
gmehmet | 0:a12d6976d64c | 56 | // pixel location |
gmehmet | 0:a12d6976d64c | 57 | short _x; |
gmehmet | 0:a12d6976d64c | 58 | short _y; |
gmehmet | 0:a12d6976d64c | 59 | |
gmehmet | 0:a12d6976d64c | 60 | // window location |
gmehmet | 0:a12d6976d64c | 61 | short _x1; |
gmehmet | 0:a12d6976d64c | 62 | short _x2; |
gmehmet | 0:a12d6976d64c | 63 | short _y1; |
gmehmet | 0:a12d6976d64c | 64 | short _y2; |
gmehmet | 0:a12d6976d64c | 65 | |
gmehmet | 0:a12d6976d64c | 66 | }; |
gmehmet | 0:a12d6976d64c | 67 | |
gmehmet | 0:a12d6976d64c | 68 | #endif |