Gerrit Pathuis / Mbed 2 deprecated Epaper_epd1in54_Waveshare

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers epdpaint.h Source File

epdpaint.h

00001 /**
00002  *  @filename   :   epdpaint.h
00003  *  @brief      :   Header file for epdpaint.cpp
00004  *  @author     :   Yehui from Waveshare
00005  *  
00006  *  Copyright (C) Waveshare     July 28 2017
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining a copy
00009  * of this software and associated documnetation files (the "Software"), to deal
00010  * in the Software without restriction, including without limitation the rights
00011  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00012  * copies of the Software, and to permit persons to  whom the Software is
00013  * furished to do so, subject to the following conditions:
00014  *
00015  * The above copyright notice and this permission notice shall be included in
00016  * all copies or substantial portions of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00021  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00022  * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00023  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00024  * THE SOFTWARE.
00025  */
00026 
00027 #ifndef EPDPAINT_H_
00028 #define EPDPAINT_H_
00029 
00030 // Display orientation
00031 #define ROTATE_0            0
00032 #define ROTATE_90           1
00033 #define ROTATE_180          2
00034 #define ROTATE_270          3
00035 
00036 // Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
00037 #define IF_INVERT_COLOR     1
00038 
00039 #include "fonts.h"
00040 
00041 class Paint {
00042 public:
00043     Paint(unsigned char* image, int width, int height);
00044     ~Paint();
00045     void Clear(int colored);
00046     int  GetWidth(void);
00047     void SetWidth(int width);
00048     int  GetHeight(void);
00049     void SetHeight(int height);
00050     int  GetRotate(void);
00051     void SetRotate(int rotate);
00052     unsigned char* GetImage(void);
00053     void DrawAbsolutePixel(int x, int y, int colored);
00054     void DrawPixel(int x, int y, int colored);
00055     void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored);
00056     void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored);
00057     void DrawLine(int x0, int y0, int x1, int y1, int colored);
00058     void DrawHorizontalLine(int x, int y, int width, int colored);
00059     void DrawVerticalLine(int x, int y, int height, int colored);
00060     void DrawRectangle(int x0, int y0, int x1, int y1, int colored);
00061     void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored);
00062     void DrawCircle(int x, int y, int radius, int colored);
00063     void DrawFilledCircle(int x, int y, int radius, int colored);
00064 
00065 private:
00066     unsigned char* image;
00067     int width;
00068     int height;
00069     int rotate;
00070 };
00071 
00072 #endif
00073 
00074 /* END OF FILE */
00075 
00076