E_paper, E_ink, Screen size 1.54", resolution 200x200, 4 wire spi, Waveshare, Black and White, Kl25Z, 8 wire print connector, supply 3.3 Volt, IL0373 Controller, font size is 8, 12, 16 and 24.
Diff: epdpaint.h
- Revision:
- 5:3b7204bd6832
- Parent:
- 0:665e04c85d8d
diff -r 8373c3e4f170 -r 3b7204bd6832 epdpaint.h --- a/epdpaint.h Wed Mar 28 08:26:11 2018 +0000 +++ b/epdpaint.h Wed Mar 28 08:28:47 2018 +0000 @@ -1,76 +1,76 @@ -/** - * @filename : epdpaint.h - * @brief : Header file for epdpaint.cpp - * @author : Yehui from Waveshare - * - * Copyright (C) Waveshare July 28 2017 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documnetation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef EPDPAINT_H -#define EPDPAINT_H - -// Display orientation -#define ROTATE_0 0 -#define ROTATE_90 1 -#define ROTATE_180 2 -#define ROTATE_270 3 - -// Color inverse. 1 or 0 = set or reset a bit if set a colored pixel -#define IF_INVERT_COLOR 1 - -#include "fonts.h" - -class Paint { -public: - Paint(unsigned char* image, int width, int height); - ~Paint(); - void Clear(int colored); - int GetWidth(void); - void SetWidth(int width); - int GetHeight(void); - void SetHeight(int height); - int GetRotate(void); - void SetRotate(int rotate); - unsigned char* GetImage(void); - void DrawAbsolutePixel(int x, int y, int colored); - void DrawPixel(int x, int y, int colored); - void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored); - void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored); - void DrawLine(int x0, int y0, int x1, int y1, int colored); - void DrawHorizontalLine(int x, int y, int width, int colored); - void DrawVerticalLine(int x, int y, int height, int colored); - void DrawRectangle(int x0, int y0, int x1, int y1, int colored); - void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored); - void DrawCircle(int x, int y, int radius, int colored); - void DrawFilledCircle(int x, int y, int radius, int colored); - -private: - unsigned char* image; - int width; - int height; - int rotate; -}; - -#endif - -/* END OF FILE */ - +/** + * @filename : epdpaint.h + * @brief : Header file for epdpaint.cpp + * @author : Yehui from Waveshare + * + * Copyright (C) Waveshare July 28 2017 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documnetation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef EPDPAINT_H_ +#define EPDPAINT_H_ + +// Display orientation +#define ROTATE_0 0 +#define ROTATE_90 1 +#define ROTATE_180 2 +#define ROTATE_270 3 + +// Color inverse. 1 or 0 = set or reset a bit if set a colored pixel +#define IF_INVERT_COLOR 1 +#include "fonts.h" + +class Paint { +public: + Paint(unsigned char* image, int width, int height); + ~Paint(); + void Clear(int colored); + int GetWidth(void); + void SetWidth(int width); + int GetHeight(void); + void SetHeight(int height); + int GetRotate(void); + void SetRotate(int rotate); + unsigned char* GetImage(void); + void DrawAbsolutePixel(int x, int y, int colored); + void DrawPixel(int x, int y, int colored); + void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored); + void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored); + void DrawLine(int x0, int y0, int x1, int y1, int colored); + void DrawHorizontalLine(int x, int y, int width, int colored); + void DrawVerticalLine(int x, int y, int height, int colored); + void DrawRectangle(int x0, int y0, int x1, int y1, int colored); + void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored); + void DrawCircle(int x, int y, int radius, int colored); + void DrawFilledCircle(int x, int y, int radius, int colored); + +private: + unsigned char* image; + int width; + int height; + int rotate; +}; + +#endif + +/* END OF FILE */ + +