关于 ColorCode
M5GFX会通过使用的颜色代码类型, 自动检测RGB888, RGB565, RGB332。
| 类型 | 颜色 |
| uint8_t | RGB332 |
| uint16_t | RGB565 |
| uint32_t | RGB888 |
ColorCode 列表
| 颜色 | 十六进制值(Hex) | 红(R) | 绿(G) | 蓝(B) |
| TFT_BLACK | 0x0000 | 0 | 0 | 0 |
| TFT_NAVY | 0x000F | 0 | 0 | 128 |
| TFT_DARKGREEN | 0x03E0 | 0 | 128 | 0 |
| TFT_DARKCYAN | 0x03EF | 0 | 128 | 128 |
| TFT_MAROON | 0x7800 | 128 | 0 | 0 |
| TFT_PURPLE | 0x780F | 128 | 0 | 128 |
| TFT_OLIVE | 0x7BE0 | 128 | 128 | 0 |
| TFT_LIGHTGREY | 0xD69A | 211 | 211 | 211 |
| TFT_LIGHTGRAY | 0xD69A | 211 | 211 | 211 |
| TFT_DARKGREY | 0x7BEF | 128 | 128 | 128 |
| TFT_DARKGRAY | 0x7BEF | 128 | 128 | 128 |
| TFT_BLUE | 0x001F | 0 | 0 | 255 |
| TFT_GREEN | 0x07E0 | 0 | 255 | 0 |
| TFT_CYAN | 0x07FF | 0 | 255 | 255 |
| TFT_RED | 0xF800 | 255 | 0 | 0 |
| TFT_MAGENTA | 0xF81F | 255 | 0 | 255 |
| TFT_YELLOW | 0xFFE0 | 255 | 255 | 0 |
| TFT_WHITE | 0xFFFF | 255 | 255 | 255 |
| TFT_ORANGE | 0xFDA0 | 255 | 180 | 0 |
| TFT_GREENYELLOW | 0xB7E0 | 180 | 255 | 0 |
| TFT_PINK | 0xFE19 | 255 | 192 | 203 |
| TFT_BROWN | 0x9A60 | 150 | 75 | 0 |
| TFT_GOLD | 0xFEA0 | 255 | 215 | 0 |
| TFT_SILVER | 0xC618 | 192 | 192 | 192 |
| TFT_SKYBLUE | 0x867D | 135 | 206 | 235 |
| TFT_VIOLET | 0x915C | 180 | 46 | 226 |
| TFT_TRANSPARENT | 0x0120 | | | |
关于 TextDatum
指定显示文本的基准坐标.
| 左对齐 | 居中对齐 | 右对齐 |
| top_left | top_center | top_right |
| middle_left | middle_center | middle_right |
| bottom_left | bottom_center | bottom_right |
关于 ImageDatum
指定显示图像的基准坐标.
| 左对齐 | 居中对齐 | 右对齐 |
| datum_t::top_left | datum_t::top_center | datum_t::top_right |
| datum_t::middle_left | datum_t::middle_center | datum_t::middle_right |
| datum_t::bottom_left | datum_t::bottom_center | datum_t::bottom_right |
字体列表
Latin 字体
| 字体名称 | remarks |
| &fonts::Font0 | |
| &fonts::Font2 | |
| &fonts::Font4 | |
| &fonts::Font6 | |
| &fonts::Font7 | |
| &fonts::Font8 | |
| &fonts::Font8x8C64 | |
| &fonts::AsciiFont8x16 | |
| &fonts::AsciiFont24x48 | |
| &fonts::TomThumb | |
| &fonts::FreeMono9pt7b | |
| &fonts::FreeMono12pt7b | |
| &fonts::FreeMono18pt7b | |
| &fonts::FreeMono24pt7b | |
| &fonts::FreeMonoBold9pt7b | |
| &fonts::FreeMonoBold12pt7b | |
| &fonts::FreeMonoBold18pt7b | |
| &fonts::FreeMonoBold24pt7b | |
| &fonts::FreeMonoOblique9pt7b | |
| &fonts::FreeMonoOblique12pt7b | |
| &fonts::FreeMonoOblique18pt7b | |
| &fonts::FreeMonoOblique24pt7b | |
| &fonts::FreeMonoBoldOblique9pt7b | |
| &fonts::FreeMonoBoldOblique12pt7b | |
| &fonts::FreeMonoBoldOblique18pt7b | |
| &fonts::FreeMonoBoldOblique24pt7b | |
| &fonts::FreeSans9pt7b | |
| &fonts::FreeSans12pt7b | |
| &fonts::FreeSans18pt7b | |
| &fonts::FreeSans24pt7b | |
| &fonts::FreeSansBold9pt7b | |
| &fonts::FreeSansBold12pt7b | |
| &fonts::FreeSansBold18pt7b | |
| &fonts::FreeSansBold24pt7b | |
| &fonts::FreeSansOblique9pt7b | |
| &fonts::FreeSansOblique12pt7b | |
| &fonts::FreeSansOblique18pt7b | |
| &fonts::FreeSansOblique24pt7b | |
| &fonts::FreeSansBoldOblique9pt7b | |
| &fonts::FreeSansBoldOblique12pt7b | |
| &fonts::FreeSansBoldOblique18pt7b | |
| &fonts::FreeSansBoldOblique24pt7b | |
| &fonts::FreeSerif9pt7b | |
| &fonts::FreeSerif12pt7b | |
| &fonts::FreeSerif18pt7b | |
| &fonts::FreeSerif24pt7b | |
| &fonts::FreeSerifItalic9pt7b | |
| &fonts::FreeSerifItalic12pt7b | |
| &fonts::FreeSerifItalic18pt7b | |
| &fonts::FreeSerifItalic24pt7b | |
| &fonts::FreeSerifBold9pt7b | |
| &fonts::FreeSerifBold12pt7b | |
| &fonts::FreeSerifBold18pt7b | |
| &fonts::FreeSerifBold24pt7b | |
| &fonts::FreeSerifBoldItalic9pt7b | |
| &fonts::FreeSerifBoldItalic12pt7b | |
| &fonts::FreeSerifBoldItalic18pt7b | |
| &fonts::FreeSerifBoldItalic24pt7b | |
| &fonts::Orbitron_Light_24 | |
| &fonts::Orbitron_Light_32 | |
| &fonts::Roboto_Thin_24 | |
| &fonts::Satisfy_24 | |
| &fonts::Yellowtail_32 | |
| &fonts::DejaVu12 | |
| &fonts::DejaVu18 | |
| &fonts::DejaVu24 | |
| &fonts::DejaVu40 | |
| &fonts::DejaVu56 | |
| &fonts::DejaVu72 | |
| &fonts::DejaVu9 | |
Unicode 字体
| 字体名称 | 语言编码 |
| &fonts::lgfxJapanMincho_8 | JA |
| &fonts::lgfxJapanMincho_12 | JA |
| &fonts::lgfxJapanMincho_16 | JA |
| &fonts::lgfxJapanMincho_20 | JA |
| &fonts::lgfxJapanMincho_24 | JA |
| &fonts::lgfxJapanMincho_28 | JA |
| &fonts::lgfxJapanMincho_32 | JA |
| &fonts::lgfxJapanMincho_36 | JA |
| &fonts::lgfxJapanMincho_40 | JA |
| &fonts::lgfxJapanMinchoP_8 | JA |
| &fonts::lgfxJapanMinchoP_12 | JA |
| &fonts::lgfxJapanMinchoP_16 | JA |
| &fonts::lgfxJapanMinchoP_20 | JA |
| &fonts::lgfxJapanMinchoP_24 | JA |
| &fonts::lgfxJapanMinchoP_28 | JA |
| &fonts::lgfxJapanMinchoP_32 | JA |
| &fonts::lgfxJapanMinchoP_36 | JA |
| &fonts::lgfxJapanMinchoP_40 | JA |
| &fonts::lgfxJapanGothic_8 | JA |
| &fonts::lgfxJapanGothic_12 | JA |
| &fonts::lgfxJapanGothic_16 | JA |
| &fonts::lgfxJapanGothic_20 | JA |
| &fonts::lgfxJapanGothic_24 | JA |
| &fonts::lgfxJapanGothic_28 | JA |
| &fonts::lgfxJapanGothic_32 | JA |
| &fonts::lgfxJapanGothic_36 | JA |
| &fonts::lgfxJapanGothic_40 | JA |
| &fonts::lgfxJapanGothicP_8 | JA |
| &fonts::lgfxJapanGothicP_12 | JA |
| &fonts::lgfxJapanGothicP_16 | JA |
| &fonts::lgfxJapanGothicP_20 | JA |
| &fonts::lgfxJapanGothicP_24 | JA |
| &fonts::lgfxJapanGothicP_28 | JA |
| &fonts::lgfxJapanGothicP_32 | JA |
| &fonts::lgfxJapanGothicP_36 | JA |
| &fonts::lgfxJapanGothicP_40 | JA |
| &fonts::efontCN_10 | zh-CN |
| &fonts::efontCN_10_b | zh-CN |
| &fonts::efontCN_10_bi | zh-CN |
| &fonts::efontCN_10_i | zh-CN |
| &fonts::efontCN_12 | zh-CN |
| &fonts::efontCN_12_b | zh-CN |
| &fonts::efontCN_12_bi | zh-CN |
| &fonts::efontCN_12_i | zh-CN |
| &fonts::efontCN_14 | zh-CN |
| &fonts::efontCN_14_b | zh-CN |
| &fonts::efontCN_14_bi | zh-CN |
| &fonts::efontCN_14_i | zh-CN |
| &fonts::efontCN_16 | zh-CN |
| &fonts::efontCN_16_b | zh-CN |
| &fonts::efontCN_16_bi | zh-CN |
| &fonts::efontCN_16_i | zh-CN |
| &fonts::efontCN_24 | zh-CN |
| &fonts::efontCN_24_b | zh-CN |
| &fonts::efontCN_24_bi | zh-CN |
| &fonts::efontCN_24_i | zh-CN |
| &fonts::efontJA_10 | JA |
| &fonts::efontJA_10_b | JA |
| &fonts::efontJA_10_bi | JA |
| &fonts::efontJA_10_i | JA |
| &fonts::efontJA_12 | JA |
| &fonts::efontJA_12_b | JA |
| &fonts::efontJA_12_bi | JA |
| &fonts::efontJA_12_i | JA |
| &fonts::efontJA_14 | JA |
| &fonts::efontJA_14_b | JA |
| &fonts::efontJA_14_bi | JA |
| &fonts::efontJA_14_i | JA |
| &fonts::efontJA_16 | JA |
| &fonts::efontJA_16_b | JA |
| &fonts::efontJA_16_bi | JA |
| &fonts::efontJA_16_i | JA |
| &fonts::efontJA_24 | JA |
| &fonts::efontJA_24_b | JA |
| &fonts::efontJA_24_bi | JA |
| &fonts::efontJA_24_i | JA |
| &fonts::efontKR_10 | KO |
| &fonts::efontKR_10_b | KO |
| &fonts::efontKR_10_bi | KO |
| &fonts::efontKR_10_i | KO |
| &fonts::efontKR_12 | KO |
| &fonts::efontKR_12_b | KO |
| &fonts::efontKR_12_bi | KO |
| &fonts::efontKR_12_i | KO |
| &fonts::efontKR_14 | KO |
| &fonts::efontKR_14_b | KO |
| &fonts::efontKR_14_bi | KO |
| &fonts::efontKR_14_i | KO |
| &fonts::efontKR_16 | KO |
| &fonts::efontKR_16_b | KO |
| &fonts::efontKR_16_bi | KO |
| &fonts::efontKR_16_i | KO |
| &fonts::efontKR_24 | KO |
| &fonts::efontKR_24_b | KO |
| &fonts::efontKR_24_bi | KO |
| &fonts::efontKR_24_i | KO |
| &fonts::efontTW_10 | zh-TW |
| &fonts::efontTW_10_b | zh-TW |
| &fonts::efontTW_10_bi | zh-TW |
| &fonts::efontTW_10_i | zh-TW |
| &fonts::efontTW_12 | zh-TW |
| &fonts::efontTW_12_b | zh-TW |
| &fonts::efontTW_12_bi | zh-TW |
| &fonts::efontTW_12_i | zh-TW |
| &fonts::efontTW_14 | zh-TW |
| &fonts::efontTW_14_b | zh-TW |
| &fonts::efontTW_14_bi | zh-TW |
| &fonts::efontTW_14_i | zh-TW |
| &fonts::efontTW_16 | zh-TW |
| &fonts::efontTW_16_b | zh-TW |
| &fonts::efontTW_16_bi | zh-TW |
| &fonts::efontTW_16_i | zh-TW |
| &fonts::efontTW_24 | zh-TW |
| &fonts::efontTW_24_b | zh-TW |
| &fonts::efontTW_24_bi | zh-TW |
| &fonts::efontTW_24_i | zh-TW |
颜色深度
| 值 | 比特 | 颜色数量 |
| 1 | 1 bit | 2 |
| 2 | 2 bit | 4 |
| 4 | 4 bit | 16 |
| 8 | 8 bit | 256 |
| 16 | 16 bit | 65,536 |
| 24 | 24 bit | 16,777,216 |
| | |
enum epd_mode_t
| 类型 | 描述 |
| epd_quality | 精细渲染,速度较慢 |
| epd_text | ↑ |
| epd_fast | ↓ |
| epd_fastest | 渲染速度更快,但质量较差. |
struct TextStyle
| 参数 | 类型 | 描述 |
| fore_rgb888 | uint32_t | 字体颜色 |
| back_rgb888 | uint32_t | 背景颜色 |
| size_x | float | 文本x坐标 |
| size_y | float | 文本y坐标 |
| datum | textdatum_t (*1) | 文本基准 |
| padding_x | int32_t | 填充 X |
| utf8 | bool | UTF8 编码 |
| cp437 | bool | cp437 编码 |
*1.
关于 textdatum
struct FontMetrics
| 参数 | 类型 | 描述 |
| width | int16_t | 字体宽度 |
| x_advance | int16_t | X 步长 |
| x_offset | int16_t | X 偏移 |
| height | int16_t | 字体高度 |
| y_advance | int16_t | Y 步长 |
| y_offset | int16_t | Y 偏移 |
、draw/push 和 write 函数之间的不同
与 draw/push 函数不同, write 函数没有通过
startWrite()
,
endWrite()
定义. draw/push 函数在其内部自动执行 startWrite() 和 endWrite(), 这使得在连续进行多次绘图时, 处理速度稍慢. 在这种情况下, 可以通过在 startWrite() 和 endWrite() 之间一起执行所有的 draw/push 函数来提高速度.
draw/push 和 write functions 表
| write(read) | draw or push |
| writePixel | drawPixel |
| writePixels | pushPixels |
| writePixelsDMA | pushPixelsDMA |
| writeFastHLine | drawFastHLine |
| writeFastVLine | drawFastVLine |
| writeFillRect | fillRect |
| writeColor | pushBlock |
| writeCommand | - |
| writeCommand16 | - |
| writeData | - |
| writeData16 | - |
| writeData32 | - |
| readData8 | - |
| readData16 | - |
| readData32 | - |