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