Compare commits
11 Commits
b8ef6b7231
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c34e6931eb | ||
|
|
487054ff76 | ||
|
|
d910980ede | ||
|
|
54fabc151d | ||
|
|
60c6ca83c1 | ||
|
|
7116885f2d | ||
|
|
539a95df61 | ||
|
|
a77b66e4ef | ||
|
|
8325dcfdd8 | ||
|
|
9f1990b977 | ||
|
|
f5ce925153 |
49
.vscode/settings.json
vendored
49
.vscode/settings.json
vendored
@@ -19,5 +19,52 @@
|
|||||||
"cmake.buildBeforeRun": true,
|
"cmake.buildBeforeRun": true,
|
||||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
|
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
|
||||||
"cmake.configureOnOpen": true,
|
"cmake.configureOnOpen": true,
|
||||||
"cortex-debug.gdbPath": "gdb-multiarch"
|
"cortex-debug.gdbPath": "gdb-multiarch",
|
||||||
|
"files.associations": {
|
||||||
|
"array": "cpp",
|
||||||
|
"atomic": "cpp",
|
||||||
|
"bit": "cpp",
|
||||||
|
"*.tcc": "cpp",
|
||||||
|
"cctype": "cpp",
|
||||||
|
"clocale": "cpp",
|
||||||
|
"cmath": "cpp",
|
||||||
|
"cstdarg": "cpp",
|
||||||
|
"cstddef": "cpp",
|
||||||
|
"cstdint": "cpp",
|
||||||
|
"cstdio": "cpp",
|
||||||
|
"cstdlib": "cpp",
|
||||||
|
"cstring": "cpp",
|
||||||
|
"cwchar": "cpp",
|
||||||
|
"cwctype": "cpp",
|
||||||
|
"deque": "cpp",
|
||||||
|
"map": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"vector": "cpp",
|
||||||
|
"exception": "cpp",
|
||||||
|
"algorithm": "cpp",
|
||||||
|
"functional": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"memory": "cpp",
|
||||||
|
"memory_resource": "cpp",
|
||||||
|
"numeric": "cpp",
|
||||||
|
"optional": "cpp",
|
||||||
|
"random": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"string_view": "cpp",
|
||||||
|
"system_error": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"type_traits": "cpp",
|
||||||
|
"utility": "cpp",
|
||||||
|
"fstream": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"iosfwd": "cpp",
|
||||||
|
"istream": "cpp",
|
||||||
|
"limits": "cpp",
|
||||||
|
"new": "cpp",
|
||||||
|
"ostream": "cpp",
|
||||||
|
"sstream": "cpp",
|
||||||
|
"stdexcept": "cpp",
|
||||||
|
"streambuf": "cpp",
|
||||||
|
"typeinfo": "cpp"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#include e-Paper subdirectories
|
#include e-Paper subdirectories
|
||||||
add_subdirectory(epaper)
|
add_subdirectory(epaper)
|
||||||
add_subdirectory(mare)
|
add_subdirectory(mare)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
add_subdirectory(Config)
|
add_subdirectory(Config)
|
||||||
add_subdirectory(e-Paper)
|
add_subdirectory(e-Paper)
|
||||||
add_subdirectory(Fonts)
|
add_subdirectory(Fonts)
|
||||||
add_subdirectory(GUI)
|
|
||||||
|
|||||||
@@ -1375,7 +1375,7 @@ const uint8_t Font12_Table[] =
|
|||||||
0x00, //
|
0x00, //
|
||||||
};
|
};
|
||||||
|
|
||||||
sFONT Font12 = {
|
sFONT Font12_t = {
|
||||||
Font12_Table,
|
Font12_Table,
|
||||||
7, /* Width */
|
7, /* Width */
|
||||||
12, /* Height */
|
12, /* Height */
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* @file Font12.c
|
|
||||||
* @author MCD Application Team
|
|
||||||
* @version V1.0.0
|
|
||||||
* @date 18-February-2014
|
|
||||||
* @brief This file provides text Font12 for STM32xx-EVAL's LCD driver.
|
|
||||||
******************************************************************************
|
|
||||||
* @attention
|
|
||||||
*
|
|
||||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
|
||||||
#include "fonts.h"
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Font data for Courier New 12pt
|
|
||||||
//
|
|
||||||
|
|
||||||
const CH_CN Font12CN_Table[] =
|
|
||||||
{
|
|
||||||
/*-- 文字: 你 --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"你"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xC0,0x1D,0x80,0x3B,0xFF,0x3B,0x07,
|
|
||||||
0x3F,0x77,0x7E,0x76,0xF8,0x70,0xFB,0xFE,0xFB,0xFE,0x3F,0x77,0x3F,0x77,0x3E,0x73,
|
|
||||||
0x38,0x70,0x38,0x70,0x3B,0xE0,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 好 --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"好"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x73,0xFF,0x70,0x0F,0xFE,0x1E,
|
|
||||||
0x7E,0x3C,0x6E,0x38,0xEE,0x30,0xEF,0xFF,0xFC,0x30,0x7C,0x30,0x38,0x30,0x3E,0x30,
|
|
||||||
0x7E,0x30,0xE0,0x30,0xC1,0xF0,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 树 --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"树"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x0E,0x30,0x0E,0x3F,0xEE,0x30,0xEE,
|
|
||||||
0xFC,0xFF,0x76,0xCE,0x77,0xFE,0x7B,0xFE,0xFF,0xFE,0xF3,0xDE,0xF3,0xCE,0x37,0xEE,
|
|
||||||
0x3E,0x6E,0x3C,0x0E,0x30,0x3E,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 莓 --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"莓"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x70,0xFF,0xFF,0x3E,0x70,0x38,0x00,
|
|
||||||
0x7F,0xFF,0xE0,0x00,0xFF,0xFC,0x3B,0x8C,0x39,0xCC,0xFF,0xFF,0x73,0x9C,0x71,0xDC,
|
|
||||||
0x7F,0xFF,0x00,0x1C,0x01,0xF8,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 派 --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"派"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0xFF,0xF0,0x3E,0x00,0x0E,0x1F,
|
|
||||||
0xCF,0xFB,0xFF,0xF8,0x3F,0xFF,0x0F,0xFF,0x7F,0xD8,0x7F,0xDC,0x6F,0xCE,0xED,0xFF,
|
|
||||||
0xFD,0xF7,0xF9,0xC0,0x00,0x00,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: a --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"a"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x3E,0x00,0x67,0x00,0x07,0x80,0x0F,0x80,0x7F,0x80,0xE3,0x80,0xE7,0x80,0xE7,0x80,
|
|
||||||
0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: b --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"b"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,
|
|
||||||
0x7F,0x00,0x7B,0x80,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x7B,0x80,
|
|
||||||
0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: c --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"c"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x3F,0x00,0x73,0x00,0xF0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xF0,0x00,0x73,0x00,
|
|
||||||
0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: A --*/
|
|
||||||
/*-- 微软雅黑12; 此字体下对应的点阵为:宽x高=16x21 --*/
|
|
||||||
{{"A"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1F,0x00,0x1F,0x00,
|
|
||||||
0x1F,0x00,0x3B,0x80,0x3B,0x80,0x71,0x80,0x7F,0xC0,0x71,0xC0,0xE0,0xE0,0xE0,0xE0,
|
|
||||||
0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
|
||||||
};
|
|
||||||
|
|
||||||
cFONT Font12CN = {
|
|
||||||
Font12CN_Table,
|
|
||||||
sizeof(Font12CN_Table)/sizeof(CH_CN), /*size of table*/
|
|
||||||
11, /* ASCII Width */
|
|
||||||
16, /* Width */
|
|
||||||
21, /* Height */
|
|
||||||
};
|
|
||||||
|
|
||||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
||||||
@@ -1755,7 +1755,7 @@ const uint8_t Font16_Table[] =
|
|||||||
0x00, 0x00, //
|
0x00, 0x00, //
|
||||||
};
|
};
|
||||||
|
|
||||||
sFONT Font16 = {
|
sFONT Font16_t = {
|
||||||
Font16_Table,
|
Font16_Table,
|
||||||
11, /* Width */
|
11, /* Width */
|
||||||
16, /* Height */
|
16, /* Height */
|
||||||
|
|||||||
@@ -2133,7 +2133,7 @@ const uint8_t Font20_Table[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
sFONT Font20 = {
|
sFONT Font20_t = {
|
||||||
Font20_Table,
|
Font20_Table,
|
||||||
14, /* Width */
|
14, /* Width */
|
||||||
20, /* Height */
|
20, /* Height */
|
||||||
|
|||||||
@@ -2511,7 +2511,7 @@ const uint8_t Font24_Table [] =
|
|||||||
0x00, 0x00, 0x00, //
|
0x00, 0x00, 0x00, //
|
||||||
};
|
};
|
||||||
|
|
||||||
sFONT Font24 = {
|
sFONT Font24_t = {
|
||||||
Font24_Table,
|
Font24_Table,
|
||||||
17, /* Width */
|
17, /* Width */
|
||||||
24, /* Height */
|
24, /* Height */
|
||||||
|
|||||||
@@ -1,465 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* @file Font12.c
|
|
||||||
* @author MCD Application Team
|
|
||||||
* @version V1.0.0
|
|
||||||
* @date 18-February-2014
|
|
||||||
* @brief This file provides text Font12 for STM32xx-EVAL's LCD driver.
|
|
||||||
******************************************************************************
|
|
||||||
* @attention
|
|
||||||
*
|
|
||||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
|
||||||
#include "fonts.h"
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Font data for Courier New 12pt
|
|
||||||
//
|
|
||||||
|
|
||||||
const CH_CN Font24CN_Table[] =
|
|
||||||
{
|
|
||||||
/*-- 文字: 你 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"你"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC1,0xC0,0x00,
|
|
||||||
0x01,0xE3,0xE0,0x00,0x03,0xE3,0xC0,0x00,0x03,0xC7,0x80,0x00,0x03,0xC7,0xFF,0xFF,
|
|
||||||
0x07,0x8F,0xFF,0xFF,0x07,0x8F,0x00,0x0F,0x0F,0x1E,0x00,0x1E,0x0F,0x3C,0x1E,0x1E,
|
|
||||||
0x1F,0x3C,0x1E,0x3E,0x1F,0x18,0x1E,0x3C,0x3F,0x00,0x1E,0x1C,0x7F,0x00,0x1E,0x00,
|
|
||||||
0x7F,0x07,0x9E,0x70,0xFF,0x07,0x9E,0xF0,0xEF,0x0F,0x9E,0x78,0x6F,0x0F,0x1E,0x78,
|
|
||||||
0x0F,0x0F,0x1E,0x3C,0x0F,0x1E,0x1E,0x3C,0x0F,0x1E,0x1E,0x1E,0x0F,0x3C,0x1E,0x1E,
|
|
||||||
0x0F,0x3C,0x1E,0x1F,0x0F,0x7C,0x1E,0x0F,0x0F,0x78,0x1E,0x0E,0x0F,0x00,0x1E,0x00,
|
|
||||||
0x0F,0x00,0x1E,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x07,0xFC,0x00,0x0F,0x07,0xF8,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 好 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"好"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
|
|
||||||
0x0F,0x07,0xFF,0xFE,0x0F,0x07,0xFF,0xFE,0x0F,0x00,0x00,0x3E,0x1E,0x00,0x00,0xFC,
|
|
||||||
0xFF,0xF8,0x01,0xF0,0xFF,0xF8,0x03,0xE0,0x1E,0x78,0x07,0xC0,0x1E,0x78,0x0F,0x80,
|
|
||||||
0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,
|
|
||||||
0x3C,0x7F,0xFF,0xFF,0x78,0xFF,0xFF,0xFF,0x78,0xF0,0x0F,0x00,0x78,0xF0,0x0F,0x00,
|
|
||||||
0x3D,0xE0,0x0F,0x00,0x1F,0xE0,0x0F,0x00,0x0F,0xE0,0x0F,0x00,0x07,0xC0,0x0F,0x00,
|
|
||||||
0x07,0xE0,0x0F,0x00,0x07,0xF0,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x1E,0x7C,0x0F,0x00,
|
|
||||||
0x3C,0x38,0x0F,0x00,0x78,0x00,0x0F,0x00,0xF0,0x03,0xFF,0x00,0x60,0x01,0xFE,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 微 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"微"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0,
|
|
||||||
0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80,
|
|
||||||
0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E,
|
|
||||||
0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C,
|
|
||||||
0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8,
|
|
||||||
0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0,
|
|
||||||
0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC,
|
|
||||||
0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F,
|
|
||||||
0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 软 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"软"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x03,0xC0,0x78,0x00,0x07,0x80,0x78,0x00,0x07,0x80,0x78,0x00,
|
|
||||||
0x07,0x80,0xF0,0x00,0x0F,0x00,0xF0,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
||||||
0x1E,0x03,0xC0,0x1F,0x1E,0x03,0xC0,0x1E,0x1F,0xE7,0x8F,0x3E,0x3D,0xE7,0x8F,0x3C,
|
|
||||||
0x3D,0xEF,0x0F,0x7C,0x3D,0xE7,0x0F,0x78,0x79,0xE0,0x0F,0x00,0x79,0xE0,0x0E,0x00,
|
|
||||||
0x7F,0xFE,0x0E,0x00,0x7F,0xFE,0x1F,0x00,0x01,0xE0,0x1F,0x00,0x01,0xE0,0x1F,0x00,
|
|
||||||
0x01,0xE0,0x1F,0x80,0x01,0xE0,0x1F,0x80,0x01,0xE0,0x3F,0x80,0x01,0xFF,0x3F,0xC0,
|
|
||||||
0x0F,0xFF,0x7B,0xC0,0xFF,0xF0,0x79,0xE0,0xF9,0xE0,0xF1,0xF0,0x01,0xE1,0xF0,0xF0,
|
|
||||||
0x01,0xE3,0xE0,0xF8,0x01,0xE7,0xC0,0x7C,0x01,0xFF,0x80,0x3F,0x01,0xFF,0x00,0x1F,
|
|
||||||
0x01,0xEC,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 雅 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"雅"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0xFF,0x00,
|
|
||||||
0x7F,0xFC,0xF7,0x80,0x7F,0xFD,0xE3,0xC0,0x01,0xC1,0xE3,0xC0,0x01,0xC3,0xC1,0x80,
|
|
||||||
0x3D,0xC7,0xFF,0xFF,0x39,0xC7,0xFF,0xFF,0x39,0xCF,0x83,0x80,0x79,0xDF,0x83,0x80,
|
|
||||||
0x79,0xFF,0x83,0x80,0x79,0xDF,0x83,0x80,0x71,0xC3,0x83,0x80,0x7F,0xFF,0xFF,0xFE,
|
|
||||||
0x7F,0xFF,0xFF,0xFE,0x03,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80,
|
|
||||||
0x0F,0xC3,0x83,0x80,0x0F,0xC3,0x83,0x80,0x1F,0xC3,0xFF,0xFE,0x1D,0xC3,0xFF,0xFE,
|
|
||||||
0x3D,0xC3,0x83,0x80,0x79,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80,
|
|
||||||
0x61,0xC3,0x83,0x80,0x01,0xC3,0xFF,0xFF,0x03,0xC3,0xFF,0xFF,0x1F,0xC3,0x80,0x00,
|
|
||||||
0x1F,0x83,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 黑 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"黑"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x03,0xC0,0x3C,0x1E,0xC3,0xC7,0x3C,
|
|
||||||
0x1F,0xE3,0xC7,0xBC,0x1E,0xF3,0xCF,0x3C,0x1E,0xFB,0xDF,0x3C,0x1E,0x7B,0xDE,0x3C,
|
|
||||||
0x1E,0x33,0xDC,0x3C,0x1E,0x03,0xC0,0x3C,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,
|
|
||||||
0x1E,0x03,0xC0,0x3C,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x3F,0xFF,0xFF,0xFC,
|
|
||||||
0x3F,0xFF,0xFF,0xFC,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x1C,0x38,0x70,0x70,
|
|
||||||
0x3E,0x78,0xF8,0xF8,0x3C,0x7C,0x78,0x7C,0x7C,0x3C,0x3C,0x3E,0xF8,0x3E,0x3C,0x1F,
|
|
||||||
0xF0,0x1C,0x18,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 此 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"此"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x3C,0x00,
|
|
||||||
0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,
|
|
||||||
0x00,0x78,0x3C,0x0C,0x3C,0x78,0x3C,0x1E,0x3C,0x78,0x3C,0x3F,0x3C,0x78,0x3C,0xF8,
|
|
||||||
0x3C,0x7F,0xFD,0xF0,0x3C,0x7F,0xFF,0xE0,0x3C,0x78,0x3F,0x80,0x3C,0x78,0x3E,0x00,
|
|
||||||
0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,
|
|
||||||
0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x0E,0x3C,0x78,0x3C,0x0F,
|
|
||||||
0x3C,0x78,0x3C,0x0F,0x3C,0x79,0xFC,0x0F,0x3C,0x7F,0xFC,0x0F,0x3F,0xFF,0x3C,0x0F,
|
|
||||||
0x3F,0xF0,0x3E,0x1E,0xFF,0x00,0x1F,0xFE,0xF0,0x00,0x0F,0xFC,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 字 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"字"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00,0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,
|
|
||||||
0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,
|
|
||||||
0x7B,0xFF,0xFF,0xDE,0x03,0xFF,0xFF,0xC0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x3F,0x00,
|
|
||||||
0x00,0x00,0x7E,0x00,0x00,0x01,0xF8,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
|
|
||||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
|
|
||||||
0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
|
|
||||||
0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 体 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"体"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x3C,0x00,
|
|
||||||
0x03,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,
|
|
||||||
0x07,0x80,0x3C,0x00,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x1F,0x01,0xFE,0x00,
|
|
||||||
0x1F,0x01,0xFF,0x00,0x3F,0x01,0xFF,0x00,0x3F,0x03,0xFF,0x00,0x7F,0x03,0xFF,0x80,
|
|
||||||
0x7F,0x07,0xBF,0x80,0xFF,0x07,0xBF,0xC0,0xEF,0x0F,0x3D,0xC0,0xCF,0x0F,0x3D,0xE0,
|
|
||||||
0x0F,0x1E,0x3D,0xE0,0x0F,0x1E,0x3C,0xF0,0x0F,0x3C,0x3C,0x78,0x0F,0x7C,0x3C,0x7C,
|
|
||||||
0x0F,0xF8,0x3C,0x3E,0x0F,0xF7,0xFF,0xDF,0x0F,0xE7,0xFF,0xCF,0x0F,0xC0,0x3C,0x06,
|
|
||||||
0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,
|
|
||||||
0x0F,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 下 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"下"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
|
|
||||||
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
|
|
||||||
0x00,0x0F,0xE0,0x00,0x00,0x0F,0xF8,0x00,0x00,0x0F,0xFC,0x00,0x00,0x0F,0xBF,0x00,
|
|
||||||
0x00,0x0F,0x9F,0x80,0x00,0x0F,0x87,0xE0,0x00,0x0F,0x83,0xF0,0x00,0x0F,0x80,0xF8,
|
|
||||||
0x00,0x0F,0x80,0x7C,0x00,0x0F,0x80,0x38,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
|
|
||||||
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
|
|
||||||
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 对 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"对"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,
|
|
||||||
0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x7F,0xFC,0x00,0x78,0x7F,0xFC,0x00,0x78,
|
|
||||||
0x00,0x3C,0x00,0x78,0x00,0x3F,0xFF,0xFF,0x30,0x3F,0xFF,0xFF,0x78,0x3C,0x00,0x78,
|
|
||||||
0x3C,0x38,0x00,0x78,0x3E,0x78,0x00,0x78,0x1E,0x78,0xC0,0x78,0x0F,0x79,0xE0,0x78,
|
|
||||||
0x0F,0xF0,0xF0,0x78,0x07,0xF0,0xF8,0x78,0x03,0xF0,0x78,0x78,0x01,0xE0,0x3C,0x78,
|
|
||||||
0x03,0xF0,0x3E,0x78,0x03,0xF0,0x18,0x78,0x07,0xF8,0x00,0x78,0x07,0xFC,0x00,0x78,
|
|
||||||
0x0F,0x3E,0x00,0x78,0x1F,0x1E,0x00,0x78,0x3E,0x1F,0x00,0x78,0x7C,0x0E,0x00,0xF8,
|
|
||||||
0xF8,0x00,0x00,0xF0,0xF0,0x00,0x3F,0xF0,0x60,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 应 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"应"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00,
|
|
||||||
0x00,0x01,0xF0,0x00,0x00,0x00,0xF0,0x00,0x1F,0xFF,0xFF,0xFF,0x1F,0xFF,0xFF,0xFF,
|
|
||||||
0x1E,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x1E,0x01,0xE0,0x78,0x1E,0x01,0xE0,0x78,
|
|
||||||
0x1E,0xE1,0xE0,0x78,0x1F,0xF1,0xF0,0xF8,0x1E,0xF0,0xF0,0xF0,0x1E,0xF0,0xF0,0xF0,
|
|
||||||
0x1E,0xF8,0xF0,0xF0,0x1E,0x78,0xF1,0xF0,0x1E,0x78,0xF9,0xE0,0x1E,0x78,0x79,0xE0,
|
|
||||||
0x1E,0x7C,0x7B,0xE0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0,
|
|
||||||
0x3C,0x3E,0x07,0x80,0x3C,0x1C,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,0x0F,0x00,
|
|
||||||
0x78,0x00,0x0F,0x00,0x7B,0xFF,0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,
|
|
||||||
0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 的 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"的"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x3C,0x00,0x07,0xC0,0x3E,0x00,
|
|
||||||
0x07,0x80,0x3C,0x00,0x07,0x80,0x7C,0x00,0x0F,0x00,0x78,0x00,0x7F,0xFE,0x7F,0xFE,
|
|
||||||
0x7F,0xFE,0xFF,0xFE,0x78,0x1E,0xF0,0x1E,0x78,0x1F,0xE0,0x1E,0x78,0x1F,0xE0,0x1E,
|
|
||||||
0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xF0,0x1E,0x78,0x1E,0xF8,0x1E,
|
|
||||||
0x78,0x1E,0x7C,0x1E,0x7F,0xFE,0x3C,0x1E,0x7F,0xFE,0x1E,0x1E,0x78,0x1E,0x1F,0x1E,
|
|
||||||
0x78,0x1E,0x0F,0x9E,0x78,0x1E,0x07,0x9E,0x78,0x1E,0x07,0x1E,0x78,0x1E,0x00,0x1E,
|
|
||||||
0x78,0x1E,0x00,0x1E,0x78,0x1E,0x00,0x3E,0x78,0x1E,0x00,0x3C,0x78,0x1E,0x00,0x3C,
|
|
||||||
0x7F,0xFE,0x00,0x3C,0x7F,0xFE,0x00,0x7C,0x78,0x1E,0x3F,0xF8,0x78,0x1E,0x3F,0xF0,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 点 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"点"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xFF,0xFF,0x00,0x03,0xFF,0xFF,
|
|
||||||
0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,
|
|
||||||
0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,
|
|
||||||
0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x00,0x00,0x00,0x00,
|
|
||||||
0x0C,0x38,0x38,0x30,0x1E,0x7C,0x78,0x78,0x3E,0x3C,0x78,0x78,0x3C,0x3C,0x3C,0x3C,
|
|
||||||
0x7C,0x3E,0x3C,0x3E,0xF8,0x1E,0x3C,0x1E,0xF0,0x1E,0x1E,0x1F,0x70,0x1E,0x1C,0x0E,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 阵 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"阵"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x78,0x00,
|
|
||||||
0x7F,0xF0,0x78,0x00,0x7F,0xF0,0x78,0x00,0x79,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF,
|
|
||||||
0x79,0xE1,0xE0,0x00,0x79,0xE1,0xE0,0x00,0x7B,0xC1,0xEF,0x80,0x7B,0xC3,0xCF,0x80,
|
|
||||||
0x7B,0xC3,0xCF,0x80,0x7F,0x87,0xCF,0x80,0x7F,0x87,0x8F,0x80,0x7F,0x87,0x8F,0x80,
|
|
||||||
0x7B,0xCF,0x0F,0x80,0x7B,0xCF,0xFF,0xFE,0x79,0xEF,0xFF,0xFE,0x79,0xE0,0x0F,0x80,
|
|
||||||
0x78,0xE0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80,
|
|
||||||
0x78,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF,0x7F,0xE0,0x0F,0x80,0x7F,0xC0,0x0F,0x80,
|
|
||||||
0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,
|
|
||||||
0x78,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 为 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"为"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,
|
|
||||||
0x0E,0x07,0x80,0x00,0x1F,0x07,0x80,0x00,0x0F,0x87,0x80,0x00,0x07,0xC7,0x80,0x00,
|
|
||||||
0x01,0xE7,0x80,0x00,0x00,0xC7,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xFC,
|
|
||||||
0x7F,0xFF,0xFF,0xFC,0x00,0x07,0x80,0x3C,0x00,0x0F,0x80,0x3C,0x00,0x0F,0x00,0x3C,
|
|
||||||
0x00,0x0F,0x00,0x3C,0x00,0x0F,0x60,0x3C,0x00,0x1F,0xF0,0x3C,0x00,0x1E,0x78,0x3C,
|
|
||||||
0x00,0x3E,0x3C,0x3C,0x00,0x3C,0x3E,0x3C,0x00,0x7C,0x1F,0x3C,0x00,0x78,0x0F,0x3C,
|
|
||||||
0x00,0xF8,0x06,0x3C,0x01,0xF0,0x00,0x3C,0x03,0xE0,0x00,0x7C,0x07,0xC0,0x00,0x7C,
|
|
||||||
0x0F,0x80,0x00,0x78,0x1F,0x00,0x00,0xF8,0x3E,0x00,0xFF,0xF0,0x7C,0x00,0xFF,0xE0,
|
|
||||||
0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 树 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"树"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x38,
|
|
||||||
0x0F,0x00,0x00,0x38,0x0F,0x00,0x00,0x38,0x0F,0x3F,0xF8,0x38,0x0F,0x3F,0xF8,0x38,
|
|
||||||
0x0F,0x00,0x78,0x38,0xFF,0xE0,0x7F,0xFF,0xFF,0xE0,0x7F,0xFF,0x0F,0x00,0x70,0x38,
|
|
||||||
0x0F,0x18,0xF0,0x38,0x1F,0x3C,0xF0,0x38,0x1F,0x1C,0xFE,0x38,0x1F,0xDE,0xFE,0x38,
|
|
||||||
0x3F,0xEF,0xEF,0x38,0x3F,0xFF,0xEF,0x38,0x3F,0xF7,0xE7,0xB8,0x7F,0x67,0xC7,0xB8,
|
|
||||||
0x7F,0x03,0xC3,0xB8,0xFF,0x07,0xE0,0x38,0xEF,0x07,0xE0,0x38,0xEF,0x0F,0xF0,0x38,
|
|
||||||
0xCF,0x1F,0xF0,0x38,0x0F,0x1E,0x78,0x38,0x0F,0x3C,0x7C,0x38,0x0F,0x78,0x3C,0x38,
|
|
||||||
0x0F,0xF8,0x38,0x38,0x0F,0x60,0x00,0x78,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x07,0xF0,
|
|
||||||
0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 莓 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"莓"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x1E,0x00,0x00,0x3C,0x1E,0x00,
|
|
||||||
0x00,0x3C,0x1E,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x3C,0x1E,0x00,
|
|
||||||
0x07,0xBC,0x1E,0x00,0x07,0x80,0x00,0x00,0x0F,0xFF,0xFF,0xFC,0x0F,0xFF,0xFF,0xFC,
|
|
||||||
0x1E,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF0,
|
|
||||||
0xF7,0xFF,0xFF,0xF0,0x37,0x83,0x80,0xF0,0x07,0x87,0xC0,0xF0,0x07,0x83,0xF0,0xF0,
|
|
||||||
0x07,0x00,0xE0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x00,0xE0,
|
|
||||||
0x0F,0x0F,0x81,0xE0,0x0E,0x03,0xE1,0xE0,0x1E,0x01,0xC1,0xE0,0x1F,0xFF,0xFF,0xFE,
|
|
||||||
0x1F,0xFF,0xFF,0xFE,0x00,0x00,0x01,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0,
|
|
||||||
0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 派 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"派"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x3E,
|
|
||||||
0x7C,0x00,0x3F,0xFE,0x3F,0x3F,0xFF,0xF0,0x1F,0xBF,0xE0,0x00,0x07,0xBC,0x00,0x00,
|
|
||||||
0x03,0x3C,0x00,0x00,0x00,0x3C,0x00,0x3C,0x00,0x3C,0x0F,0xFE,0x70,0x3D,0xFF,0xF8,
|
|
||||||
0xF8,0x3D,0xFF,0x00,0x7C,0x3D,0xE7,0x80,0x3F,0x3D,0xE7,0x80,0x1F,0x3D,0xE7,0x8E,
|
|
||||||
0x0E,0x3D,0xE7,0x9F,0x00,0x3D,0xE7,0xFE,0x00,0x39,0xE7,0xF8,0x00,0x39,0xE3,0xF0,
|
|
||||||
0x1C,0x39,0xE3,0xC0,0x1E,0x79,0xE3,0xC0,0x1E,0x79,0xE1,0xE0,0x1E,0x79,0xE1,0xE0,
|
|
||||||
0x3C,0x79,0xE0,0xF0,0x3C,0x79,0xE0,0xF8,0x3C,0xF1,0xE0,0x7C,0x3C,0xF1,0xE3,0x7C,
|
|
||||||
0x7D,0xF1,0xEF,0x3F,0x79,0xE1,0xFE,0x1F,0x7B,0xE1,0xF8,0x0E,0x7B,0xC3,0xE0,0x00,
|
|
||||||
0x79,0x81,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: A --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{
|
|
||||||
"A"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x7C,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,
|
|
||||||
0x01,0xFF,0x00,0x00,0x01,0xFF,0x00,0x00,0x01,0xEF,0x00,0x00,0x03,0xEF,0x80,0x00,
|
|
||||||
0x03,0xCF,0x80,0x00,0x07,0xC7,0x80,0x00,0x07,0xC7,0xC0,0x00,0x07,0x87,0xC0,0x00,
|
|
||||||
0x0F,0x83,0xE0,0x00,0x0F,0x83,0xE0,0x00,0x0F,0x01,0xE0,0x00,0x1F,0xFF,0xF0,0x00,
|
|
||||||
0x1F,0xFF,0xF0,0x00,0x3F,0xFF,0xF8,0x00,0x3E,0x00,0xF8,0x00,0x3C,0x00,0xF8,0x00,
|
|
||||||
0x7C,0x00,0x7C,0x00,0x7C,0x00,0x7C,0x00,0x78,0x00,0x3C,0x00,0xF8,0x00,0x3E,0x00,
|
|
||||||
0xF8,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: a --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"a"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF8,0x00,0x00,
|
|
||||||
0x1F,0xFE,0x00,0x00,0x3F,0xFE,0x00,0x00,0x3E,0x3F,0x00,0x00,0x38,0x1F,0x00,0x00,
|
|
||||||
0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x03,0xFF,0x00,0x00,0x1F,0xFF,0x00,0x00,
|
|
||||||
0x3F,0x8F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x78,0x1F,0x00,0x00,
|
|
||||||
0x7C,0x1F,0x00,0x00,0x7E,0x7F,0x00,0x00,0x7F,0xFF,0x00,0x00,0x3F,0xFF,0x00,0x00,
|
|
||||||
0x0F,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: b --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"b"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,
|
|
||||||
0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,
|
|
||||||
0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0xFE,0x00,0x00,
|
|
||||||
0x3D,0xFF,0x80,0x00,0x3F,0xFF,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0x07,0xE0,0x00,
|
|
||||||
0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3C,0x01,0xE0,0x00,0x3C,0x01,0xE0,0x00,
|
|
||||||
0x3C,0x01,0xE0,0x00,0x3C,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,
|
|
||||||
0x3F,0x07,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0xFF,0x80,0x00,0x3F,0xFF,0x00,0x00,
|
|
||||||
0x3C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: c --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"c"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,
|
|
||||||
0x07,0xFE,0x00,0x00,0x1F,0xFE,0x00,0x00,0x3F,0x86,0x00,0x00,0x3E,0x00,0x00,0x00,
|
|
||||||
0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
|
|
||||||
0x78,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,
|
|
||||||
0x3E,0x00,0x00,0x00,0x3F,0x86,0x00,0x00,0x1F,0xFE,0x00,0x00,0x0F,0xFE,0x00,0x00,
|
|
||||||
0x03,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 微 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"微"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0,
|
|
||||||
0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80,
|
|
||||||
0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E,
|
|
||||||
0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C,
|
|
||||||
0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8,
|
|
||||||
0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0,
|
|
||||||
0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC,
|
|
||||||
0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F,
|
|
||||||
0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 雪 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"雪"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x78,0x03,0xC0,0x1E,0x78,0x03,0xC0,0x1E,
|
|
||||||
0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
|
|
||||||
0x07,0xFF,0xFF,0xE0,0x07,0xFF,0xFF,0xE0,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,
|
|
||||||
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,
|
|
||||||
0x00,0x00,0x00,0x78,0x3F,0xFF,0xFF,0xF8,0x3F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 电 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"电"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,
|
|
||||||
0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
|
|
||||||
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,
|
|
||||||
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
|
|
||||||
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,
|
|
||||||
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
|
|
||||||
0x78,0x07,0x80,0x0E,0x78,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F,
|
|
||||||
0x00,0x07,0x80,0x1F,0x00,0x07,0x80,0x1E,0x00,0x03,0xFF,0xFE,0x00,0x01,0xFF,0xFC,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
/*-- 文字: 子 --*/
|
|
||||||
/*-- 微软雅黑24; 此字体下对应的点阵为:宽x高=32x41 --*/
|
|
||||||
{{"子"},{
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xF8,0x00,0x00,0x07,0xE0,
|
|
||||||
0x00,0x00,0x0F,0xC0,0x00,0x00,0x1F,0x80,0x00,0x00,0x3E,0x00,0x00,0x00,0xFC,0x00,
|
|
||||||
0x00,0x01,0xF8,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
|
|
||||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
|
|
||||||
0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
|
|
||||||
0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
|
|
||||||
0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00}},
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
cFONT Font24CN = {
|
|
||||||
Font24CN_Table,
|
|
||||||
sizeof(Font24CN_Table)/sizeof(CH_CN), /*size of table*/
|
|
||||||
24, /* ASCII Width */
|
|
||||||
32, /* Width */
|
|
||||||
41, /* Height */
|
|
||||||
};
|
|
||||||
|
|
||||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
||||||
@@ -995,7 +995,7 @@ const uint8_t Font8_Table[] =
|
|||||||
0x00, //
|
0x00, //
|
||||||
};
|
};
|
||||||
|
|
||||||
sFONT Font8 = {
|
const sFONT Font8_t = {
|
||||||
Font8_Table,
|
Font8_Table,
|
||||||
5, /* Width */
|
5, /* Width */
|
||||||
8, /* Height */
|
8, /* Height */
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#ifndef __FONTS_H
|
#ifndef __FONTS_H
|
||||||
#define __FONTS_H
|
#define __FONTS_H
|
||||||
|
|
||||||
/*最大字体微软雅黑24 (32x41) */
|
/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>24 (32x41) */
|
||||||
#define MAX_HEIGHT_FONT 41
|
#define MAX_HEIGHT_FONT 41
|
||||||
#define MAX_WIDTH_FONT 32
|
#define MAX_WIDTH_FONT 32
|
||||||
#define OFFSET_BITMAP
|
#define OFFSET_BITMAP
|
||||||
@@ -55,38 +55,11 @@
|
|||||||
typedef struct _tFont
|
typedef struct _tFont
|
||||||
{
|
{
|
||||||
const uint8_t *table;
|
const uint8_t *table;
|
||||||
uint16_t Width;
|
const uint16_t Width;
|
||||||
uint16_t Height;
|
const uint16_t Height;
|
||||||
|
|
||||||
} sFONT;
|
} sFONT;
|
||||||
|
|
||||||
|
|
||||||
//GB2312
|
|
||||||
typedef struct // 汉字字模数据结构
|
|
||||||
{
|
|
||||||
const char index[2]; // 汉字内码索引
|
|
||||||
const char matrix[MAX_HEIGHT_FONT*MAX_WIDTH_FONT/8+2]; // 点阵码数据
|
|
||||||
}CH_CN;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
const CH_CN *table;
|
|
||||||
uint16_t size;
|
|
||||||
uint16_t ASCII_Width;
|
|
||||||
uint16_t Width;
|
|
||||||
uint16_t Height;
|
|
||||||
|
|
||||||
}cFONT;
|
|
||||||
|
|
||||||
extern sFONT Font24;
|
|
||||||
extern sFONT Font20;
|
|
||||||
extern sFONT Font16;
|
|
||||||
extern sFONT Font12;
|
|
||||||
extern sFONT Font8;
|
|
||||||
|
|
||||||
extern cFONT Font12CN;
|
|
||||||
extern cFONT Font24CN;
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# Find all source files in a single current directory
|
|
||||||
# Save the name to DIR_GUI_SRCS
|
|
||||||
aux_source_directory(. DIR_GUI_SRCS)
|
|
||||||
|
|
||||||
include_directories(../Config)
|
|
||||||
|
|
||||||
# Generate the link library
|
|
||||||
add_library(GUI ${DIR_GUI_SRCS})
|
|
||||||
target_link_libraries(GUI PUBLIC Config)
|
|
||||||
@@ -1,779 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* | File : GUI_Paint.c
|
|
||||||
* | Author : Waveshare electronics
|
|
||||||
* | Function : Achieve drawing: draw points, lines, boxes, circles and
|
|
||||||
* their size, solid dotted line, solid rectangle hollow
|
|
||||||
* rectangle, solid circle hollow circle.
|
|
||||||
* | Info :
|
|
||||||
* Achieve display characters: Display a single character, string, number
|
|
||||||
* Achieve time display: adaptive size display time minutes and seconds
|
|
||||||
*----------------
|
|
||||||
* | This version: V3.2
|
|
||||||
* | Date : 2020-07-10
|
|
||||||
* | Info :
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V3.2(2020-07-10):
|
|
||||||
* 1.Change: Paint_SetScale(UBYTE scale)
|
|
||||||
* Add scale 7 for 5.65f e-Parper
|
|
||||||
* 2.Change: Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
|
|
||||||
* Add the branch for scale 7
|
|
||||||
* 3.Change: Paint_Clear(UWORD Color)
|
|
||||||
* Add the branch for scale 7
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V3.1(2019-10-10):
|
|
||||||
* 1. Add gray level
|
|
||||||
* PAINT Add Scale
|
|
||||||
* 2. Add void Paint_SetScale(UBYTE scale);
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V3.0(2019-04-18):
|
|
||||||
* 1.Change:
|
|
||||||
* Paint_DrawPoint(..., DOT_STYLE DOT_STYLE)
|
|
||||||
* => Paint_DrawPoint(..., DOT_STYLE Dot_Style)
|
|
||||||
* Paint_DrawLine(..., LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawLine(..., DOT_PIXEL Line_width, LINE_STYLE Line_Style)
|
|
||||||
* Paint_DrawRectangle(..., DRAW_FILL Filled, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawRectangle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
|
|
||||||
* Paint_DrawCircle(..., DRAW_FILL Draw_Fill, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawCircle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Filll)
|
|
||||||
*
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V2.0(2018-11-15):
|
|
||||||
* 1.add: Paint_NewImage()
|
|
||||||
* Create an image's properties
|
|
||||||
* 2.add: Paint_SelectImage()
|
|
||||||
* Select the picture to be drawn
|
|
||||||
* 3.add: Paint_SetRotate()
|
|
||||||
* Set the direction of the cache
|
|
||||||
* 4.add: Paint_RotateImage()
|
|
||||||
* Can flip the picture, Support 0-360 degrees,
|
|
||||||
* but only 90.180.270 rotation is better
|
|
||||||
* 4.add: Paint_SetMirroring()
|
|
||||||
* Can Mirroring the picture, horizontal, vertical, origin
|
|
||||||
* 5.add: Paint_DrawString_CN()
|
|
||||||
* Can display Chinese(GB1312)
|
|
||||||
*
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V1.0(2018-07-17):
|
|
||||||
* Create library
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#include "GUI_Paint.h"
|
|
||||||
#include "DEV_Config.h"
|
|
||||||
#include "Debug.h"
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h> //memset()
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
PAINT Paint;
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Create Image
|
|
||||||
parameter:
|
|
||||||
image : Pointer to the image cache
|
|
||||||
width : The width of the picture
|
|
||||||
Height : The height of the picture
|
|
||||||
Color : Whether the picture is inverted
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
|
|
||||||
{
|
|
||||||
Paint.Image = NULL;
|
|
||||||
Paint.Image = image;
|
|
||||||
|
|
||||||
Paint.WidthMemory = Width;
|
|
||||||
Paint.HeightMemory = Height;
|
|
||||||
Paint.Color = Color;
|
|
||||||
Paint.Scale = 2;
|
|
||||||
Paint.WidthByte = (Width % 8 == 0)? (Width / 8 ): (Width / 8 + 1);
|
|
||||||
Paint.HeightByte = Height;
|
|
||||||
// printf("WidthByte = %d, HeightByte = %d\r\n", Paint.WidthByte, Paint.HeightByte);
|
|
||||||
// printf(" EPD_WIDTH / 8 = %d\r\n", 122 / 8);
|
|
||||||
|
|
||||||
Paint.Rotate = Rotate;
|
|
||||||
Paint.Mirror = MIRROR_NONE;
|
|
||||||
|
|
||||||
if(Rotate == ROTATE_0 || Rotate == ROTATE_180) {
|
|
||||||
Paint.Width = Width;
|
|
||||||
Paint.Height = Height;
|
|
||||||
} else {
|
|
||||||
Paint.Width = Height;
|
|
||||||
Paint.Height = Width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Select Image
|
|
||||||
parameter:
|
|
||||||
image : Pointer to the image cache
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_SelectImage(UBYTE *image)
|
|
||||||
{
|
|
||||||
Paint.Image = image;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Select Image Rotate
|
|
||||||
parameter:
|
|
||||||
Rotate : 0,90,180,270
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_SetRotate(UWORD Rotate)
|
|
||||||
{
|
|
||||||
if(Rotate == ROTATE_0 || Rotate == ROTATE_90 || Rotate == ROTATE_180 || Rotate == ROTATE_270) {
|
|
||||||
Debug("Set image Rotate %d\r\n", Rotate);
|
|
||||||
Paint.Rotate = Rotate;
|
|
||||||
} else {
|
|
||||||
Debug("rotate = 0, 90, 180, 270\r\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Select Image mirror
|
|
||||||
parameter:
|
|
||||||
mirror :Not mirror,Horizontal mirror,Vertical mirror,Origin mirror
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_SetMirroring(UBYTE mirror)
|
|
||||||
{
|
|
||||||
if(mirror == MIRROR_NONE || mirror == MIRROR_HORIZONTAL ||
|
|
||||||
mirror == MIRROR_VERTICAL || mirror == MIRROR_ORIGIN) {
|
|
||||||
Debug("mirror image x:%s, y:%s\r\n",(mirror & 0x01)? "mirror":"none", ((mirror >> 1) & 0x01)? "mirror":"none");
|
|
||||||
Paint.Mirror = mirror;
|
|
||||||
} else {
|
|
||||||
Debug("mirror should be MIRROR_NONE, MIRROR_HORIZONTAL, \
|
|
||||||
MIRROR_VERTICAL or MIRROR_ORIGIN\r\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Paint_SetScale(UBYTE scale)
|
|
||||||
{
|
|
||||||
if(scale == 2){
|
|
||||||
Paint.Scale = scale;
|
|
||||||
Paint.WidthByte = (Paint.WidthMemory % 8 == 0)? (Paint.WidthMemory / 8 ): (Paint.WidthMemory / 8 + 1);
|
|
||||||
}else if(scale == 4){
|
|
||||||
Paint.Scale = scale;
|
|
||||||
Paint.WidthByte = (Paint.WidthMemory % 4 == 0)? (Paint.WidthMemory / 4 ): (Paint.WidthMemory / 4 + 1);
|
|
||||||
}else if(scale == 7){//Only applicable with 5in65 e-Paper
|
|
||||||
Paint.Scale = scale;
|
|
||||||
Paint.WidthByte = (Paint.WidthMemory % 2 == 0)? (Paint.WidthMemory / 2 ): (Paint.WidthMemory / 2 + 1);;
|
|
||||||
}else{
|
|
||||||
Debug("Set Scale Input parameter error\r\n");
|
|
||||||
Debug("Scale Only support: 2 4 7\r\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/******************************************************************************
|
|
||||||
function: Draw Pixels
|
|
||||||
parameter:
|
|
||||||
Xpoint : At point X
|
|
||||||
Ypoint : At point Y
|
|
||||||
Color : Painted colors
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
|
|
||||||
{
|
|
||||||
if(Xpoint > Paint.Width || Ypoint > Paint.Height){
|
|
||||||
Debug("Exceeding display boundaries\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UWORD X, Y;
|
|
||||||
switch(Paint.Rotate) {
|
|
||||||
case 0:
|
|
||||||
X = Xpoint;
|
|
||||||
Y = Ypoint;
|
|
||||||
break;
|
|
||||||
case 90:
|
|
||||||
X = Paint.WidthMemory - Ypoint - 1;
|
|
||||||
Y = Xpoint;
|
|
||||||
break;
|
|
||||||
case 180:
|
|
||||||
X = Paint.WidthMemory - Xpoint - 1;
|
|
||||||
Y = Paint.HeightMemory - Ypoint - 1;
|
|
||||||
break;
|
|
||||||
case 270:
|
|
||||||
X = Ypoint;
|
|
||||||
Y = Paint.HeightMemory - Xpoint - 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(Paint.Mirror) {
|
|
||||||
case MIRROR_NONE:
|
|
||||||
break;
|
|
||||||
case MIRROR_HORIZONTAL:
|
|
||||||
X = Paint.WidthMemory - X - 1;
|
|
||||||
break;
|
|
||||||
case MIRROR_VERTICAL:
|
|
||||||
Y = Paint.HeightMemory - Y - 1;
|
|
||||||
break;
|
|
||||||
case MIRROR_ORIGIN:
|
|
||||||
X = Paint.WidthMemory - X - 1;
|
|
||||||
Y = Paint.HeightMemory - Y - 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(X > Paint.WidthMemory || Y > Paint.HeightMemory){
|
|
||||||
Debug("Exceeding display boundaries\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Paint.Scale == 2){
|
|
||||||
UDOUBLE Addr = X / 8 + Y * Paint.WidthByte;
|
|
||||||
UBYTE Rdata = Paint.Image[Addr];
|
|
||||||
if(Color == BLACK)
|
|
||||||
Paint.Image[Addr] = Rdata & ~(0x80 >> (X % 8));
|
|
||||||
else
|
|
||||||
Paint.Image[Addr] = Rdata | (0x80 >> (X % 8));
|
|
||||||
}else if(Paint.Scale == 4){
|
|
||||||
UDOUBLE Addr = X / 4 + Y * Paint.WidthByte;
|
|
||||||
Color = Color % 4;//Guaranteed color scale is 4 --- 0~3
|
|
||||||
UBYTE Rdata = Paint.Image[Addr];
|
|
||||||
|
|
||||||
Rdata = Rdata & (~(0xC0 >> ((X % 4)*2)));//Clear first, then set value
|
|
||||||
Paint.Image[Addr] = Rdata | ((Color << 6) >> ((X % 4)*2));
|
|
||||||
}else if(Paint.Scale == 7){
|
|
||||||
UDOUBLE Addr = X / 2 + Y * Paint.WidthByte;
|
|
||||||
UBYTE Rdata = Paint.Image[Addr];
|
|
||||||
Rdata = Rdata & (~(0xF0 >> ((X % 2)*4)));//Clear first, then set value
|
|
||||||
Paint.Image[Addr] = Rdata | ((Color << 4) >> ((X % 2)*4));
|
|
||||||
// printf("Add = %d ,data = %d\r\n",Addr,Rdata);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Clear the color of the picture
|
|
||||||
parameter:
|
|
||||||
Color : Painted colors
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_Clear(UWORD Color)
|
|
||||||
{
|
|
||||||
if(Paint.Scale == 2 || Paint.Scale == 4){
|
|
||||||
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
|
|
||||||
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte
|
|
||||||
UDOUBLE Addr = X + Y*Paint.WidthByte;
|
|
||||||
Paint.Image[Addr] = Color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else if(Paint.Scale == 7){
|
|
||||||
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
|
|
||||||
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {
|
|
||||||
UDOUBLE Addr = X + Y*Paint.WidthByte;
|
|
||||||
Paint.Image[Addr] = (Color<<4)|Color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Clear the color of a window
|
|
||||||
parameter:
|
|
||||||
Xstart : x starting point
|
|
||||||
Ystart : Y starting point
|
|
||||||
Xend : x end point
|
|
||||||
Yend : y end point
|
|
||||||
Color : Painted colors
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
|
|
||||||
{
|
|
||||||
UWORD X, Y;
|
|
||||||
for (Y = Ystart; Y < Yend; Y++) {
|
|
||||||
for (X = Xstart; X < Xend; X++) {//8 pixel = 1 byte
|
|
||||||
Paint_SetPixel(X, Y, Color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Draw Point(Xpoint, Ypoint) Fill the color
|
|
||||||
parameter:
|
|
||||||
Xpoint : The Xpoint coordinate of the point
|
|
||||||
Ypoint : The Ypoint coordinate of the point
|
|
||||||
Color : Painted color
|
|
||||||
Dot_Pixel : point size
|
|
||||||
Dot_Style : point Style
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color,
|
|
||||||
DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
|
|
||||||
{
|
|
||||||
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
|
|
||||||
Debug("Paint_DrawPoint Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int16_t XDir_Num , YDir_Num;
|
|
||||||
if (Dot_Style == DOT_FILL_AROUND) {
|
|
||||||
for (XDir_Num = 0; XDir_Num < 2 * Dot_Pixel - 1; XDir_Num++) {
|
|
||||||
for (YDir_Num = 0; YDir_Num < 2 * Dot_Pixel - 1; YDir_Num++) {
|
|
||||||
if(Xpoint + XDir_Num - Dot_Pixel < 0 || Ypoint + YDir_Num - Dot_Pixel < 0)
|
|
||||||
break;
|
|
||||||
// printf("x = %d, y = %d\r\n", Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel);
|
|
||||||
Paint_SetPixel(Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel, Color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (XDir_Num = 0; XDir_Num < Dot_Pixel; XDir_Num++) {
|
|
||||||
for (YDir_Num = 0; YDir_Num < Dot_Pixel; YDir_Num++) {
|
|
||||||
Paint_SetPixel(Xpoint + XDir_Num - 1, Ypoint + YDir_Num - 1, Color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Draw a line of arbitrary slope
|
|
||||||
parameter:
|
|
||||||
Xstart :Starting Xpoint point coordinates
|
|
||||||
Ystart :Starting Xpoint point coordinates
|
|
||||||
Xend :End point Xpoint coordinate
|
|
||||||
Yend :End point Ypoint coordinate
|
|
||||||
Color :The color of the line segment
|
|
||||||
Line_width : Line width
|
|
||||||
Line_Style: Solid and dotted lines
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
|
|
||||||
UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style)
|
|
||||||
{
|
|
||||||
if (Xstart > Paint.Width || Ystart > Paint.Height ||
|
|
||||||
Xend > Paint.Width || Yend > Paint.Height) {
|
|
||||||
Debug("Paint_DrawLine Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UWORD Xpoint = Xstart;
|
|
||||||
UWORD Ypoint = Ystart;
|
|
||||||
int dx = (int)Xend - (int)Xstart >= 0 ? Xend - Xstart : Xstart - Xend;
|
|
||||||
int dy = (int)Yend - (int)Ystart <= 0 ? Yend - Ystart : Ystart - Yend;
|
|
||||||
|
|
||||||
// Increment direction, 1 is positive, -1 is counter;
|
|
||||||
int XAddway = Xstart < Xend ? 1 : -1;
|
|
||||||
int YAddway = Ystart < Yend ? 1 : -1;
|
|
||||||
|
|
||||||
//Cumulative error
|
|
||||||
int Esp = dx + dy;
|
|
||||||
char Dotted_Len = 0;
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
Dotted_Len++;
|
|
||||||
//Painted dotted line, 2 point is really virtual
|
|
||||||
if (Line_Style == LINE_STYLE_DOTTED && Dotted_Len % 3 == 0) {
|
|
||||||
//Debug("LINE_DOTTED\r\n");
|
|
||||||
Paint_DrawPoint(Xpoint, Ypoint, IMAGE_BACKGROUND, Line_width, DOT_STYLE_DFT);
|
|
||||||
Dotted_Len = 0;
|
|
||||||
} else {
|
|
||||||
Paint_DrawPoint(Xpoint, Ypoint, Color, Line_width, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
if (2 * Esp >= dy) {
|
|
||||||
if (Xpoint == Xend)
|
|
||||||
break;
|
|
||||||
Esp += dy;
|
|
||||||
Xpoint += XAddway;
|
|
||||||
}
|
|
||||||
if (2 * Esp <= dx) {
|
|
||||||
if (Ypoint == Yend)
|
|
||||||
break;
|
|
||||||
Esp += dx;
|
|
||||||
Ypoint += YAddway;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Draw a rectangle
|
|
||||||
parameter:
|
|
||||||
Xstart :Rectangular Starting Xpoint point coordinates
|
|
||||||
Ystart :Rectangular Starting Xpoint point coordinates
|
|
||||||
Xend :Rectangular End point Xpoint coordinate
|
|
||||||
Yend :Rectangular End point Ypoint coordinate
|
|
||||||
Color :The color of the Rectangular segment
|
|
||||||
Line_width: Line width
|
|
||||||
Draw_Fill : Whether to fill the inside of the rectangle
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
|
|
||||||
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
|
|
||||||
{
|
|
||||||
if (Xstart > Paint.Width || Ystart > Paint.Height ||
|
|
||||||
Xend > Paint.Width || Yend > Paint.Height) {
|
|
||||||
Debug("Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Draw_Fill) {
|
|
||||||
UWORD Ypoint;
|
|
||||||
for(Ypoint = Ystart; Ypoint < Yend; Ypoint++) {
|
|
||||||
Paint_DrawLine(Xstart, Ypoint, Xend, Ypoint, Color , Line_width, LINE_STYLE_SOLID);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Paint_DrawLine(Xstart, Ystart, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
|
|
||||||
Paint_DrawLine(Xstart, Ystart, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
|
|
||||||
Paint_DrawLine(Xend, Yend, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
|
|
||||||
Paint_DrawLine(Xend, Yend, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Use the 8-point method to draw a circle of the
|
|
||||||
specified size at the specified position->
|
|
||||||
parameter:
|
|
||||||
X_Center :Center X coordinate
|
|
||||||
Y_Center :Center Y coordinate
|
|
||||||
Radius :circle Radius
|
|
||||||
Color :The color of the :circle segment
|
|
||||||
Line_width: Line width
|
|
||||||
Draw_Fill : Whether to fill the inside of the Circle
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius,
|
|
||||||
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
|
|
||||||
{
|
|
||||||
if (X_Center > Paint.Width || Y_Center >= Paint.Height) {
|
|
||||||
Debug("Paint_DrawCircle Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Draw a circle from(0, R) as a starting point
|
|
||||||
int16_t XCurrent, YCurrent;
|
|
||||||
XCurrent = 0;
|
|
||||||
YCurrent = Radius;
|
|
||||||
|
|
||||||
//Cumulative error,judge the next point of the logo
|
|
||||||
int16_t Esp = 3 - (Radius << 1 );
|
|
||||||
|
|
||||||
int16_t sCountY;
|
|
||||||
if (Draw_Fill == DRAW_FILL_FULL) {
|
|
||||||
while (XCurrent <= YCurrent ) { //Realistic circles
|
|
||||||
for (sCountY = XCurrent; sCountY <= YCurrent; sCountY ++ ) {
|
|
||||||
Paint_DrawPoint(X_Center + XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//1
|
|
||||||
Paint_DrawPoint(X_Center - XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//2
|
|
||||||
Paint_DrawPoint(X_Center - sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//3
|
|
||||||
Paint_DrawPoint(X_Center - sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//4
|
|
||||||
Paint_DrawPoint(X_Center - XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//5
|
|
||||||
Paint_DrawPoint(X_Center + XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//6
|
|
||||||
Paint_DrawPoint(X_Center + sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//7
|
|
||||||
Paint_DrawPoint(X_Center + sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
if (Esp < 0 )
|
|
||||||
Esp += 4 * XCurrent + 6;
|
|
||||||
else {
|
|
||||||
Esp += 10 + 4 * (XCurrent - YCurrent );
|
|
||||||
YCurrent --;
|
|
||||||
}
|
|
||||||
XCurrent ++;
|
|
||||||
}
|
|
||||||
} else { //Draw a hollow circle
|
|
||||||
while (XCurrent <= YCurrent ) {
|
|
||||||
Paint_DrawPoint(X_Center + XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//1
|
|
||||||
Paint_DrawPoint(X_Center - XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//2
|
|
||||||
Paint_DrawPoint(X_Center - YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//3
|
|
||||||
Paint_DrawPoint(X_Center - YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//4
|
|
||||||
Paint_DrawPoint(X_Center - XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//5
|
|
||||||
Paint_DrawPoint(X_Center + XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//6
|
|
||||||
Paint_DrawPoint(X_Center + YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//7
|
|
||||||
Paint_DrawPoint(X_Center + YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//0
|
|
||||||
|
|
||||||
if (Esp < 0 )
|
|
||||||
Esp += 4 * XCurrent + 6;
|
|
||||||
else {
|
|
||||||
Esp += 10 + 4 * (XCurrent - YCurrent );
|
|
||||||
YCurrent --;
|
|
||||||
}
|
|
||||||
XCurrent ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Show English characters
|
|
||||||
parameter:
|
|
||||||
Xpoint :X coordinate
|
|
||||||
Ypoint :Y coordinate
|
|
||||||
Acsii_Char :To display the English characters
|
|
||||||
Font :A structure pointer that displays a character size
|
|
||||||
Color_Foreground : Select the foreground color
|
|
||||||
Color_Background : Select the background color
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawChar(UWORD Xpoint, UWORD Ypoint, const char Acsii_Char,
|
|
||||||
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
|
|
||||||
{
|
|
||||||
UWORD Page, Column;
|
|
||||||
|
|
||||||
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
|
|
||||||
Debug("Paint_DrawChar Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t Char_Offset = (Acsii_Char - ' ') * Font->Height * (Font->Width / 8 + (Font->Width % 8 ? 1 : 0));
|
|
||||||
const unsigned char *ptr = &Font->table[Char_Offset];
|
|
||||||
|
|
||||||
for (Page = 0; Page < Font->Height; Page ++ ) {
|
|
||||||
for (Column = 0; Column < Font->Width; Column ++ ) {
|
|
||||||
|
|
||||||
//To determine whether the font background color and screen background color is consistent
|
|
||||||
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
|
|
||||||
if (*ptr & (0x80 >> (Column % 8)))
|
|
||||||
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
} else {
|
|
||||||
if (*ptr & (0x80 >> (Column % 8))) {
|
|
||||||
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
} else {
|
|
||||||
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Background);
|
|
||||||
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//One pixel is 8 bits
|
|
||||||
if (Column % 8 == 7)
|
|
||||||
ptr++;
|
|
||||||
}// Write a line
|
|
||||||
if (Font->Width % 8 != 0)
|
|
||||||
ptr++;
|
|
||||||
}// Write all
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Display the string
|
|
||||||
parameter:
|
|
||||||
Xstart :X coordinate
|
|
||||||
Ystart :Y coordinate
|
|
||||||
pString :The first address of the English string to be displayed
|
|
||||||
Font :A structure pointer that displays a character size
|
|
||||||
Color_Foreground : Select the foreground color
|
|
||||||
Color_Background : Select the background color
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
|
|
||||||
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
|
|
||||||
{
|
|
||||||
UWORD Xpoint = Xstart;
|
|
||||||
UWORD Ypoint = Ystart;
|
|
||||||
|
|
||||||
if (Xstart > Paint.Width || Ystart > Paint.Height) {
|
|
||||||
Debug("Paint_DrawString_EN Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (* pString != '\0') {
|
|
||||||
//if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
|
|
||||||
if ((Xpoint + Font->Width ) > Paint.Width ) {
|
|
||||||
Xpoint = Xstart;
|
|
||||||
Ypoint += Font->Height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the Y direction is full, reposition to(Xstart, Ystart)
|
|
||||||
if ((Ypoint + Font->Height ) > Paint.Height ) {
|
|
||||||
Xpoint = Xstart;
|
|
||||||
Ypoint = Ystart;
|
|
||||||
}
|
|
||||||
Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground);
|
|
||||||
|
|
||||||
//The next character of the address
|
|
||||||
pString ++;
|
|
||||||
|
|
||||||
//The next word of the abscissa increases the font of the broadband
|
|
||||||
Xpoint += Font->Width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Display the string
|
|
||||||
parameter:
|
|
||||||
Xstart :X coordinate
|
|
||||||
Ystart :Y coordinate
|
|
||||||
pString :The first address of the Chinese string and English
|
|
||||||
string to be displayed
|
|
||||||
Font :A structure pointer that displays a character size
|
|
||||||
Color_Foreground : Select the foreground color
|
|
||||||
Color_Background : Select the background color
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font,
|
|
||||||
UWORD Color_Foreground, UWORD Color_Background)
|
|
||||||
{
|
|
||||||
const char* p_text = pString;
|
|
||||||
int x = Xstart, y = Ystart;
|
|
||||||
int i, j,Num;
|
|
||||||
|
|
||||||
/* Send the string character by character on EPD */
|
|
||||||
while (*p_text != 0) {
|
|
||||||
if(*p_text <= 0x7F) { //ASCII < 126
|
|
||||||
for(Num = 0; Num < font->size; Num++) {
|
|
||||||
if(*p_text== font->table[Num].index[0]) {
|
|
||||||
const char* ptr = &font->table[Num].matrix[0];
|
|
||||||
|
|
||||||
for (j = 0; j < font->Height; j++) {
|
|
||||||
for (i = 0; i < font->Width; i++) {
|
|
||||||
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
|
|
||||||
if (*ptr & (0x80 >> (i % 8))) {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (*ptr & (0x80 >> (i % 8))) {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
} else {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Background);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i % 8 == 7) {
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (font->Width % 8 != 0) {
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Point on the next character */
|
|
||||||
p_text += 1;
|
|
||||||
/* Decrement the column position by 16 */
|
|
||||||
x += font->ASCII_Width;
|
|
||||||
} else { //Chinese
|
|
||||||
for(Num = 0; Num < font->size; Num++) {
|
|
||||||
if((*p_text== font->table[Num].index[0]) && (*(p_text+1) == font->table[Num].index[1])) {
|
|
||||||
const char* ptr = &font->table[Num].matrix[0];
|
|
||||||
|
|
||||||
for (j = 0; j < font->Height; j++) {
|
|
||||||
for (i = 0; i < font->Width; i++) {
|
|
||||||
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
|
|
||||||
if (*ptr & (0x80 >> (i % 8))) {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (*ptr & (0x80 >> (i % 8))) {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Foreground);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
} else {
|
|
||||||
Paint_SetPixel(x + i, y + j, Color_Background);
|
|
||||||
// Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i % 8 == 7) {
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (font->Width % 8 != 0) {
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Point on the next character */
|
|
||||||
p_text += 2;
|
|
||||||
/* Decrement the column position by 16 */
|
|
||||||
x += font->Width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Display nummber
|
|
||||||
parameter:
|
|
||||||
Xstart :X coordinate
|
|
||||||
Ystart : Y coordinate
|
|
||||||
Nummber : The number displayed
|
|
||||||
Font :A structure pointer that displays a character size
|
|
||||||
Color_Foreground : Select the foreground color
|
|
||||||
Color_Background : Select the background color
|
|
||||||
******************************************************************************/
|
|
||||||
#define ARRAY_LEN 255
|
|
||||||
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber,
|
|
||||||
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t Num_Bit = 0, Str_Bit = 0;
|
|
||||||
uint8_t Str_Array[ARRAY_LEN] = {0}, Num_Array[ARRAY_LEN] = {0};
|
|
||||||
uint8_t *pStr = Str_Array;
|
|
||||||
|
|
||||||
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
|
|
||||||
Debug("Paint_DisNum Input exceeds the normal display range\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Converts a number to a string
|
|
||||||
while (Nummber) {
|
|
||||||
Num_Array[Num_Bit] = Nummber % 10 + '0';
|
|
||||||
Num_Bit++;
|
|
||||||
Nummber /= 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
//The string is inverted
|
|
||||||
while (Num_Bit > 0) {
|
|
||||||
Str_Array[Str_Bit] = Num_Array[Num_Bit - 1];
|
|
||||||
Str_Bit ++;
|
|
||||||
Num_Bit --;
|
|
||||||
}
|
|
||||||
|
|
||||||
//show
|
|
||||||
Paint_DrawString_EN(Xpoint, Ypoint, (const char*)pStr, Font, Color_Background, Color_Foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Display time
|
|
||||||
parameter:
|
|
||||||
Xstart :X coordinate
|
|
||||||
Ystart : Y coordinate
|
|
||||||
pTime : Time-related structures
|
|
||||||
Font :A structure pointer that displays a character size
|
|
||||||
Color_Foreground : Select the foreground color
|
|
||||||
Color_Background : Select the background color
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font,
|
|
||||||
UWORD Color_Foreground, UWORD Color_Background)
|
|
||||||
{
|
|
||||||
uint8_t value[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
|
|
||||||
|
|
||||||
UWORD Dx = Font->Width;
|
|
||||||
|
|
||||||
//Write data into the cache
|
|
||||||
Paint_DrawChar(Xstart , Ystart, value[pTime->Hour / 10], Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx , Ystart, value[pTime->Hour % 10], Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx + Dx / 4 + Dx / 2 , Ystart, ':' , Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx * 2 + Dx / 2 , Ystart, value[pTime->Min / 10] , Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx * 3 + Dx / 2 , Ystart, value[pTime->Min % 10] , Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx * 4 + Dx / 2 - Dx / 4, Ystart, ':' , Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx * 5 , Ystart, value[pTime->Sec / 10] , Font, Color_Background, Color_Foreground);
|
|
||||||
Paint_DrawChar(Xstart + Dx * 6 , Ystart, value[pTime->Sec % 10] , Font, Color_Background, Color_Foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
function: Display monochrome bitmap
|
|
||||||
parameter:
|
|
||||||
image_buffer :A picture data converted to a bitmap
|
|
||||||
info:
|
|
||||||
Use a computer to convert the image into a corresponding array,
|
|
||||||
and then embed the array directly into Imagedata.cpp as a .c file.
|
|
||||||
******************************************************************************/
|
|
||||||
void Paint_DrawBitMap(const unsigned char* image_buffer)
|
|
||||||
{
|
|
||||||
UWORD x, y;
|
|
||||||
UDOUBLE Addr = 0;
|
|
||||||
|
|
||||||
for (y = 0; y < Paint.HeightByte; y++) {
|
|
||||||
for (x = 0; x < Paint.WidthByte; x++) {//8 pixel = 1 byte
|
|
||||||
Addr = x + y * Paint.WidthByte;
|
|
||||||
Paint.Image[Addr] = (unsigned char)image_buffer[Addr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,215 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* | File : GUI_Paint.h
|
|
||||||
* | Author : Waveshare electronics
|
|
||||||
* | Function : Achieve drawing: draw points, lines, boxes, circles and
|
|
||||||
* their size, solid dotted line, solid rectangle hollow
|
|
||||||
* rectangle, solid circle hollow circle.
|
|
||||||
* | Info :
|
|
||||||
* Achieve display characters: Display a single character, string, number
|
|
||||||
* Achieve time display: adaptive size display time minutes and seconds
|
|
||||||
*----------------
|
|
||||||
* | This version: V3.1
|
|
||||||
* | Date : 2019-10-10
|
|
||||||
* | Info :
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V3.1(2019-10-10):
|
|
||||||
* 1. Add gray level
|
|
||||||
* PAINT Add Scale
|
|
||||||
* 2. Add void Paint_SetScale(UBYTE scale);
|
|
||||||
*
|
|
||||||
* V3.0(2019-04-18):
|
|
||||||
* 1.Change:
|
|
||||||
* Paint_DrawPoint(..., DOT_STYLE DOT_STYLE)
|
|
||||||
* => Paint_DrawPoint(..., DOT_STYLE Dot_Style)
|
|
||||||
* Paint_DrawLine(..., LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawLine(..., DOT_PIXEL Line_width, LINE_STYLE Line_Style)
|
|
||||||
* Paint_DrawRectangle(..., DRAW_FILL Filled, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawRectangle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
|
|
||||||
* Paint_DrawCircle(..., DRAW_FILL Draw_Fill, DOT_PIXEL Dot_Pixel)
|
|
||||||
* => Paint_DrawCircle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Filll)
|
|
||||||
*
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V2.0(2018-11-15):
|
|
||||||
* 1.add: Paint_NewImage()
|
|
||||||
* Create an image's properties
|
|
||||||
* 2.add: Paint_SelectImage()
|
|
||||||
* Select the picture to be drawn
|
|
||||||
* 3.add: Paint_SetRotate()
|
|
||||||
* Set the direction of the cache
|
|
||||||
* 4.add: Paint_RotateImage()
|
|
||||||
* Can flip the picture, Support 0-360 degrees,
|
|
||||||
* but only 90.180.270 rotation is better
|
|
||||||
* 4.add: Paint_SetMirroring()
|
|
||||||
* Can Mirroring the picture, horizontal, vertical, origin
|
|
||||||
* 5.add: Paint_DrawString_CN()
|
|
||||||
* Can display Chinese(GB1312)
|
|
||||||
*
|
|
||||||
* -----------------------------------------------------------------------------
|
|
||||||
* V1.0(2018-07-17):
|
|
||||||
* Create library
|
|
||||||
*
|
|
||||||
* 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 __GUI_PAINT_H
|
|
||||||
#define __GUI_PAINT_H
|
|
||||||
|
|
||||||
#include "DEV_Config.h"
|
|
||||||
#include "../Fonts/fonts.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Image attributes
|
|
||||||
**/
|
|
||||||
typedef struct {
|
|
||||||
UBYTE *Image;
|
|
||||||
UWORD Width;
|
|
||||||
UWORD Height;
|
|
||||||
UWORD WidthMemory;
|
|
||||||
UWORD HeightMemory;
|
|
||||||
UWORD Color;
|
|
||||||
UWORD Rotate;
|
|
||||||
UWORD Mirror;
|
|
||||||
UWORD WidthByte;
|
|
||||||
UWORD HeightByte;
|
|
||||||
UWORD Scale;
|
|
||||||
} PAINT;
|
|
||||||
extern PAINT Paint;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display rotate
|
|
||||||
**/
|
|
||||||
#define ROTATE_0 0
|
|
||||||
#define ROTATE_90 90
|
|
||||||
#define ROTATE_180 180
|
|
||||||
#define ROTATE_270 270
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display Flip
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
MIRROR_NONE = 0x00,
|
|
||||||
MIRROR_HORIZONTAL = 0x01,
|
|
||||||
MIRROR_VERTICAL = 0x02,
|
|
||||||
MIRROR_ORIGIN = 0x03,
|
|
||||||
} MIRROR_IMAGE;
|
|
||||||
#define MIRROR_IMAGE_DFT MIRROR_NONE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* image color
|
|
||||||
**/
|
|
||||||
#define WHITE 0xFF
|
|
||||||
#define BLACK 0x00
|
|
||||||
#define RED BLACK
|
|
||||||
|
|
||||||
#define IMAGE_BACKGROUND WHITE
|
|
||||||
#define FONT_FOREGROUND BLACK
|
|
||||||
#define FONT_BACKGROUND WHITE
|
|
||||||
|
|
||||||
//4 Gray level
|
|
||||||
#define GRAY1 0x03 //Blackest
|
|
||||||
#define GRAY2 0x02
|
|
||||||
#define GRAY3 0x01 //gray
|
|
||||||
#define GRAY4 0x00 //white
|
|
||||||
/**
|
|
||||||
* The size of the point
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
DOT_PIXEL_1X1 = 1, // 1 x 1
|
|
||||||
DOT_PIXEL_2X2 , // 2 X 2
|
|
||||||
DOT_PIXEL_3X3 , // 3 X 3
|
|
||||||
DOT_PIXEL_4X4 , // 4 X 4
|
|
||||||
DOT_PIXEL_5X5 , // 5 X 5
|
|
||||||
DOT_PIXEL_6X6 , // 6 X 6
|
|
||||||
DOT_PIXEL_7X7 , // 7 X 7
|
|
||||||
DOT_PIXEL_8X8 , // 8 X 8
|
|
||||||
} DOT_PIXEL;
|
|
||||||
#define DOT_PIXEL_DFT DOT_PIXEL_1X1 //Default dot pilex
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Point size fill style
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
DOT_FILL_AROUND = 1, // dot pixel 1 x 1
|
|
||||||
DOT_FILL_RIGHTUP , // dot pixel 2 X 2
|
|
||||||
} DOT_STYLE;
|
|
||||||
#define DOT_STYLE_DFT DOT_FILL_AROUND //Default dot pilex
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Line style, solid or dashed
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
LINE_STYLE_SOLID = 0,
|
|
||||||
LINE_STYLE_DOTTED,
|
|
||||||
} LINE_STYLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the graphic is filled
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
DRAW_FILL_EMPTY = 0,
|
|
||||||
DRAW_FILL_FULL,
|
|
||||||
} DRAW_FILL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom structure of a time attribute
|
|
||||||
**/
|
|
||||||
typedef struct {
|
|
||||||
UWORD Year; //0000
|
|
||||||
UBYTE Month; //1 - 12
|
|
||||||
UBYTE Day; //1 - 30
|
|
||||||
UBYTE Hour; //0 - 23
|
|
||||||
UBYTE Min; //0 - 59
|
|
||||||
UBYTE Sec; //0 - 59
|
|
||||||
} PAINT_TIME;
|
|
||||||
extern PAINT_TIME sPaint_time;
|
|
||||||
|
|
||||||
//init and Clear
|
|
||||||
void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color);
|
|
||||||
void Paint_SelectImage(UBYTE *image);
|
|
||||||
void Paint_SetRotate(UWORD Rotate);
|
|
||||||
void Paint_SetMirroring(UBYTE mirror);
|
|
||||||
void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color);
|
|
||||||
void Paint_SetScale(UBYTE scale);
|
|
||||||
|
|
||||||
void Paint_Clear(UWORD Color);
|
|
||||||
void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color);
|
|
||||||
|
|
||||||
//Drawing
|
|
||||||
void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_FillWay);
|
|
||||||
void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style);
|
|
||||||
void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill);
|
|
||||||
void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill);
|
|
||||||
|
|
||||||
//Display string
|
|
||||||
void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Acsii_Char, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
|
|
||||||
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
|
|
||||||
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground, UWORD Color_Background);
|
|
||||||
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
|
|
||||||
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
|
|
||||||
|
|
||||||
//pic
|
|
||||||
void Paint_DrawBitMap(const unsigned char* image_buffer);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
# Find all source files in a single current directory
|
# Find all source files in a single current directory
|
||||||
|
|
||||||
# Save the name to DIR_Config_SRCS
|
# Save the name to DIR_Config_SRCS
|
||||||
aux_source_directory(. DIR_Config_SRCS)
|
aux_source_directory(. DIR_Config_SRCS)
|
||||||
|
|
||||||
|
|
||||||
include_directories(../epaper/Config)
|
include_directories(../epaper/Config)
|
||||||
include_directories(../epaper/e-Paper)
|
include_directories(../epaper/e-Paper)
|
||||||
include_directories(../epaper/Fonts)
|
include_directories(../epaper/Fonts)
|
||||||
|
|
||||||
# Generate the link library
|
# Generate the link library
|
||||||
add_library(Mare ${DIR_Config_SRCS})
|
add_library(Mare ${DIR_Config_SRCS})
|
||||||
target_link_libraries(Mare PUBLIC Config ePaper pico_stdlib hardware_spi)
|
target_link_libraries(Mare PUBLIC Config ePaper Fonts pico_stdlib pico_printf pico_mem_ops hardware_spi)
|
||||||
2
libs/mare/charmap.h
Normal file
2
libs/mare/charmap.h
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#include <pico/stdlib.h>
|
||||||
|
#include <fonts.h>
|
||||||
@@ -5,8 +5,134 @@
|
|||||||
|
|
||||||
namespace Render {
|
namespace Render {
|
||||||
|
|
||||||
Mare::Mare(){
|
Mare::Mare(dim_t size, ScreenRotation rot) :
|
||||||
|
_screenSize(size),
|
||||||
|
_screenBufferBackground(nullptr),
|
||||||
|
_screenBufferForeground(nullptr),
|
||||||
|
_rotation(rot),
|
||||||
|
_full(true)
|
||||||
|
{
|
||||||
|
int rv;
|
||||||
|
_bufferDim = (_screenSize.x >> 3) * _screenSize.y;
|
||||||
|
_screenBufferBackground = (uint8_t*)malloc(sizeof(uint8_t)* _bufferDim);
|
||||||
|
_screenBufferForeground = (uint8_t*)malloc(sizeof(uint8_t)* _bufferDim);
|
||||||
|
clearBuffer(_screenBufferForeground, _bufferDim, Color::White);
|
||||||
|
clearBuffer(_screenBufferBackground, _bufferDim, Color::White);
|
||||||
|
|
||||||
|
// init display
|
||||||
|
sleep_ms(500);
|
||||||
|
if((rv=DEV_Module_Init())!=0){
|
||||||
|
printf("Init Failed, %d\n",rv);
|
||||||
|
__breakpoint();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
EPD_2IN9_V2_Init();
|
||||||
|
EPD_2IN9_V2_Clear();
|
||||||
|
printf("Mare render engine created\n");
|
||||||
|
EPD_2IN9_V2_Display(_screenBufferBackground);
|
||||||
|
sleep_ms(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
Mare::~Mare(){
|
||||||
|
for (auto &d :_drawables) {
|
||||||
|
d.reset();
|
||||||
|
}
|
||||||
|
for (auto &p : _pages){
|
||||||
|
p.reset();
|
||||||
|
}
|
||||||
|
free(_screenBufferBackground);
|
||||||
|
free(_screenBufferForeground);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mare::render() {
|
||||||
|
clearBuffer(_screenBufferBackground, _bufferDim, Color::White);
|
||||||
|
for (auto d: _drawables) {
|
||||||
|
if (d != nullptr)
|
||||||
|
d->render();
|
||||||
|
};
|
||||||
|
if (!_full)
|
||||||
|
EPD_2IN9_V2_Display_Partial(_screenBufferBackground);
|
||||||
|
else {
|
||||||
|
EPD_2IN9_V2_Display(_screenBufferBackground);
|
||||||
|
_full = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mare::clearBuffer(uint8_t* buffer, uint16_t len, Color col){
|
||||||
|
assert(buffer != nullptr);
|
||||||
|
std::memset(buffer, col == Color::White ? 0xff : 0x00, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Mare::applyScreenRotation(uint16_t* x, uint16_t* y) {
|
||||||
|
uint16_t ax,ay;
|
||||||
|
switch(_rotation){
|
||||||
|
case ScreenRotation::Rot0 :
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ScreenRotation::Rot90 :
|
||||||
|
{
|
||||||
|
ax = *x; ay = *y;
|
||||||
|
*x = _screenSize.x - ay;
|
||||||
|
*y = ax;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ScreenRotation::Rot180 :
|
||||||
|
{
|
||||||
|
ax = *x; ay = *y;
|
||||||
|
*x = _screenSize.x - ax;
|
||||||
|
*y = _screenSize.y - ay;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ScreenRotation::Rot270 :
|
||||||
|
{
|
||||||
|
ax = *x; ay = *y;
|
||||||
|
*x = ay;
|
||||||
|
*y = _screenSize.y - ax;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (*x >= _screenSize.x || *y >= _screenSize.y) return false;
|
||||||
|
if (*x < 0 || *y < 0) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Public
|
||||||
|
const dim_t Mare::getCenter() {
|
||||||
|
dim_t rv;
|
||||||
|
if (_rotation == ScreenRotation::Rot0 || _rotation == ScreenRotation::Rot180){
|
||||||
|
rv.x = _screenSize.x >> 1;
|
||||||
|
rv.y = _screenSize.y >> 1;
|
||||||
|
} else {
|
||||||
|
rv.x = _screenSize.y >> 1;
|
||||||
|
rv.y = _screenSize.x >> 1;
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mare::setPixel(uint8_t* img, uint16_t x, uint16_t y, BlendMode bm) {
|
||||||
|
if (!applyScreenRotation(&x,&y)) return;
|
||||||
|
// from here the coordinates are natural for the screen
|
||||||
|
img += (sizeof(uint8_t)*y*(_screenSize.x>>3) + sizeof(uint8_t)*(x>>3));
|
||||||
|
if (bm == BlendMode::Add) *img &= ~(0x80 >> (x%8));
|
||||||
|
else if (bm == BlendMode::Intersect) *img = ~*img ^ ~(0x80 >> (x%8));
|
||||||
|
}
|
||||||
|
|
||||||
|
pos_t Mare::rotateXY(int16_t x, int16_t y, float rot){
|
||||||
|
// apply rotation matrix xy
|
||||||
|
pos_t rv;
|
||||||
|
float cx,sx;
|
||||||
|
sincosf(rot, &sx, &cx);
|
||||||
|
rv.x = x*cx - y*sx;
|
||||||
|
rv.y = x*sx + y*cx;
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mare::clearScreen() {
|
||||||
|
EPD_2IN9_V2_Clear();
|
||||||
|
clearBuffer(_screenBufferBackground, _bufferDim, Color::White);
|
||||||
|
_full = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
309
libs/mare/mare.h
309
libs/mare/mare.h
@@ -1,22 +1,34 @@
|
|||||||
/*******************************************
|
/*******************************************
|
||||||
* Most Awesome Renderer Ever
|
* Most Awesome Renderer Ever
|
||||||
*******************************************/
|
*******************************************/
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
//#include <stdio.h>
|
||||||
|
#include <pico/stdlib.h>
|
||||||
|
#include <pico/printf.h>
|
||||||
|
#include <pico/int64_ops.h>
|
||||||
|
#include <pico/float.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <DEV_Config.h>
|
#include <DEV_Config.h>
|
||||||
#include <EPD_2in9b_V3.h>
|
#include <EPD_2in9_V2.h>
|
||||||
#include <fonts.h>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstring>
|
||||||
|
#include <memory>
|
||||||
|
#include <math.h>
|
||||||
|
#include <fonts.h>
|
||||||
|
|
||||||
namespace Render{
|
namespace Render{
|
||||||
|
|
||||||
|
typedef int32_t p_t;
|
||||||
|
|
||||||
struct pos_t {
|
struct pos_t {
|
||||||
uint16_t x;
|
friend bool operator==(const pos_t a, const pos_t b){ return a.x==b.x && a.y==b.y;};
|
||||||
uint16_t y;
|
friend bool operator!=(const pos_t a, const pos_t b){ return a.x!=b.x || a.y!=b.y;};
|
||||||
|
p_t x;
|
||||||
|
p_t y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bbox2d_t {
|
struct bbox2d_t {
|
||||||
@@ -36,83 +48,245 @@ namespace Render{
|
|||||||
Intersect
|
Intersect
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class Color {
|
||||||
|
White,
|
||||||
|
Black
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class Font {
|
||||||
|
Font8,
|
||||||
|
Font12,
|
||||||
|
Font16,
|
||||||
|
Font20,
|
||||||
|
Font24
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef ScreenRotation TextRotation;
|
||||||
|
|
||||||
class Page;
|
class Page;
|
||||||
class Drawable;
|
class Drawable;
|
||||||
|
class DrawablePoint;
|
||||||
|
class DrawableLine;
|
||||||
|
class DrawableRectangle;
|
||||||
|
class DrawableCircle;
|
||||||
|
class DrawableString;
|
||||||
|
class DrawableCustom;
|
||||||
|
|
||||||
typedef pos_t dim_t;
|
typedef pos_t dim_t;
|
||||||
typedef std::vector<Page*> Pages;
|
typedef std::vector<std::shared_ptr<Page>> Pages;
|
||||||
typedef std::vector<Drawable*> Drawables;
|
typedef std::vector<std::shared_ptr<Drawable>> Drawables;
|
||||||
|
|
||||||
class Mare {
|
class Mare {
|
||||||
Mare();
|
friend class Drawable;
|
||||||
virtual ~Mare();
|
friend class Page;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Mare(dim_t size, ScreenRotation rot);
|
||||||
|
~Mare();
|
||||||
|
|
||||||
// getters, setters
|
// getters, setters
|
||||||
public:
|
public:
|
||||||
void setSize(const uint16_t x, const uint16_t y);
|
void setSize(const dim_t size);
|
||||||
const dim_t getSize();
|
const dim_t getSize() {return _screenSize;};
|
||||||
|
const dim_t getCenter();
|
||||||
void setRotation(const ScreenRotation r);
|
void setRotation(const ScreenRotation r);
|
||||||
const ScreenRotation getRotation();
|
const ScreenRotation getRotation() {return _rotation;};
|
||||||
|
|
||||||
const Pages& getPages();
|
|
||||||
const uint8_t getCurrentPage();
|
|
||||||
void setCurrentPage(const uint8_t p);
|
void setCurrentPage(const uint8_t p);
|
||||||
|
const Page& getCurrentPage() {return *_pages.at(0).get();};
|
||||||
const Drawables& getDrawables();
|
|
||||||
|
|
||||||
// drawables, pages
|
// drawables, pages
|
||||||
public:
|
public:
|
||||||
void addDrawable();
|
template <class T, class... Args>
|
||||||
void removeDrawable(size_t id);
|
T* addDrawable(Args... args) {
|
||||||
void addPage(uint8_t num);
|
static size_t lastDrawableIndex(0);
|
||||||
void removePage(uint8_t num);
|
static_assert(std::is_base_of_v<Drawable, T>, "Mare::addDrawable<T>() error, type T is not inherited from Drawable.");
|
||||||
|
auto newD = std::shared_ptr<T>(new T(lastDrawableIndex++, nullptr, this, args...));
|
||||||
|
_drawables.push_back(std::move(newD));
|
||||||
|
auto foo = _drawables.back().get();
|
||||||
|
return static_cast<T*>(foo);
|
||||||
|
}
|
||||||
|
void removeDrawable(const size_t id) {};
|
||||||
|
void addPage() {};
|
||||||
|
void removePage(const uint8_t num) {};
|
||||||
|
const Drawables& getDrawables() {return _drawables;};
|
||||||
|
const Pages& getPages() {return _pages;};
|
||||||
|
|
||||||
private:
|
//render
|
||||||
void visitDrawables(Drawable* parent);
|
private:
|
||||||
|
void clearBuffer(uint8_t* buffer, uint16_t len, Color col);
|
||||||
|
bool applyScreenRotation(uint16_t* x, uint16_t* y);
|
||||||
|
void visitDrawables(Drawable* parent) {};
|
||||||
|
|
||||||
|
public:
|
||||||
void render();
|
void render();
|
||||||
void setPixel(uint16_t x, uint16_t y, bool value);
|
void setPixel(uint8_t* img, uint16_t x, uint16_t y, BlendMode bm);
|
||||||
|
pos_t rotateXY(int16_t x, int16_t y, float rot);
|
||||||
|
void clearScreen();
|
||||||
|
|
||||||
// members
|
// members
|
||||||
private:
|
private:
|
||||||
uint8_t* _screenBufferForeground;
|
|
||||||
uint8_t* _screenBufferBackgrund;
|
|
||||||
dim_t _screenSize;
|
dim_t _screenSize;
|
||||||
Pages _pages;
|
Pages _pages;
|
||||||
Drawables _drawables;
|
uint8_t* _screenBufferForeground;
|
||||||
|
uint8_t* _screenBufferBackground;
|
||||||
|
uint16_t _bufferDim;
|
||||||
|
Drawables _drawables; // background drawables for all the pages
|
||||||
ScreenRotation _rotation;
|
ScreenRotation _rotation;
|
||||||
|
bool _full;
|
||||||
|
|
||||||
|
public:
|
||||||
|
uint8_t* bBuffer() { return _screenBufferBackground; }
|
||||||
|
uint8_t* fBuffer() { return _screenBufferForeground; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Drawable {
|
class Drawable {
|
||||||
|
|
||||||
Drawable(const size_t id, const pos_t position, const Drawable* parent);
|
|
||||||
virtual ~Drawable();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void render();
|
Drawable(const size_t id, Drawable* parent, Mare* engine);
|
||||||
|
~Drawable();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setId(const size_t id);
|
virtual void render() {};
|
||||||
void setOrigin(const pos_t origin);
|
|
||||||
void setDirty();
|
|
||||||
void setBlendMode(const BlendMode mode);
|
|
||||||
|
|
||||||
const bbox2d_t getBBox();
|
public:
|
||||||
const BlendMode getBlendMode();
|
void setId(const size_t id) { _id = id; };
|
||||||
|
void setOrigin(const pos_t origin) { _origin = origin; };
|
||||||
|
void setDirty() {_dirty = true;};
|
||||||
|
void resetDirty() {_dirty = false;};
|
||||||
|
void setBlendMode(const BlendMode mode) { _blendMode = mode; };
|
||||||
|
|
||||||
|
const bool isDirty() {return _dirty;}
|
||||||
|
const pos_t getOrigin() { return _origin; };
|
||||||
|
const bbox2d_t getBBox() { return _bbox; };
|
||||||
|
const BlendMode getBlendMode() { return _blendMode; };
|
||||||
|
|
||||||
|
uint8_t* getBuffer() {
|
||||||
|
if (_parent == nullptr) return engine()->bBuffer();
|
||||||
|
else return engine()->fBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
Mare* engine() { return _engine; };
|
||||||
|
Drawable* parent() { return _parent; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Drawable* _parent;
|
||||||
|
Mare* _engine;
|
||||||
bool _dirty;
|
bool _dirty;
|
||||||
size_t _id;
|
size_t _id;
|
||||||
pos_t _origin;
|
pos_t _origin;
|
||||||
bbox2d_t _bbox;
|
bbox2d_t _bbox;
|
||||||
|
BlendMode _blendMode;
|
||||||
Drawables _children;
|
Drawables _children;
|
||||||
Drawable* _parent;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DrawablePoint: public Drawable {
|
class DrawablePoint: public Drawable {
|
||||||
|
|
||||||
DrawablePoint();
|
public:
|
||||||
~DrawablePoint();
|
DrawablePoint(const size_t id, Drawable* parent, Mare* engine, dim_t size);
|
||||||
|
~DrawablePoint();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setSize(dim_t size) { _size = size; };
|
||||||
|
const dim_t getSize() { return _size; };
|
||||||
|
|
||||||
|
private:
|
||||||
|
void render();
|
||||||
|
|
||||||
|
// members
|
||||||
|
private:
|
||||||
|
dim_t _size;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawableLine: public Drawable {
|
||||||
|
friend class DrawableRectangle;
|
||||||
|
|
||||||
|
public:
|
||||||
|
DrawableLine(const size_t id, Drawable* parent, Mare* engine);
|
||||||
|
~DrawableLine();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setThickness(uint16_t thickness) {
|
||||||
|
uint8_t d = thickness >> 1;
|
||||||
|
_thickness = thickness;
|
||||||
|
_ofst = (d % 2)==0 ? d + 1: d;
|
||||||
|
};
|
||||||
|
const uint16_t getThickness() {return _thickness;};
|
||||||
|
void setRotation(uint16_t rotation) {_rotation = rotation;};
|
||||||
|
const uint16_t getRotation() {return _rotation;};
|
||||||
|
void setLength(uint16_t length) {_length = length;};
|
||||||
|
const uint16_t getLength() {return _length;};
|
||||||
|
|
||||||
|
private:
|
||||||
|
void render(); // difficult business
|
||||||
|
|
||||||
|
// members
|
||||||
|
private:
|
||||||
|
uint16_t _thickness;
|
||||||
|
uint16_t _length;
|
||||||
|
uint16_t _rotation;
|
||||||
|
uint8_t _ofst;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawableRectangle: public Drawable {
|
||||||
|
|
||||||
|
public:
|
||||||
|
DrawableRectangle(const size_t id, Drawable* parent, Mare* engine);
|
||||||
|
~DrawableRectangle();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setThickness(uint16_t thickness) {_thickness = thickness;};
|
||||||
|
const uint16_t getThickness() {return _thickness;};
|
||||||
|
void setRotation(uint16_t rotation) {_rotation = rotation;};
|
||||||
|
const uint16_t getRotation() {return _rotation;};
|
||||||
|
void setDimension(dim_t dim) {_dim = dim;};
|
||||||
|
const dim_t getDimension() {return _dim;};
|
||||||
|
void setOutline(bool outline) {_outline = outline;};
|
||||||
|
const bool getOutline() {return _outline;};
|
||||||
|
|
||||||
|
private:
|
||||||
|
void createOutline();
|
||||||
|
void render();
|
||||||
|
|
||||||
|
// members
|
||||||
|
private:
|
||||||
|
DrawableLine* l1 = nullptr;
|
||||||
|
DrawableLine* l2 = nullptr;
|
||||||
|
DrawableLine* l3 = nullptr;
|
||||||
|
DrawableLine* l4 = nullptr;
|
||||||
|
uint16_t _thickness;
|
||||||
|
uint16_t _rotation;
|
||||||
|
dim_t _dim;
|
||||||
|
bool _outline;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawableCircle: public Drawable {
|
||||||
|
public:
|
||||||
|
DrawableCircle(const size_t id, Drawable* parent, Mare* engine);
|
||||||
|
~DrawableCircle();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setThickness(uint16_t thickness) { _thickness = thickness; };
|
||||||
|
const uint16_t getThickness() {return _thickness; };
|
||||||
|
void setRadius(uint16_t radius) { _radius = radius; };
|
||||||
|
const uint16_t getRadius() { return _radius; };
|
||||||
|
void setOutline(bool outline) { _outline = outline; };
|
||||||
|
const bool getOutline() { return _outline; };
|
||||||
|
|
||||||
|
private:
|
||||||
|
void render();
|
||||||
|
|
||||||
|
// members
|
||||||
|
private:
|
||||||
|
uint16_t _thickness;
|
||||||
|
uint16_t _radius;
|
||||||
|
bool _outline;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawableChar: public Drawable {
|
||||||
|
friend class DrawableString;
|
||||||
|
public:
|
||||||
|
DrawableChar(const size_t id, Drawable* parent, Mare* engine, char c, Font f);
|
||||||
|
~DrawableChar();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -121,12 +295,41 @@ namespace Render{
|
|||||||
|
|
||||||
// members
|
// members
|
||||||
private:
|
private:
|
||||||
|
Font _fontEnum;
|
||||||
|
const _tFont* _font;
|
||||||
|
char _char;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DrawableString: public Drawable {
|
||||||
|
public:
|
||||||
|
DrawableString(const size_t id, Drawable* parent, Mare* engine, std::string &s, Font f);
|
||||||
|
~DrawableString();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setString(std::string& s) { _s = s; };
|
||||||
|
const std::string& getString() { return _s; };
|
||||||
|
void setFont(Font f) { _fontEnum = f; };
|
||||||
|
const Font getFont() { return _fontEnum; };
|
||||||
|
void setRotation(TextRotation rotation) { _rotation = rotation; };
|
||||||
|
const TextRotation getRotation() { return _rotation; };
|
||||||
|
void setSpacing(uint8_t hSpace, uint8_t vSpace) {_vSpace= vSpace; _hSpace=hSpace;}
|
||||||
|
const pos_t getSpacing() { return {_hSpace,_vSpace}; };
|
||||||
|
private:
|
||||||
|
void render();
|
||||||
|
|
||||||
|
// members
|
||||||
|
private:
|
||||||
|
Font _fontEnum;
|
||||||
|
TextRotation _rotation;
|
||||||
|
std::string _s;
|
||||||
|
std::vector<DrawableChar*> _chars;
|
||||||
|
uint8_t _hSpace=2, _vSpace=2;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DrawableLine: public Drawable {
|
class DrawableCustom: public Drawable {
|
||||||
|
|
||||||
DrawableLine();
|
DrawableCustom();
|
||||||
~DrawableLine();
|
~DrawableCustom();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -137,19 +340,6 @@ namespace Render{
|
|||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
class DrawableRectangle: public Drawable {
|
|
||||||
|
|
||||||
DrawableRectangle();
|
|
||||||
~DrawableRectangle();
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
private:
|
|
||||||
void render() {};
|
|
||||||
|
|
||||||
// members
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
class Page {
|
class Page {
|
||||||
|
|
||||||
@@ -159,6 +349,7 @@ namespace Render{
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Drawables _backDrawables;
|
||||||
|
Drawables _frontDrawables;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,353 @@
|
|||||||
#include "mare.h"
|
#include "mare.h"
|
||||||
|
#include "charmap.h"
|
||||||
|
|
||||||
namespace Render {
|
namespace Render {
|
||||||
|
|
||||||
Drawable::Drawable(const size_t id, const pos_t position, const Drawable* parent) {
|
Drawable::Drawable(const size_t id, Drawable* parent, Mare* engine):
|
||||||
|
_id(id),
|
||||||
|
_parent(parent),
|
||||||
|
_engine(engine),
|
||||||
|
_origin({0,0}),
|
||||||
|
_bbox({0,0,0,0}),
|
||||||
|
_blendMode(Render::BlendMode::Add),
|
||||||
|
_dirty(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Drawable::~Drawable() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Point
|
//Point
|
||||||
|
DrawablePoint::DrawablePoint(const size_t id, Drawable* parent, Mare* engine, dim_t size):
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_size(size)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawablePoint::~DrawablePoint() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawablePoint::render() {
|
||||||
|
uint8_t *buf;
|
||||||
|
pos_t o = getOrigin();
|
||||||
|
if (isDirty()){
|
||||||
|
buf = getBuffer();
|
||||||
|
//TODO: implement screen rotation and margin check
|
||||||
|
auto dx = engine()->getSize().x;
|
||||||
|
auto dy = engine()->getSize().y;
|
||||||
|
for (uint16_t xx(0); xx< _size.x; xx++){
|
||||||
|
for (uint16_t yy(0); yy < _size.y; yy++)
|
||||||
|
{
|
||||||
|
engine()->setPixel(buf,o.x+xx,o.y+yy,getBlendMode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Line
|
//Line
|
||||||
|
DrawableLine::DrawableLine(const size_t id, Drawable* parent, Mare* engine):
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_thickness(1),
|
||||||
|
_length(0),
|
||||||
|
_rotation(0)
|
||||||
|
{
|
||||||
|
setThickness(_thickness); // only to calc offset
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawableLine::~DrawableLine()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableLine::render(){
|
||||||
|
uint8_t* buf = getBuffer();
|
||||||
|
auto tt = _thickness;
|
||||||
|
auto e = engine();
|
||||||
|
if (isDirty()) {
|
||||||
|
_rotation = _rotation % 360;
|
||||||
|
pos_t o = getOrigin();
|
||||||
|
pos_t res = {0,0};
|
||||||
|
for (uint16_t t(0); t < _thickness; ++t) {
|
||||||
|
for (uint16_t xx(0); xx < _length; ++xx) {
|
||||||
|
if (_rotation == 0 || _rotation == 180){
|
||||||
|
res.x = _rotation == 0 ? xx : -xx;
|
||||||
|
res.y = t-_ofst;
|
||||||
|
} else if (_rotation == 90 || _rotation == 270){
|
||||||
|
res.x = t-_ofst;
|
||||||
|
res.y = _rotation == 90 ? xx : -xx;
|
||||||
|
} else {
|
||||||
|
res = e->rotateXY(xx,t-_ofst,_rotation/180.0f*M_PI);
|
||||||
|
}
|
||||||
|
e->setPixel(buf,res.x+o.x,res.y+o.y,getBlendMode());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Rectangle
|
//Rectangle
|
||||||
|
|
||||||
|
DrawableRectangle::DrawableRectangle(const size_t id, Drawable* parent, Mare* engine):
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_thickness(1),
|
||||||
|
_rotation(0),
|
||||||
|
_dim({8,8}),
|
||||||
|
_outline(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawableRectangle::~DrawableRectangle()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableRectangle::createOutline(){
|
||||||
|
auto e = engine();
|
||||||
|
pos_t o = getOrigin();
|
||||||
|
auto rf = (_rotation % 360)/180.0f*M_PI;
|
||||||
|
|
||||||
|
if (l1 == nullptr) l1 = e->addDrawable<DrawableLine>();
|
||||||
|
if (l2 == nullptr) l2 = e->addDrawable<DrawableLine>();
|
||||||
|
if (l3 == nullptr) l3 = e->addDrawable<DrawableLine>();
|
||||||
|
if (l4 == nullptr) l4 = e->addDrawable<DrawableLine>();
|
||||||
|
|
||||||
|
l1->setRotation(_rotation);
|
||||||
|
l1->setLength(_dim.x);
|
||||||
|
l1->setThickness(_thickness);
|
||||||
|
l2->setRotation(_rotation+90);
|
||||||
|
l2->setLength(_dim.y);
|
||||||
|
l2->setThickness(_thickness);
|
||||||
|
l3->setRotation(_rotation);
|
||||||
|
l3->setLength(_dim.x);
|
||||||
|
l3->setThickness(_thickness);
|
||||||
|
l4->setRotation(_rotation+90);
|
||||||
|
l4->setLength(_dim.y);
|
||||||
|
l4->setThickness(_thickness);
|
||||||
|
|
||||||
|
uint8_t of = l2->_ofst;
|
||||||
|
pos_t res = {0,0};
|
||||||
|
l1->setOrigin(o);
|
||||||
|
|
||||||
|
res = e->rotateXY((_dim.x-of),0,rf);
|
||||||
|
l2->setOrigin({(p_t)(o.x+res.x), (p_t)(o.y+res.y)});
|
||||||
|
|
||||||
|
res = e->rotateXY(0,(_dim.y-of),rf);
|
||||||
|
l3->setOrigin({(p_t)(o.x+res.x), (p_t)(o.y+res.y)});
|
||||||
|
|
||||||
|
res = e->rotateXY(of,-of,rf);
|
||||||
|
l4->setOrigin({(p_t)(o.x+res.x), (p_t)(o.y+res.y)});
|
||||||
|
|
||||||
|
l1->setDirty();
|
||||||
|
l2->setDirty();
|
||||||
|
l3->setDirty();
|
||||||
|
l4->setDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableRectangle::render()
|
||||||
|
{
|
||||||
|
uint8_t* buf = getBuffer();
|
||||||
|
auto tt = _thickness;
|
||||||
|
auto e = engine();
|
||||||
|
if (isDirty()) {
|
||||||
|
if (_outline) {
|
||||||
|
createOutline();
|
||||||
|
l1->render();
|
||||||
|
l2->render();
|
||||||
|
l3->render();
|
||||||
|
l4->render();
|
||||||
|
}
|
||||||
|
resetDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Circle
|
//Circle
|
||||||
|
|
||||||
|
DrawableCircle::DrawableCircle(const size_t id, Drawable* parent, Mare* engine):
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_thickness(1),
|
||||||
|
_radius(8),
|
||||||
|
_outline(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawableCircle::~DrawableCircle ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableCircle::render()
|
||||||
|
{
|
||||||
|
auto e = engine();
|
||||||
|
uint8_t* buf = getBuffer();
|
||||||
|
auto tt = _thickness;
|
||||||
|
auto bm = getBlendMode();
|
||||||
|
const pos_t o = getOrigin();
|
||||||
|
const uint8_t t2 = _thickness >> 1;
|
||||||
|
const pos_t oo = {o.x-t2, o.y-t2};
|
||||||
|
|
||||||
|
auto dot = [buf, tt, e, bm] (p_t x, p_t y) {
|
||||||
|
for (uint16_t xx(0); xx < tt; ++xx) {
|
||||||
|
for (uint16_t yy(0); yy < tt; ++yy) {
|
||||||
|
e->setPixel(buf, xx+x, yy+y, bm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
auto pix = [buf,e,bm](p_t x, p_t y) {
|
||||||
|
e->setPixel(buf, x, y, bm);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (isDirty()){
|
||||||
|
if (_outline){
|
||||||
|
const float st = M_PI_2/45;
|
||||||
|
pos_t pres;
|
||||||
|
for (float t(0); t <= M_TWOPI; t+=st){
|
||||||
|
auto res = e->rotateXY(_radius,0,t);
|
||||||
|
if (res != pres) {
|
||||||
|
dot(oo.x+res.x, oo.y+res.y);
|
||||||
|
dot(oo.x-res.x, oo.y+res.y);
|
||||||
|
dot(oo.x-res.x, oo.y+res.y);
|
||||||
|
dot(oo.x-res.x, oo.y-res.y);
|
||||||
|
pres=res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Character
|
//Character
|
||||||
|
|
||||||
|
extern const _tFont* Font8_t;
|
||||||
|
extern const _tFont* Font12_t;
|
||||||
|
extern const _tFont* Font16_t;
|
||||||
|
extern const _tFont* Font20_t;
|
||||||
|
extern const _tFont* Font24_t;
|
||||||
|
|
||||||
|
|
||||||
|
DrawableChar::DrawableChar(const size_t id, Drawable* parent, Mare* engine, char c, Font f) :
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_fontEnum(f),
|
||||||
|
_char(c)
|
||||||
|
{
|
||||||
|
switch (_fontEnum)
|
||||||
|
{
|
||||||
|
case Font::Font8:
|
||||||
|
_font = Font8_t;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Font::Font12:
|
||||||
|
_font = Font12_t;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Font::Font16:
|
||||||
|
_font = Font16_t;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Font::Font20:
|
||||||
|
_font = Font20_t;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Font::Font24:
|
||||||
|
_font = Font24_t;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawableChar::~DrawableChar() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableChar::render() {
|
||||||
|
uint8_t* buf = getBuffer();
|
||||||
|
const pos_t o = getOrigin();
|
||||||
|
const BlendMode bm = getBlendMode();
|
||||||
|
const uint8_t w = _font->Width;
|
||||||
|
const uint8_t h = _font->Height;
|
||||||
|
const uint16_t w_ch = w%7 ? (w/7)+1 : w/7;
|
||||||
|
const uint8_t* ch = _font->table + (_char - ' ') * w_ch * h;
|
||||||
|
for(uint8_t y(0); y < h; y++) {
|
||||||
|
for(uint8_t x(0); x < w; x++) {
|
||||||
|
const uint8_t* ch_v = ch + x / 7 + y * w_ch;
|
||||||
|
if (ch_v == 0) continue;
|
||||||
|
if ((*ch_v >> x) & 0x01){
|
||||||
|
engine()->setPixel(buf,o.x+x, o.y+y, bm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//String
|
//String
|
||||||
|
|
||||||
|
DrawableString::DrawableString(const size_t id, Drawable* parent, Mare* engine, std::string &s, Font f) :
|
||||||
|
Drawable(id, parent,engine),
|
||||||
|
_fontEnum(f),
|
||||||
|
_s(s)
|
||||||
|
{
|
||||||
|
_chars.reserve(s.size());
|
||||||
|
uint16_t idx(0);
|
||||||
|
for(auto c : _s){
|
||||||
|
_chars.push_back(engine->addDrawable<DrawableChar>(reinterpret_cast<char>(c),_fontEnum));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawableString::~DrawableString()
|
||||||
|
{
|
||||||
|
//free heap of drawable characters
|
||||||
|
for (auto c : _chars) {
|
||||||
|
delete c;
|
||||||
|
}
|
||||||
|
_chars.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawableString::render() {
|
||||||
|
pos_t ofs;
|
||||||
|
int32_t ofsX=0, ofsY=0;
|
||||||
|
switch(_rotation) {
|
||||||
|
case TextRotation::Rot0: {
|
||||||
|
ofsX = _chars.front()->_font->Width + _hSpace;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TextRotation::Rot180:{
|
||||||
|
ofsY = -_chars.front()->_font->Width - _hSpace;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TextRotation::Rot90: {
|
||||||
|
ofsY = _chars.front()->_font->Height + _vSpace;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TextRotation::Rot270: {
|
||||||
|
ofsY = _chars.front()->_font->Height + _vSpace;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (auto c : _chars){
|
||||||
|
if (c != nullptr){
|
||||||
|
c->setOrigin(ofs);
|
||||||
|
c->render();
|
||||||
|
ofs.x += ofsX;
|
||||||
|
ofs.y += ofsY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
|
||||||
//Custom
|
//Custom
|
||||||
|
|||||||
@@ -18,11 +18,6 @@ pico_add_extra_outputs(emon)
|
|||||||
|
|
||||||
# Pull in our pico_stdlib which aggregates commonly used features
|
# Pull in our pico_stdlib which aggregates commonly used features
|
||||||
target_link_libraries(emon
|
target_link_libraries(emon
|
||||||
hardware_spi
|
|
||||||
pico_stdlib
|
pico_stdlib
|
||||||
Config
|
Mare
|
||||||
ePaper
|
|
||||||
GUI
|
|
||||||
Fonts
|
|
||||||
MyLibs
|
|
||||||
)
|
)
|
||||||
|
|||||||
111
src/main.cpp
111
src/main.cpp
@@ -1,82 +1,69 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <pico/stdlib.h>
|
#include <pico/stdlib.h>
|
||||||
|
|
||||||
// Ricrdarsi di inserire cosi' tutte le lebrerie C altrimenti non LINKA, vaccamiseria
|
// Ricrdarsi di inserire cosi' tutte le lebrerie C altrimenti non LINKA, vaccamiseria
|
||||||
extern "C" {
|
|
||||||
#include <EPD_2in9_V2.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <myclass.h>
|
|
||||||
#include <mare.h>
|
#include <mare.h>
|
||||||
|
|
||||||
void setPixel(uint8_t* img, uint16_t x, uint16_t y, bool value){
|
|
||||||
img += (sizeof(uint8_t)*x*(EPD_2IN9_V2_WIDTH>>3)+ sizeof(uint8_t)*(y>>3));
|
|
||||||
if (value) *img &= ~0x01 << (y%8);
|
|
||||||
else *img |= 0x01 << y%8;
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawSquare(uint8_t* img, uint16_t x, uint16_t y, uint16_t dimX, uint16_t dimY, bool col){
|
|
||||||
for (auto xx(0); xx< dimX; xx++){
|
|
||||||
for (auto yy(0); yy < dimY; yy++)
|
|
||||||
{
|
|
||||||
setPixel(img,x+xx,y+yy,col);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
stdio_init_all();
|
stdio_init_all();
|
||||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||||
gpio_init(LED_PIN);
|
gpio_init(LED_PIN);
|
||||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||||
bool s=false;
|
bool s=false;
|
||||||
uint32_t i=0;
|
uint i(16);
|
||||||
uint8_t img[EPD_2IN9_V2_HEIGHT/8*EPD_2IN9_V2_WIDTH];
|
Render::dim_t ssize;
|
||||||
|
ssize.x = EPD_2IN9_V2_WIDTH;
|
||||||
|
ssize.y = EPD_2IN9_V2_HEIGHT;
|
||||||
|
|
||||||
for (int x=0; x < EPD_2IN9_V2_HEIGHT/8*EPD_2IN9_V2_WIDTH; ++x){
|
auto viewer = Render::Mare(ssize,
|
||||||
img[x] = 0xff;
|
Render::ScreenRotation::Rot90);
|
||||||
}
|
|
||||||
|
|
||||||
int rv;
|
auto c1 = viewer.addDrawable<Render::DrawableLine>();
|
||||||
DEV_Delay_ms(500);
|
auto c2 = viewer.addDrawable<Render::DrawableLine>();
|
||||||
if((rv=DEV_Module_Init())!=0){
|
auto line3 = viewer.addDrawable<Render::DrawableLine>();
|
||||||
printf("Init Failed, %d",rv);
|
auto rect = viewer.addDrawable<Render::DrawableRectangle>();
|
||||||
return -1;
|
auto circle = viewer.addDrawable<Render::DrawableCircle>();
|
||||||
}
|
|
||||||
EPD_2IN9_V2_Init();
|
|
||||||
EPD_2IN9_V2_Clear();
|
|
||||||
|
|
||||||
//clear delta memory
|
c1->setOrigin({0,63});
|
||||||
uint8_t delta[EPD_2IN9_V2_HEIGHT][EPD_2IN9_V2_WIDTH/8];
|
c1->setLength(296);
|
||||||
for(auto i(0); i < EPD_2IN9B_V3_HEIGHT; ++i){
|
c1->setThickness(3);
|
||||||
for (auto j(0); j< EPD_2IN9B_V3_WIDTH/8; ++j){
|
c1->setBlendMode(Render::BlendMode::Add);
|
||||||
delta[i][j]=0xff;
|
|
||||||
|
c2->setOrigin({296/2-1, 1});
|
||||||
|
c2->setLength(128);
|
||||||
|
c2->setRotation(90);
|
||||||
|
c2->setThickness(3);
|
||||||
|
c1->setBlendMode(Render::BlendMode::Add);
|
||||||
|
|
||||||
|
line3->setLength(64);
|
||||||
|
line3->setOrigin(viewer.getCenter());
|
||||||
|
line3->setBlendMode(Render::BlendMode::Add);
|
||||||
|
|
||||||
|
rect->setDimension({48,48});
|
||||||
|
rect->setOrigin(viewer.getCenter());
|
||||||
|
rect->setOutline(true);
|
||||||
|
rect->setThickness(6);
|
||||||
|
|
||||||
|
circle->setRadius(32);
|
||||||
|
circle->setOrigin(viewer.getCenter());
|
||||||
|
circle->setOutline(true);
|
||||||
|
circle->setThickness(3);
|
||||||
|
|
||||||
|
while (true){
|
||||||
|
line3->setThickness(2);
|
||||||
|
for (uint16_t a(0); a<=360; a+=360/36){
|
||||||
|
//line3->setRotation(a);
|
||||||
|
rect->setRotation(a);
|
||||||
|
//line3->setDirty();
|
||||||
|
c1->setDirty();
|
||||||
|
c2->setDirty();
|
||||||
|
rect->setDirty();
|
||||||
|
circle->setDirty();
|
||||||
|
viewer.render();
|
||||||
}
|
}
|
||||||
}
|
viewer.clearScreen();
|
||||||
uint8_t dot(8);
|
//line3->setOutline(s);
|
||||||
bool col(false);
|
|
||||||
while(true){
|
|
||||||
EPD_2IN9_V2_Display_Base((uint8_t*)img);
|
|
||||||
for(auto k(0); k<2; ++k){
|
|
||||||
col = col ? false : true;
|
|
||||||
for (auto x(0); x <= EPD_2IN9_V2_WIDTH-dot;x+=dot){
|
|
||||||
for(auto y(0); y <= EPD_2IN9_V2_HEIGHT-dot;y+=dot){
|
|
||||||
drawSquare((uint8_t*)delta,y,EPD_2IN9_V2_WIDTH-x-dot,dot,dot,col);
|
|
||||||
EPD_2IN9_V2_Display_Partial((uint8_t*)delta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(auto i(0); i < EPD_2IN9B_V3_HEIGHT; ++i){
|
|
||||||
for (auto j(0); j< EPD_2IN9B_V3_WIDTH/8; ++j){
|
|
||||||
delta[i][j]=0xff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("[%u] Hello, world!\n",i++);
|
|
||||||
gpio_put(LED_PIN,s);
|
gpio_put(LED_PIN,s);
|
||||||
s = s ? false : true;
|
s = s ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user