Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ePD_2R13inch_test_program
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 { 00043 public: 00044 Paint(unsigned char* image, int width, int height); 00045 ~Paint(); 00046 void Clear(int colored); 00047 int GetWidth(void); 00048 void SetWidth(int width); 00049 int GetHeight(void); 00050 void SetHeight(int height); 00051 int GetRotate(void); 00052 void SetRotate(int rotate); 00053 unsigned char* GetImage(void); 00054 void DrawAbsolutePixel(int x, int y, int colored); 00055 void DrawPixel(int x, int y, int colored); 00056 void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored); 00057 void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored); 00058 void DrawLine(int x0, int y0, int x1, int y1, int colored); 00059 void DrawHorizontalLine(int x, int y, int width, int colored); 00060 void DrawVerticalLine(int x, int y, int height, int colored); 00061 void DrawRectangle(int x0, int y0, int x1, int y1, int colored); 00062 void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored); 00063 void DrawCircle(int x, int y, int radius, int colored); 00064 void DrawFilledCircle(int x, int y, int radius, int colored); 00065 00066 private: 00067 unsigned char* image; 00068 int width; 00069 int height; 00070 int rotate; 00071 }; 00072 00073 #endif 00074 00075 /* END OF FILE */ 00076
Generated on Sat Jul 16 2022 10:11:16 by
1.7.2