Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
GraphicsDisplay.h
00001 /* mbed GraphicsDisplay Display Library Base Class 00002 * Copyright (c) 2007-2009 sford 00003 * Released under the MIT License: http://mbed.org/license/mit 00004 * 00005 * A library for providing a common base class for Graphics displays 00006 * To port a new display, derive from this class and implement 00007 * the constructor (setup the display), pixel (put a pixel 00008 * at a location), width and height functions. Everything else 00009 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) 00010 * will come for free. You can also provide a specialised implementation 00011 * of window and putp to speed up the results 00012 */ 00013 00014 #ifndef MBED_GRAPHICSDISPLAY_H 00015 #define MBED_GRAPHICSDISPLAY_H 00016 00017 #include "../screen/TextDisplay.h" 00018 00019 class GraphicsDisplay : public TextDisplay { 00020 00021 public: 00022 00023 GraphicsDisplay(const char* name); 00024 00025 virtual void pixel(int x, int y, int colour) = 0; 00026 virtual int width() = 0; 00027 virtual int height() = 0; 00028 00029 virtual void window(int x, int y, int w, int h); 00030 virtual void putp(int colour); 00031 00032 virtual void cls(); 00033 virtual void rect(int x0, int y0, int x1, int y1, int colour); 00034 virtual void fillrect(int x0, int y0, int w, int h, int colour); 00035 // fill equals fillrect, name has been kept to not break compatibility 00036 virtual void fill(int x, int y, int w, int h, int colour); 00037 00038 // To draw circle using ellipse, set a and b to the same values 00039 virtual void ellipse(int xc, int yc, int a, int b, unsigned int colour); 00040 virtual void fillellipse(int xc, int yc, int a, int b, unsigned int colour); 00041 virtual void circle(int x, int y, int r, int colour); 00042 00043 virtual void hline(int x0, int x1, int y, int colour); 00044 virtual void vline(int x0, int y0, int y1, int colour); 00045 virtual void line(int x0, int y0, int x1, int y1, int colour); 00046 00047 virtual void blit(int x, int y, int w, int h, const int *colour); 00048 virtual void blitbit(int x, int y, int w, int h, const char* colour); 00049 00050 virtual void character(int column, int row, int value); 00051 virtual int columns(); 00052 virtual int rows(); 00053 00054 protected: 00055 00056 // pixel location 00057 short _x; 00058 short _y; 00059 00060 // window location 00061 short _x1; 00062 short _x2; 00063 short _y1; 00064 short _y2; 00065 00066 }; 00067 00068 #endif
Generated on Fri Jul 15 2022 01:41:58 by
1.7.2