Theo Bestenlehner / TinyBitmap
Committer:
glx
Date:
Wed Aug 02 10:05:23 2017 +0000
Revision:
2:1cc49c9c552e
Parent:
0:f068fae80257
Child:
3:457eaa2c6ed5
Added documentation.; Released to public :).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
glx 0:f068fae80257 1 #ifndef TINYBITMAP_H_
glx 0:f068fae80257 2 #define TINYBITMAP_H_
glx 0:f068fae80257 3
glx 0:f068fae80257 4 class TinyBitmap
glx 0:f068fae80257 5 {
glx 0:f068fae80257 6 private:
glx 0:f068fae80257 7 int _IMAGEWIDTH;
glx 0:f068fae80257 8 int _IMAGEHEIGHT;
glx 0:f068fae80257 9 int _COMMANDBYTES;
glx 0:f068fae80257 10 int _BITMAPLAYOUT;
glx 0:f068fae80257 11
glx 0:f068fae80257 12 char Bit0;
glx 0:f068fae80257 13 char Bit1;
glx 0:f068fae80257 14 char Bit2;
glx 0:f068fae80257 15 char Bit3;
glx 0:f068fae80257 16 char Bit4;
glx 0:f068fae80257 17 char Bit5;
glx 0:f068fae80257 18 char Bit6;
glx 0:f068fae80257 19 char Bit7;
glx 0:f068fae80257 20
glx 0:f068fae80257 21 public:
glx 2:1cc49c9c552e 22 TinyBitmap(int width, int height, int commandbytes = 0, int bitmaplayout = 0x00);//Constructor; creates a bitmap-handler with the given size and layout, can also leave some space for command-bytes to control a display. The bitmap (char[]) itself has to be created seperately.
glx 0:f068fae80257 23
glx 2:1cc49c9c552e 24 void DrawPixel(char *framebuffer, int x, int y); //Draws a single pixel
glx 2:1cc49c9c552e 25 void DrawLine(char *framebuffer, int x1, int y1, int x2, int y2);//Draws a line between two points
glx 2:1cc49c9c552e 26 void DrawCircle(char *framebuffer, int x, int y, int radius);//Draws a circle
glx 2:1cc49c9c552e 27 void DrawRectangle(char *framebuffer, int x1, int y1, int x2, int y2); //Draws a rectangle. The coordinates are the opposite corners
glx 2:1cc49c9c552e 28 void DrawLineDirection(char *framebuffer, int x, int y, int degree, int lenght); //Draws a line from a point into a direction with a given length. 0° is from the starting point to the right.
glx 2:1cc49c9c552e 29 void DrawText(char *framebuffer, int x, int y, char *CharArray, bool UseLargeFont = false); //Draws basic text in two different sizes on the given location.
glx 2:1cc49c9c552e 30 void ClearScreen(char *framebuffer); //Clears the content of the bitmap to zeros
glx 0:f068fae80257 31 };
glx 0:f068fae80257 32 #endif