TEST

Dependencies:   max32630fthr Adafruit_FeatherOLED USBDevice

Committer:
gmehmet
Date:
Wed Apr 10 14:56:25 2019 +0300
Revision:
1:f60eafbf009a
upload from local

Who changed what in which revision?

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