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.
epdpaint.h@0:665e04c85d8d, 2018-03-25 (annotated)
- Committer:
- GerritPathuis
- Date:
- Sun Mar 25 12:14:55 2018 +0000
- Revision:
- 0:665e04c85d8d
- Child:
- 5:3b7204bd6832
Start point
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GerritPathuis | 0:665e04c85d8d | 1 | /** |
GerritPathuis | 0:665e04c85d8d | 2 | * @filename : epdpaint.h |
GerritPathuis | 0:665e04c85d8d | 3 | * @brief : Header file for epdpaint.cpp |
GerritPathuis | 0:665e04c85d8d | 4 | * @author : Yehui from Waveshare |
GerritPathuis | 0:665e04c85d8d | 5 | * |
GerritPathuis | 0:665e04c85d8d | 6 | * Copyright (C) Waveshare July 28 2017 |
GerritPathuis | 0:665e04c85d8d | 7 | * |
GerritPathuis | 0:665e04c85d8d | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
GerritPathuis | 0:665e04c85d8d | 9 | * of this software and associated documnetation files (the "Software"), to deal |
GerritPathuis | 0:665e04c85d8d | 10 | * in the Software without restriction, including without limitation the rights |
GerritPathuis | 0:665e04c85d8d | 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
GerritPathuis | 0:665e04c85d8d | 12 | * copies of the Software, and to permit persons to whom the Software is |
GerritPathuis | 0:665e04c85d8d | 13 | * furished to do so, subject to the following conditions: |
GerritPathuis | 0:665e04c85d8d | 14 | * |
GerritPathuis | 0:665e04c85d8d | 15 | * The above copyright notice and this permission notice shall be included in |
GerritPathuis | 0:665e04c85d8d | 16 | * all copies or substantial portions of the Software. |
GerritPathuis | 0:665e04c85d8d | 17 | * |
GerritPathuis | 0:665e04c85d8d | 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
GerritPathuis | 0:665e04c85d8d | 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
GerritPathuis | 0:665e04c85d8d | 20 | * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
GerritPathuis | 0:665e04c85d8d | 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
GerritPathuis | 0:665e04c85d8d | 22 | * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
GerritPathuis | 0:665e04c85d8d | 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
GerritPathuis | 0:665e04c85d8d | 24 | * THE SOFTWARE. |
GerritPathuis | 0:665e04c85d8d | 25 | */ |
GerritPathuis | 0:665e04c85d8d | 26 | |
GerritPathuis | 0:665e04c85d8d | 27 | #ifndef EPDPAINT_H |
GerritPathuis | 0:665e04c85d8d | 28 | #define EPDPAINT_H |
GerritPathuis | 0:665e04c85d8d | 29 | |
GerritPathuis | 0:665e04c85d8d | 30 | // Display orientation |
GerritPathuis | 0:665e04c85d8d | 31 | #define ROTATE_0 0 |
GerritPathuis | 0:665e04c85d8d | 32 | #define ROTATE_90 1 |
GerritPathuis | 0:665e04c85d8d | 33 | #define ROTATE_180 2 |
GerritPathuis | 0:665e04c85d8d | 34 | #define ROTATE_270 3 |
GerritPathuis | 0:665e04c85d8d | 35 | |
GerritPathuis | 0:665e04c85d8d | 36 | // Color inverse. 1 or 0 = set or reset a bit if set a colored pixel |
GerritPathuis | 0:665e04c85d8d | 37 | #define IF_INVERT_COLOR 1 |
GerritPathuis | 0:665e04c85d8d | 38 | |
GerritPathuis | 0:665e04c85d8d | 39 | #include "fonts.h" |
GerritPathuis | 0:665e04c85d8d | 40 | |
GerritPathuis | 0:665e04c85d8d | 41 | class Paint { |
GerritPathuis | 0:665e04c85d8d | 42 | public: |
GerritPathuis | 0:665e04c85d8d | 43 | Paint(unsigned char* image, int width, int height); |
GerritPathuis | 0:665e04c85d8d | 44 | ~Paint(); |
GerritPathuis | 0:665e04c85d8d | 45 | void Clear(int colored); |
GerritPathuis | 0:665e04c85d8d | 46 | int GetWidth(void); |
GerritPathuis | 0:665e04c85d8d | 47 | void SetWidth(int width); |
GerritPathuis | 0:665e04c85d8d | 48 | int GetHeight(void); |
GerritPathuis | 0:665e04c85d8d | 49 | void SetHeight(int height); |
GerritPathuis | 0:665e04c85d8d | 50 | int GetRotate(void); |
GerritPathuis | 0:665e04c85d8d | 51 | void SetRotate(int rotate); |
GerritPathuis | 0:665e04c85d8d | 52 | unsigned char* GetImage(void); |
GerritPathuis | 0:665e04c85d8d | 53 | void DrawAbsolutePixel(int x, int y, int colored); |
GerritPathuis | 0:665e04c85d8d | 54 | void DrawPixel(int x, int y, int colored); |
GerritPathuis | 0:665e04c85d8d | 55 | void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored); |
GerritPathuis | 0:665e04c85d8d | 56 | void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored); |
GerritPathuis | 0:665e04c85d8d | 57 | void DrawLine(int x0, int y0, int x1, int y1, int colored); |
GerritPathuis | 0:665e04c85d8d | 58 | void DrawHorizontalLine(int x, int y, int width, int colored); |
GerritPathuis | 0:665e04c85d8d | 59 | void DrawVerticalLine(int x, int y, int height, int colored); |
GerritPathuis | 0:665e04c85d8d | 60 | void DrawRectangle(int x0, int y0, int x1, int y1, int colored); |
GerritPathuis | 0:665e04c85d8d | 61 | void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored); |
GerritPathuis | 0:665e04c85d8d | 62 | void DrawCircle(int x, int y, int radius, int colored); |
GerritPathuis | 0:665e04c85d8d | 63 | void DrawFilledCircle(int x, int y, int radius, int colored); |
GerritPathuis | 0:665e04c85d8d | 64 | |
GerritPathuis | 0:665e04c85d8d | 65 | private: |
GerritPathuis | 0:665e04c85d8d | 66 | unsigned char* image; |
GerritPathuis | 0:665e04c85d8d | 67 | int width; |
GerritPathuis | 0:665e04c85d8d | 68 | int height; |
GerritPathuis | 0:665e04c85d8d | 69 | int rotate; |
GerritPathuis | 0:665e04c85d8d | 70 | }; |
GerritPathuis | 0:665e04c85d8d | 71 | |
GerritPathuis | 0:665e04c85d8d | 72 | #endif |
GerritPathuis | 0:665e04c85d8d | 73 | |
GerritPathuis | 0:665e04c85d8d | 74 | /* END OF FILE */ |
GerritPathuis | 0:665e04c85d8d | 75 | |
GerritPathuis | 0:665e04c85d8d | 76 |