MXC-A39工程文件上传
This commit is contained in:
BIN
Doc/AN2311_FR30xx系列芯片时钟配置应用笔记_V1.0.pdf
Normal file
BIN
Doc/AN2311_FR30xx系列芯片时钟配置应用笔记_V1.0.pdf
Normal file
Binary file not shown.
BIN
Doc/FR309x屏显示方案开发说明文档.pdf
Normal file
BIN
Doc/FR309x屏显示方案开发说明文档.pdf
Normal file
Binary file not shown.
BIN
Doc/FR309x开发环境说明书.pdf
Normal file
BIN
Doc/FR309x开发环境说明书.pdf
Normal file
Binary file not shown.
BIN
Doc/FR309x技术规格书_v0.3.3.pdf
Normal file
BIN
Doc/FR309x技术规格书_v0.3.3.pdf
Normal file
Binary file not shown.
BIN
Doc/FR309x系统编程说明.pdf
Normal file
BIN
Doc/FR309x系统编程说明.pdf
Normal file
Binary file not shown.
BIN
Doc/FR30xx_Specification_V1.0.pdf
Normal file
BIN
Doc/FR30xx_Specification_V1.0.pdf
Normal file
Binary file not shown.
BIN
Doc/SquareLine Studio开发说明文档.pdf
Normal file
BIN
Doc/SquareLine Studio开发说明文档.pdf
Normal file
Binary file not shown.
BIN
Doc/集成工具链使用说明.pdf
Normal file
BIN
Doc/集成工具链使用说明.pdf
Normal file
Binary file not shown.
BIN
FreqChip_Download/FrDownloadSdk.dll
Normal file
BIN
FreqChip_Download/FrDownloadSdk.dll
Normal file
Binary file not shown.
122
FreqChip_Download/FreqChip_Download V1.3.7.14.txt
Normal file
122
FreqChip_Download/FreqChip_Download V1.3.7.14.txt
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
2023.11.06
|
||||||
|
30xx flash 8Mb 和16Mb
|
||||||
|
303x flash 为8Mb
|
||||||
|
|
||||||
|
2023.11.03
|
||||||
|
增加滚动条显示
|
||||||
|
|
||||||
|
2023.10.30
|
||||||
|
FreqChip_Download V1.3.7.12
|
||||||
|
优化界面显示
|
||||||
|
|
||||||
|
2023.10.26
|
||||||
|
FrDownloadSdk V1.2.7.2
|
||||||
|
修改8000 解保护ram 数组
|
||||||
|
FreqChip_Download V1.3.7.11
|
||||||
|
修改FR303X和FR30XX界面
|
||||||
|
|
||||||
|
2023.10.18
|
||||||
|
FreqChip_Download V1.3.7.10
|
||||||
|
增加英语界面
|
||||||
|
|
||||||
|
2023.10.16
|
||||||
|
FreqChip_Download V1.3.7.9
|
||||||
|
调整界面, 修改有些电脑显示不全的问题
|
||||||
|
|
||||||
|
2023.10.08
|
||||||
|
FreqChip_Download V1.3.7.8
|
||||||
|
FrDownloadSdk V1.2.7.1
|
||||||
|
升级波特率460800
|
||||||
|
|
||||||
|
增加直接烧录指定文件的方法
|
||||||
|
增加双击label, 取消文件选择
|
||||||
|
|
||||||
|
2023.09.25
|
||||||
|
FreqChip_Download V1.3.7.7
|
||||||
|
3090 擦除前512byte
|
||||||
|
|
||||||
|
|
||||||
|
2023.09.22
|
||||||
|
FreqChip_Download V1.3.7.6
|
||||||
|
3090增加指定文件烧录
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.5
|
||||||
|
修改ota size异常
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.4
|
||||||
|
修改509X crc校验失败
|
||||||
|
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.3
|
||||||
|
修改烧录失败时, 发送重启指令
|
||||||
|
增加擦除ota大小选项, 支持8010H和8000
|
||||||
|
|
||||||
|
2023.08.07
|
||||||
|
FrDownloadSdk V1.2.6.1
|
||||||
|
1.修改boot超时时间
|
||||||
|
|
||||||
|
2023.08.04
|
||||||
|
FrDownloadSdk V1.2.6.0
|
||||||
|
1.修改CRC超时时间, 根据文件大小自动调整
|
||||||
|
|
||||||
|
2023.07.3
|
||||||
|
FrDownloadSdk V1.2.5.1
|
||||||
|
1.修改5090校验地址0x08000000
|
||||||
|
|
||||||
|
2023.06.20
|
||||||
|
FrDownloadSdk V1.2.5.0
|
||||||
|
1.增加5090烧录
|
||||||
|
2.去掉1010 前8K的处理
|
||||||
|
|
||||||
|
FreqChip_Download V1.3.7.0
|
||||||
|
增加5090烧录
|
||||||
|
|
||||||
|
2023.06.07
|
||||||
|
FrDownloadSdk V1.2.4.0
|
||||||
|
增加芯片重启接口
|
||||||
|
|
||||||
|
2023.05.22
|
||||||
|
FrDownloadSdk V1.2.3.0
|
||||||
|
增加数据倒序写入flash接口.
|
||||||
|
增加101X烧录
|
||||||
|
FreqChip_Download V1.3.6.4
|
||||||
|
修改烧录工具倒序写mac到flash
|
||||||
|
增加101X烧录,优化crc校验
|
||||||
|
|
||||||
|
2023.05.12
|
||||||
|
FrDownloadSdk V1.2.2.0
|
||||||
|
新增1010烧录
|
||||||
|
FreqChip_Download V1.3.6
|
||||||
|
新增1010烧录
|
||||||
|
|
||||||
|
2023.04.26
|
||||||
|
FrDownloadSdk V1.2.1.10
|
||||||
|
修改兼容8012HB 解保护。
|
||||||
|
修改重启指令,只发一次,延时10ms 返回。
|
||||||
|
|
||||||
|
|
||||||
|
2023.04.13
|
||||||
|
FreqChip_Download V1.3.5.1
|
||||||
|
修改点击擦除时, 擦除大小不足的问题
|
||||||
|
|
||||||
|
2023.04.12
|
||||||
|
FreqChip_Download V1.3.5
|
||||||
|
修改全擦flash时,擦除大小不足的问题
|
||||||
|
|
||||||
|
2023.04.11
|
||||||
|
FrDownloadSdk V1.2.1.4
|
||||||
|
兼容8000CRC校验
|
||||||
|
|
||||||
|
2023.04.10
|
||||||
|
FreqChip_Download V1.3.4
|
||||||
|
FrDownloadSdk V1.2.1.3
|
||||||
|
兼容只读文件
|
||||||
|
增加8010H 8000 2000 CRC校验, 校验超时时间为20秒。
|
||||||
|
|
||||||
|
|
||||||
|
2023.03.21
|
||||||
|
1.升级2000 解保护补丁
|
||||||
|
2.增加8010T CRC校验
|
BIN
FreqChip_Download/FreqChip_Download.exe
Normal file
BIN
FreqChip_Download/FreqChip_Download.exe
Normal file
Binary file not shown.
BIN
FreqChip_Download/FreqChip_Download_Consle.exe
Normal file
BIN
FreqChip_Download/FreqChip_Download_Consle.exe
Normal file
Binary file not shown.
BIN
FreqChip_Download/en/FreqChip_Download.resources.dll
Normal file
BIN
FreqChip_Download/en/FreqChip_Download.resources.dll
Normal file
Binary file not shown.
16
FreqChip_Download/setting.ini
Normal file
16
FreqChip_Download/setting.ini
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[CONFIG]
|
||||||
|
Chip_Type=509X
|
||||||
|
Flash_Select=2MB
|
||||||
|
enlishToolStripMenuItem=False
|
||||||
|
Special_Enable=True
|
||||||
|
uart_port=COM3
|
||||||
|
Baud_Rate=921600
|
||||||
|
509X_Bin_Path=E:\MXC-A36\MXC-Screen_display\SW-FR-<2D><>ʾOK+BT_GPIO\examples\turnkey\lvgl_Dashboard_8080\MDK-ARM\output\boot_load_burn.bin
|
||||||
|
Auto_Burn=True
|
||||||
|
Auto_Reset=True
|
||||||
|
Flash_Allerase=True
|
||||||
|
Designate_file=E:\MXC-A36\MXC-Screen_display\SW-FR-<2D><>ʾOK+BT_GPIO\examples\turnkey\lvgl_Dashboard_8080\MDK-ARM\output\Project_mp_burn.bin
|
||||||
|
Designate_file_addr=0x72000
|
||||||
|
special_file1=E:\MXC-A36\MXC-Screen_display\SW-FR-<2D><>ʾOK+BT_GPIO\examples\turnkey\lvgl_Dashboard_8080\Resource\img.hex
|
||||||
|
special_file1_addr=0x13a000
|
||||||
|
special_file2=
|
10
Remind
Normal file
10
Remind
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
2024.03.06 新建仓库MXC-A39
|
||||||
|
1.Doc 文件夹保存项目相关文档
|
||||||
|
2.Zip 文件夹保存项目相关压缩包
|
||||||
|
3.MXC-A39 文件夹保存项目软件模拟器文件
|
||||||
|
4.MXC-Screen_display 文件夹保存屏显相关工程
|
||||||
|
5.Tool 文件夹保存软硬件相关工具以及烧录工具
|
||||||
|
6.FreqChip_Download 文件夹保存烧录工具
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
Tool/FreqChip_Download V1.3.7.8.zip
Normal file
BIN
Tool/FreqChip_Download V1.3.7.8.zip
Normal file
Binary file not shown.
BIN
Tool/FreqChip_Download V1.3.7.8/FrDownloadSdk.dll
Normal file
BIN
Tool/FreqChip_Download V1.3.7.8/FrDownloadSdk.dll
Normal file
Binary file not shown.
@ -0,0 +1,98 @@
|
|||||||
|
|
||||||
|
2023.10.08
|
||||||
|
FreqChip_Download V1.3.7.8
|
||||||
|
FrDownloadSdk V1.2.7.1
|
||||||
|
升级波特率460800
|
||||||
|
|
||||||
|
增加直接烧录指定文件的方法
|
||||||
|
增加双击label, 取消文件选择
|
||||||
|
|
||||||
|
2023.09.25
|
||||||
|
FreqChip_Download V1.3.7.7
|
||||||
|
3090 擦除前512byte
|
||||||
|
|
||||||
|
|
||||||
|
2023.09.22
|
||||||
|
FreqChip_Download V1.3.7.6
|
||||||
|
3090增加指定文件烧录
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.5
|
||||||
|
修改ota size异常
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.4
|
||||||
|
修改509X crc校验失败
|
||||||
|
|
||||||
|
|
||||||
|
2023.09.04
|
||||||
|
FreqChip_Download V1.3.7.3
|
||||||
|
修改烧录失败时, 发送重启指令
|
||||||
|
增加擦除ota大小选项, 支持8010H和8000
|
||||||
|
|
||||||
|
2023.08.07
|
||||||
|
FrDownloadSdk V1.2.6.1
|
||||||
|
1.修改boot超时时间
|
||||||
|
|
||||||
|
2023.08.04
|
||||||
|
FrDownloadSdk V1.2.6.0
|
||||||
|
1.修改CRC超时时间, 根据文件大小自动调整
|
||||||
|
|
||||||
|
2023.07.3
|
||||||
|
FrDownloadSdk V1.2.5.1
|
||||||
|
1.修改5090校验地址0x08000000
|
||||||
|
|
||||||
|
2023.06.20
|
||||||
|
FrDownloadSdk V1.2.5.0
|
||||||
|
1.增加5090烧录
|
||||||
|
2.去掉1010 前8K的处理
|
||||||
|
|
||||||
|
FreqChip_Download V1.3.7.0
|
||||||
|
增加5090烧录
|
||||||
|
|
||||||
|
2023.06.07
|
||||||
|
FrDownloadSdk V1.2.4.0
|
||||||
|
增加芯片重启接口
|
||||||
|
|
||||||
|
2023.05.22
|
||||||
|
FrDownloadSdk V1.2.3.0
|
||||||
|
增加数据倒序写入flash接口.
|
||||||
|
增加101X烧录
|
||||||
|
FreqChip_Download V1.3.6.4
|
||||||
|
修改烧录工具倒序写mac到flash
|
||||||
|
增加101X烧录,优化crc校验
|
||||||
|
|
||||||
|
2023.05.12
|
||||||
|
FrDownloadSdk V1.2.2.0
|
||||||
|
新增1010烧录
|
||||||
|
FreqChip_Download V1.3.6
|
||||||
|
新增1010烧录
|
||||||
|
|
||||||
|
2023.04.26
|
||||||
|
FrDownloadSdk V1.2.1.10
|
||||||
|
修改兼容8012HB 解保护。
|
||||||
|
修改重启指令,只发一次,延时10ms 返回。
|
||||||
|
|
||||||
|
|
||||||
|
2023.04.13
|
||||||
|
FreqChip_Download V1.3.5.1
|
||||||
|
修改点击擦除时, 擦除大小不足的问题
|
||||||
|
|
||||||
|
2023.04.12
|
||||||
|
FreqChip_Download V1.3.5
|
||||||
|
修改全擦flash时,擦除大小不足的问题
|
||||||
|
|
||||||
|
2023.04.11
|
||||||
|
FrDownloadSdk V1.2.1.4
|
||||||
|
兼容8000CRC校验
|
||||||
|
|
||||||
|
2023.04.10
|
||||||
|
FreqChip_Download V1.3.4
|
||||||
|
FrDownloadSdk V1.2.1.3
|
||||||
|
兼容只读文件
|
||||||
|
增加8010H 8000 2000 CRC校验, 校验超时时间为20秒。
|
||||||
|
|
||||||
|
|
||||||
|
2023.03.21
|
||||||
|
1.升级2000 解保护补丁
|
||||||
|
2.增加8010T CRC校验
|
BIN
Tool/FreqChip_Download V1.3.7.8/FreqChip_Download.exe
Normal file
BIN
Tool/FreqChip_Download V1.3.7.8/FreqChip_Download.exe
Normal file
Binary file not shown.
BIN
Tool/FreqChip_Download V1.3.7.8/FreqChip_Download_Consle.exe
Normal file
BIN
Tool/FreqChip_Download V1.3.7.8/FreqChip_Download_Consle.exe
Normal file
Binary file not shown.
3
Tool/FreqChip_Download V1.3.7.8/setting.ini
Normal file
3
Tool/FreqChip_Download V1.3.7.8/setting.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[CONFIG]
|
||||||
|
Chip_Type=801H
|
||||||
|
Flash_Select=512K
|
BIN
Tool/Lvgl_image_convert_tool.rar
Normal file
BIN
Tool/Lvgl_image_convert_tool.rar
Normal file
Binary file not shown.
BIN
Tool/Lvgl_image_convert_tool/Mutiple_image_convert.png
Normal file
BIN
Tool/Lvgl_image_convert_tool/Mutiple_image_convert.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
75
Tool/Lvgl_image_convert_tool/Readme.md
Normal file
75
Tool/Lvgl_image_convert_tool/Readme.md
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
2020-01-08:
|
||||||
|
|
||||||
|
修复了工具当前预览的图片被锁定无法外部修改的问题
|
||||||
|
|
||||||
|
2019-12-22:
|
||||||
|
|
||||||
|
增加了图片批量转换,并将图片名称作为转换后的文件名和变量名
|
||||||
|
1. 由于图片名可能作为转换后的变量名,增加了对图片名的规范检测,大体同前一个版本的lv_img_dsc_t检测一致
|
||||||
|
2. 根据lvgl支持的图片种类做了分类
|
||||||
|
3. 对各个图片加了转换前的检测结果及转换后的转换结果的tip提示
|
||||||
|
大致如下:
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
2019-11-20:
|
||||||
|
|
||||||
|
增加了对转换操作结果的验证,避免了转换图片时界面卡死的问题
|
||||||
|
|
||||||
|
添加了原php环境下的内存限制设置参数
|
||||||
|
|
||||||
|
对于转换提示的问题:
|
||||||
|
|
||||||
|
1.在转换图片时,提示转换成功,但找不到转换后的文件
|
||||||
|
|
||||||
|
原因:图片分辨率过大,修改php环境内存限制参数
|
||||||
|
|
||||||
|
解决办法:修改转换工具根目录下php.ini配置文件
|
||||||
|
```php
|
||||||
|
memory_limit = _xxx_M // _xxx_ 根据实际使用修改该值,图片分辨率越大,需要设置的值就越大
|
||||||
|
```
|
||||||
|
|
||||||
|
2.在转换图片时,提示转换失败
|
||||||
|
|
||||||
|
原因1:图片分辨率过大,转换时间太长(这么大的图片……),超时了
|
||||||
|
原因2:图片资源编码问题,测试发现截屏保存的图片不能直接转换,否则转换失败,先使用图片编辑工具打开,然后另存就可以了
|
||||||
|
|
||||||
|
目前发现以上问题
|
||||||
|
|
||||||
|
2019-11-16:
|
||||||
|
|
||||||
|
## 界面如下
|
||||||
|
设置输出文件类型,c测试没问题,bin格式没用到,如果有用到的朋友欢迎反馈
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
转换方式跟官方网页一样
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
lv_img_dsc_t,为生成的c文件下该图片资源的名字
|
||||||
|
|
||||||
|
|
||||||
|
2019-11-15:
|
||||||
|
|
||||||
|
## 说明
|
||||||
|
|
||||||
|
软件为基于LVGL离线版图片转换封装的小工具,避免了常使用界面工具的朋友操作控制台指令的不便利
|
||||||
|
|
||||||
|
运行环境为windows
|
||||||
|
|
||||||
|
修改了原官方离线版php文件接口,便于保存到指定目录
|
||||||
|
|
||||||
|
避免计算机没有php环境,在工具所在目录配置了一个php小环境(人懒,php不懂瞎裁)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 初衷
|
||||||
|
|
||||||
|
手头项目用到lvgl做界面设计,前期在lvgl官网做图片转换,感觉挺好 但界面嘛,美观度重口难调,所以这周把界面元素重设计了一遍, 然后昨天在官网做转换时,下载n次失败……所以就有了这个基于官方离线版封装的转换工具,有问题可以通过软件界面的qq和邮箱联系我
|
||||||
|
|
||||||
|
## 后续
|
||||||
|
|
||||||
|
如果后面有时间或者用到的话,加一个批量转换的。。。这个先用吧
|
828
Tool/Lvgl_image_convert_tool/img_conv_core.php
Normal file
828
Tool/Lvgl_image_convert_tool/img_conv_core.php
Normal file
@ -0,0 +1,828 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Converter {
|
||||||
|
var $dith; /*Dithering enable/disable*/
|
||||||
|
var $w; /*Image width*/
|
||||||
|
var $h; /*Image height*/
|
||||||
|
var $cf; /*Color format*/
|
||||||
|
var $alpha; /*Add alpha byte or not*/
|
||||||
|
var $chroma; /*Chroma keyed?*/
|
||||||
|
var $d_out; /*Output data (result)*/
|
||||||
|
var $img; /*Image resource*/
|
||||||
|
var $out_name; /*Name of the output file*/
|
||||||
|
var $output_dir;/*Dir of the output file*/
|
||||||
|
var $path; /*Path to the image file*/
|
||||||
|
|
||||||
|
/*Helper variables*/
|
||||||
|
var $r_act;
|
||||||
|
var $b_act;
|
||||||
|
var $g_act;
|
||||||
|
|
||||||
|
/*For dithering*/
|
||||||
|
var $r_earr; /*Classification error for next row of pixels*/
|
||||||
|
var $g_earr;
|
||||||
|
var $b_earr;
|
||||||
|
|
||||||
|
var $r_nerr; /*Classification error for next pixel*/
|
||||||
|
var $g_err;
|
||||||
|
var $b_nerr;
|
||||||
|
|
||||||
|
const CF_TRUE_COLOR_332 = 0; /*Helper formats. Used internally*/
|
||||||
|
const CF_TRUE_COLOR_565 = 1;
|
||||||
|
const CF_TRUE_COLOR_565_SWAP = 2;
|
||||||
|
const CF_TRUE_COLOR_888 = 3;
|
||||||
|
const CF_ALPHA_1_BIT = 4;
|
||||||
|
const CF_ALPHA_2_BIT = 5;
|
||||||
|
const CF_ALPHA_4_BIT = 6;
|
||||||
|
const CF_ALPHA_8_BIT = 7;
|
||||||
|
const CF_INDEXED_1_BIT = 8;
|
||||||
|
const CF_INDEXED_2_BIT = 9;
|
||||||
|
const CF_INDEXED_4_BIT = 10;
|
||||||
|
const CF_INDEXED_8_BIT = 11;
|
||||||
|
const CF_RAW = 12;
|
||||||
|
const CF_RAW_ALPHA = 13;
|
||||||
|
const CF_RAW_CHROMA = 12;
|
||||||
|
|
||||||
|
const CF_TRUE_COLOR = 100; /*Helper formats is C arrays contains all treu color formats (usin in "download")*/
|
||||||
|
const CF_TRUE_COLOR_ALPHA = 101;
|
||||||
|
const CF_TRUE_COLOR_CHROMA = 102;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param path the image file
|
||||||
|
* @param real_name the real image file name (different in online mode)
|
||||||
|
* @param out_name name of the output file
|
||||||
|
* @param dith 1: dither enabled; 0: disabled
|
||||||
|
* @param cf color format
|
||||||
|
*/
|
||||||
|
function __construct ($path, $real_name,$output, $out_name ,$dith) {
|
||||||
|
$this->dith = $dith;
|
||||||
|
$this->out_name = $out_name;
|
||||||
|
$this->path = $path;
|
||||||
|
$this->output_dir = $output;
|
||||||
|
|
||||||
|
$size = getimagesize($path);
|
||||||
|
$this->w = $size[0];
|
||||||
|
$this->h = $size[1];
|
||||||
|
|
||||||
|
$ext = pathinfo($real_name, PATHINFO_EXTENSION);
|
||||||
|
if(!strcmp(strtolower($ext), "png")) $this->img = imagecreatefrompng($path);
|
||||||
|
else if(!strcmp(strtolower($ext), "bmp")) $this->img = imagecreatefrombmp($path);
|
||||||
|
else if(!strcmp(strtolower($ext), "jpg")) $this->img = imagecreatefromjpeg($path);
|
||||||
|
else if(!strcmp(strtolower($ext), "jpeg")) $this->img = imagecreatefromjpeg($path);
|
||||||
|
else {
|
||||||
|
echo("$ext is a not supported image type. use png, jpg, jpeg or bmp");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->r_earr = array(); /*Classification error for next row of pixels*/
|
||||||
|
$this->g_earr = array();
|
||||||
|
$this->b_earr = array();
|
||||||
|
|
||||||
|
if($this->dith) {
|
||||||
|
for($i = 0; $i < $this->w + 2; ++$i){
|
||||||
|
$this->r_earr[$i] = 0;
|
||||||
|
$this->g_earr[$i] = 0;
|
||||||
|
$this->b_earr[$i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->r_nerr = 0; /*Classification error for next pixel*/
|
||||||
|
$this->g_nerr = 0;
|
||||||
|
$this->b_nerr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convert($cf, $alpha = 0) {
|
||||||
|
$this->cf = $cf;
|
||||||
|
$this->d_out = array();
|
||||||
|
$this->alpha = $alpha;
|
||||||
|
|
||||||
|
if($this->cf == self::CF_RAW || $this->cf == self::CF_RAW_ALPHA || $this->cf == self::CF_RAW_CHROMA) {
|
||||||
|
$myfile = fopen($this->path, "r") or die("Unable to open file!");
|
||||||
|
$this->d_out = unpack('C*', fread($myfile, filesize($this->path)));
|
||||||
|
fclose($myfile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$palette_size = 0;
|
||||||
|
if($this->cf == self::CF_INDEXED_1_BIT) $palette_size = 2;
|
||||||
|
if($this->cf == self::CF_INDEXED_2_BIT) $palette_size = 4;
|
||||||
|
if($this->cf == self::CF_INDEXED_4_BIT) $palette_size = 16;
|
||||||
|
if($this->cf == self::CF_INDEXED_8_BIT) $palette_size = 256;
|
||||||
|
|
||||||
|
if($palette_size) {
|
||||||
|
$img_tmp = imagecreatetruecolor($this->w, $this->h);
|
||||||
|
imagecopy ($img_tmp, $this->img, 0 , 0 , 0 , 0, $this->w , $this->h);
|
||||||
|
imagetruecolortopalette($this->img, false, $palette_size);
|
||||||
|
$real_palette_size = imagecolorstotal($this->img); /*The real number of colos in the image's palette*/
|
||||||
|
for($i = 0; $i < $palette_size; $i++) {
|
||||||
|
if($i < $real_palette_size) {
|
||||||
|
$c = imagecolorsforindex ($this->img , $i);
|
||||||
|
array_push($this->d_out, $c['blue'], $c['green'], $c['red'], 0xFF);
|
||||||
|
} else {
|
||||||
|
array_push($this->d_out, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Convert all the pixels*/
|
||||||
|
for($y = 0; $y < $this->h; $y++) {
|
||||||
|
$this->dith_reset();
|
||||||
|
|
||||||
|
for($x = 0; $x < $this->w; ++$x){
|
||||||
|
$this->conv_px($x, $y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Revert the original image if it was converted to indexed*/
|
||||||
|
if($palette_size) {
|
||||||
|
imagecopy ($this->img, $img_tmp, 0 , 0 , 0 , 0 , $this->w , $this->h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function format_to_c_array() {
|
||||||
|
|
||||||
|
$c_array = "";
|
||||||
|
$i = 0;
|
||||||
|
$y_end = $this->h;
|
||||||
|
$x_end = $this->w;
|
||||||
|
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332) {
|
||||||
|
$c_array .= "\n#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8";
|
||||||
|
if(!$this->alpha) $c_array .= "\n /*Pixel format: Red: 3 bit, Green: 3 bit, Blue: 2 bit*/";
|
||||||
|
else $c_array .= "\n /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/";
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565) {
|
||||||
|
$c_array .= "\n#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0";
|
||||||
|
if(!$this->alpha) $c_array .= "\n /*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit*/";
|
||||||
|
else $c_array .= "\n /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/";
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565_SWAP) {
|
||||||
|
$c_array .= "\n#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0";
|
||||||
|
if(!$this->alpha) $c_array .= "\n /*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 bytes are swapped*/";
|
||||||
|
else $c_array .= "\n /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/";
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
$c_array .= "\n#if LV_COLOR_DEPTH == 32";
|
||||||
|
if(!$this->alpha) $c_array .= "\n /*Pixel format: Fix 0xFF: 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit*/";
|
||||||
|
else "\n /*Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit*/";
|
||||||
|
} else if($this->cf == self::CF_INDEXED_1_BIT) {
|
||||||
|
$c_array .= "\n";
|
||||||
|
for($p = 0; $p < 2; $p ++) {
|
||||||
|
$c_array .= " 0x" . str_pad(dechex($this->d_out[$p * 4 + 0]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 1]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 2]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 3]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "\t/*Color of index $p*/\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $p * 4;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_2_BIT) {
|
||||||
|
$c_array .= "\n";
|
||||||
|
for($p = 0; $p < 4; $p ++) {
|
||||||
|
$c_array .= " 0x" . str_pad(dechex($this->d_out[$p * 4 + 0]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 1]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 2]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 3]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "\t/*Color of index $p*/\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $p * 4;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_4_BIT) {
|
||||||
|
$c_array .= "\n";
|
||||||
|
for($p = 0; $p < 16; $p ++) {
|
||||||
|
$c_array .= " 0x" . str_pad(dechex($this->d_out[$p * 4 + 0]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 1]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 2]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 3]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "\t/*Color of index $p*/\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $p * 4;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_8_BIT) {
|
||||||
|
$c_array .= "\n";
|
||||||
|
for($p = 0; $p < 256; $p ++) {
|
||||||
|
$c_array .= " 0x" . str_pad(dechex($this->d_out[$p * 4 + 0]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 1]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 2]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$p * 4 + 3]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$c_array .= "\t/*Color of index $p*/\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $p * 4;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_RAW || $this->cf == self::CF_RAW_ALPHA || $this->cf == self::CF_RAW_CHROMA) {
|
||||||
|
$y_end = 1;
|
||||||
|
$x_end = count($this->d_out);
|
||||||
|
$i = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for($y = 0; $y < $y_end; $y++) {
|
||||||
|
$c_array .= "\n ";
|
||||||
|
for($x = 0; $x < $x_end; $x++) {
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
if($this->alpha) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_TRUE_COLOR_565 || $this->cf == self::CF_TRUE_COLOR_565_SWAP) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
if($this->alpha) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", "; $i++;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_1_BIT || $this->cf == self::CF_INDEXED_1_BIT) {
|
||||||
|
if(($x & 0x7) == 0) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_2_BIT || $this->cf == self::CF_INDEXED_2_BIT) {
|
||||||
|
if(($x & 0x3) == 0) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_4_BIT || $this->cf == self::CF_INDEXED_4_BIT) {
|
||||||
|
if(($x & 0x1) == 0) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_8_BIT || $this->cf == self::CF_INDEXED_8_BIT) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_RAW || $this->cf == self::CF_RAW_ALPHA || $this->cf == self::CF_RAW_CHROMA) {
|
||||||
|
$c_array .= "0x" . str_pad(dechex($this->d_out[$i]), 2, '0', STR_PAD_LEFT) . ", ";
|
||||||
|
if($i != 0 && (($i % 16) == 0)) $c_array .= "\n ";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332 || $this->cf == self::CF_TRUE_COLOR_565 || $this->cf == self::CF_TRUE_COLOR_565_SWAP || $this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
$c_array .= "\n#endif";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $c_array;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_c_header() {
|
||||||
|
$c_header =
|
||||||
|
"#include \"lvgl/lvgl.h\"
|
||||||
|
|
||||||
|
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||||
|
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
";
|
||||||
|
$attr_name = "LV_ATTRIBUTE_IMG_" . strtoupper($this->out_name);
|
||||||
|
$c_header .=
|
||||||
|
"#ifndef $attr_name
|
||||||
|
#define $attr_name
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const LV_ATTRIBUTE_MEM_ALIGN $attr_name uint8_t " . $this->out_name . "_map[] = {";
|
||||||
|
|
||||||
|
return $c_header;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_c_footer($cf) {
|
||||||
|
$c_footer =
|
||||||
|
"\n};\n
|
||||||
|
const lv_img_dsc_t " . $this->out_name . " = {
|
||||||
|
.header.always_zero = 0,
|
||||||
|
.header.w = " . $this->w . ",
|
||||||
|
.header.h = " . $this->h . ",\n";
|
||||||
|
|
||||||
|
if($cf == self::CF_TRUE_COLOR) $c_footer .= " .data_size = " . $this->w * $this->h . " * LV_COLOR_SIZE / 8,\n .header.cf = LV_IMG_CF_TRUE_COLOR,";
|
||||||
|
else if($cf == self::CF_TRUE_COLOR_ALPHA) $c_footer .= " .data_size = " . $this->w * $this->h . " * LV_IMG_PX_SIZE_ALPHA_BYTE,\n .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA,";
|
||||||
|
else if($cf == self::CF_TRUE_COLOR_CHROMA) $c_footer .= " .data_size = " . $this->w * $this->h . " * LV_COLOR_SIZE / 8,\n .header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED,";
|
||||||
|
else if($cf == self::CF_ALPHA_1_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_ALPHA_1BIT,";
|
||||||
|
else if($cf == self::CF_ALPHA_2_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_ALPHA_2BIT,";
|
||||||
|
else if($cf == self::CF_ALPHA_4_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_ALPHA_4BIT,";
|
||||||
|
else if($cf == self::CF_ALPHA_8_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_ALPHA_8BIT,";
|
||||||
|
else if($cf == self::CF_INDEXED_1_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_INDEXED_1BIT,";
|
||||||
|
else if($cf == self::CF_INDEXED_2_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_INDEXED_2BIT,";
|
||||||
|
else if($cf == self::CF_INDEXED_4_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_INDEXED_4BIT,";
|
||||||
|
else if($cf == self::CF_INDEXED_8_BIT) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_INDEXED_8BIT,";
|
||||||
|
else if($cf == self::CF_RAW) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_RAW,";
|
||||||
|
else if($cf == self::CF_RAW_ALPHA) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_RAW_ALPHA,";
|
||||||
|
else if($cf == self::CF_RAW_CHROMA) $c_footer .= " .data_size = " . count($this->d_out) . ",\n .header.cf = LV_IMG_CF_RAW_CHROMA_KEYED,";
|
||||||
|
|
||||||
|
$c_footer .= "\n .data = " . $this->out_name . "_map,
|
||||||
|
};\n";
|
||||||
|
|
||||||
|
return $c_footer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function download_c($name, $cf = -1, $content = ""){
|
||||||
|
global $offline;
|
||||||
|
|
||||||
|
if(strlen($content) < 1) {
|
||||||
|
$content = $this->format_to_c_array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($cf < 0) $cf = $this->cf;
|
||||||
|
|
||||||
|
$out = $this->get_c_header() . $content . "" . $this->get_c_footer($cf);
|
||||||
|
$name = $name . ".c";
|
||||||
|
|
||||||
|
if($offline){
|
||||||
|
$name = $this->output_dir.$name;
|
||||||
|
$file = fopen($name, "w");
|
||||||
|
fwrite($file, $out);
|
||||||
|
fclose($file);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
header('Content-Type: application/text');
|
||||||
|
header('Content-disposition: attachment; filename='.$name);
|
||||||
|
header('Content-Length: ' . strlen($out));
|
||||||
|
|
||||||
|
echo($out);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function download_bin($name, $cf = -1, $content = 0){
|
||||||
|
global $offline;
|
||||||
|
|
||||||
|
if($content == 0) {
|
||||||
|
$content = $this->d_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($cf < 0) $cf = $this->cf;
|
||||||
|
$name .= ".bin";
|
||||||
|
|
||||||
|
$lv_cf = 4; /*Color format in LittlevGL*/
|
||||||
|
switch($cf) {
|
||||||
|
case self::CF_TRUE_COLOR:
|
||||||
|
$lv_cf = 4; break;
|
||||||
|
case self::CF_TRUE_COLOR_ALPHA:
|
||||||
|
$lv_cf = 5; break;
|
||||||
|
case self::CF_TRUE_COLOR_CHROMA:
|
||||||
|
$lv_cf = 6; break;
|
||||||
|
case self::CF_INDEXED_1_BIT:
|
||||||
|
$lv_cf = 7; break;
|
||||||
|
case self::CF_INDEXED_2_BIT:
|
||||||
|
$lv_cf = 8; break;
|
||||||
|
case self::CF_INDEXED_4_BIT:
|
||||||
|
$lv_cf = 9; break;
|
||||||
|
case self::CF_INDEXED_8_BIT:
|
||||||
|
$lv_cf = 10; break;
|
||||||
|
case self::CF_ALPHA_1_BIT:
|
||||||
|
$lv_cf = 11; break;
|
||||||
|
case self::CF_ALPHA_2_BIT:
|
||||||
|
$lv_cf = 12; break;
|
||||||
|
case self::CF_ALPHA_4_BIT:
|
||||||
|
$lv_cf = 13; break;
|
||||||
|
case self::CF_ALPHA_8_BIT:
|
||||||
|
$lv_cf = 14; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$header = $lv_cf + ($this->w << 10) + ($this->h << 21);
|
||||||
|
$header_bin = pack("V", $header);
|
||||||
|
|
||||||
|
$content = pack("C*", ...$content);
|
||||||
|
|
||||||
|
if($offline){
|
||||||
|
$name = $this->output_dir.$name;
|
||||||
|
$file = fopen($name, "w");
|
||||||
|
fwrite($file, $header_bin);
|
||||||
|
fwrite($file, $content);
|
||||||
|
fclose($file);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$len = strlen($content) + 4;
|
||||||
|
header('Content-Type: application/text');
|
||||||
|
header('Content-disposition: attachment; filename='.$name);
|
||||||
|
header('Content-Length:' . $len);
|
||||||
|
echo($header_bin[0]);
|
||||||
|
echo($header_bin[1]);
|
||||||
|
echo($header_bin[2]);
|
||||||
|
echo($header_bin[3]);
|
||||||
|
echo($content);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function conv_px($x, $y) {
|
||||||
|
$c = imagecolorat($this->img, $x, $y);
|
||||||
|
if($this->alpha){
|
||||||
|
$a = ($c & 0xff000000) >> 23; /*Alpha is 7 bit*/
|
||||||
|
if($a & 0x02) $a |= 0x01; /*Repeate the last bit: 0000000 -> 00000000; 1111110 -> 11111111*/
|
||||||
|
$a = 255 - $a;
|
||||||
|
} else {
|
||||||
|
$a = 0xff;
|
||||||
|
}
|
||||||
|
$r = ($c & 0x00ff0000) >> 16;
|
||||||
|
$g = ($c & 0x0000ff00) >> 8;
|
||||||
|
$b = ($c & 0x000000ff) >> 0;
|
||||||
|
|
||||||
|
$this->dith_next($r, $g, $b, $x);
|
||||||
|
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332) {
|
||||||
|
$c8 = ($this->r_act) | ($this->g_act >> 3) | ($this->b_act >> 6); //RGB332
|
||||||
|
array_push($this->d_out, $c8);
|
||||||
|
if($this->alpha) array_push($this->d_out, $a);
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565) {
|
||||||
|
$c16 = (($this->r_act) << 8) | (($this->g_act) << 3) | (($this->b_act) >> 3); //RGR565
|
||||||
|
array_push($this->d_out, $c16 & 0xFF);
|
||||||
|
array_push($this->d_out, ($c16 >> 8) & 0xFF);
|
||||||
|
if($this->alpha) array_push($this->d_out, $a);
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565_SWAP) {
|
||||||
|
$c16 = (($this->r_act) << 8) | (($this->g_act) << 3) | (($this->b_act) >> 3); //RGR565
|
||||||
|
array_push($this->d_out, ($c16 >> 8) & 0xFF);
|
||||||
|
array_push($this->d_out, $c16 & 0xFF);
|
||||||
|
if($this->alpha) array_push($this->d_out, $a);
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
array_push($this->d_out, $this->b_act);
|
||||||
|
array_push($this->d_out, $this->g_act);
|
||||||
|
array_push($this->d_out, $this->r_act);
|
||||||
|
array_push($this->d_out, $a);
|
||||||
|
} else if($this->cf == self::CF_ALPHA_1_BIT) {
|
||||||
|
$w = $this->w >> 3;
|
||||||
|
if($this->w & 0x07) $w++;
|
||||||
|
$p = $w * $y + ($x >> 3);
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
if($a > 0x80) {
|
||||||
|
$this->d_out[$p] |= 1 << (7 - ($x & 0x7));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_2_BIT) {
|
||||||
|
$w = $this->w >> 2;
|
||||||
|
if($this->w & 0x03) $w++;
|
||||||
|
|
||||||
|
$p = $w * $y + ($x >> 2);
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
$this->d_out[$p] |= ($a >> 6) << (6 - (($x & 0x3) * 2));
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_4_BIT) {
|
||||||
|
$w = $this->w >> 1;
|
||||||
|
if($this->w & 0x01) $w++;
|
||||||
|
|
||||||
|
$p = $w * $y + ($x >> 1);
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
$this->d_out[$p] |= ($a >> 4) << (4 - (($x & 0x1) * 4));
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_ALPHA_8_BIT) {
|
||||||
|
$p = $this->w * $y + $x;
|
||||||
|
$this->d_out[$p] = $a;
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_1_BIT) {
|
||||||
|
$w = $this->w >> 3;
|
||||||
|
if($this->w & 0x07) $w++;
|
||||||
|
|
||||||
|
$p = $w * $y + ($x >> 3) + 8; /* +8 for the palette*/
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
$this->d_out[$p] |= ($c & 0x1) << (7 - ($x & 0x7));
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_2_BIT) {
|
||||||
|
$w = $this->w >> 2;
|
||||||
|
if($this->w & 0x03) $w++;
|
||||||
|
|
||||||
|
$p = $w * $y + ($x >> 2) + 16; /* +16 for the palette*/
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
$this->d_out[$p] |= ($c & 0x3) << (6 - (($x & 0x3) * 2));
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_4_BIT) {
|
||||||
|
$w = $this->w >> 1;
|
||||||
|
if($this->w & 0x01) $w++;
|
||||||
|
|
||||||
|
$p = $w * $y + ($x >> 1) + 64; /* +64 for the palette*/
|
||||||
|
if(!isset($this->d_out[$p])) $this->d_out[$p] = 0; /*Clear the bits first*/
|
||||||
|
$this->d_out[$p] |= ($c & 0xF) << (4 - (($x & 0x1) * 4));
|
||||||
|
}
|
||||||
|
else if($this->cf == self::CF_INDEXED_8_BIT) {
|
||||||
|
$p = $this->w * $y + $x + 1024; /* +1024 for the palette*/
|
||||||
|
$this->d_out[$p] = $c & 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dith_reset() {
|
||||||
|
if($this->dith){
|
||||||
|
$this->r_nerr = 0;
|
||||||
|
$this->g_nerr = 0;
|
||||||
|
$this->b_nerr = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dith_next($r, $g, $b, $x) {
|
||||||
|
|
||||||
|
if($this->dith){
|
||||||
|
$this->r_act = $r + $this->r_nerr + $this->r_earr[$x+1];
|
||||||
|
$this->r_earr[$x+1] = 0;
|
||||||
|
|
||||||
|
$this->g_act = $g + $this->g_nerr + $this->g_earr[$x+1];
|
||||||
|
$this->g_earr[$x+1] = 0;
|
||||||
|
|
||||||
|
$this->b_act = $b + $this->b_nerr + $this->b_earr[$x+1];
|
||||||
|
$this->b_earr[$x+1] = 0;
|
||||||
|
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332) {
|
||||||
|
$this->r_act = $this->classify_pixel($this->r_act, 3);
|
||||||
|
$this->g_act = $this->classify_pixel($this->g_act, 3);
|
||||||
|
$this->b_act = $this->classify_pixel($this->b_act, 2);
|
||||||
|
|
||||||
|
if($this->r_act > 0xE0) $this->r_act = 0xE0;
|
||||||
|
if($this->g_act > 0xE0) $this->g_act = 0xE0;
|
||||||
|
if($this->b_act > 0xC0) $this->b_act = 0xC0;
|
||||||
|
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565 || $this->cf == self::CF_TRUE_COLOR_565_SWAP) {
|
||||||
|
$this->r_act = $this->classify_pixel($this->r_act, 5);
|
||||||
|
$this->g_act = $this->classify_pixel($this->g_act, 6);
|
||||||
|
$this->b_act = $this->classify_pixel($this->b_act, 5);
|
||||||
|
|
||||||
|
if($this->r_act > 0xF8) $this->r_act = 0xF8;
|
||||||
|
if($this->g_act > 0xFC) $this->g_act = 0xFC;
|
||||||
|
if($this->b_act > 0xF8) $this->b_act = 0xF8;
|
||||||
|
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
$this->r_act = $this->classify_pixel($this->r_act, 8);
|
||||||
|
$this->g_act = $this->classify_pixel($this->g_act, 8);
|
||||||
|
$this->b_act = $this->classify_pixel($this->b_act, 8);
|
||||||
|
|
||||||
|
if($this->r_act > 0xFF) $this->r_act = 0xFF;
|
||||||
|
if($this->g_act > 0xFF) $this->g_act = 0xFF;
|
||||||
|
if($this->b_act > 0xFF) $this->b_act = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->r_err = $r - $this->r_act;
|
||||||
|
$this->g_err = $g - $this->g_act;
|
||||||
|
$this->b_err = $b - $this->b_act;
|
||||||
|
|
||||||
|
$this->r_nerr = round((7 * $this->r_err) / 16);
|
||||||
|
$this->g_nerr = round((7 * $this->g_err) / 16);
|
||||||
|
$this->b_nerr = round((7 * $this->b_err) / 16);
|
||||||
|
|
||||||
|
$this->r_earr[$x] += round((3 * $this->r_err) / 16);
|
||||||
|
$this->g_earr[$x] += round((3 * $this->g_err) / 16);
|
||||||
|
$this->b_earr[$x] += round((3 * $this->b_err) / 16);
|
||||||
|
|
||||||
|
$this->r_earr[$x+1] += round((5 * $this->r_err) / 16);
|
||||||
|
$this->g_earr[$x+1] += round((5 * $this->g_err) / 16);
|
||||||
|
$this->b_earr[$x+1] += round((5 * $this->b_err) / 16);
|
||||||
|
|
||||||
|
$this->r_earr[$x+2] += round($this->r_err / 16);
|
||||||
|
$this->g_earr[$x+2] += round($this->g_err / 16);
|
||||||
|
$this->b_earr[$x+2] += round($this->b_err / 16);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if($this->cf == self::CF_TRUE_COLOR_332) {
|
||||||
|
$this->r_act = $this->classify_pixel($r, 3);
|
||||||
|
$this->g_act = $this->classify_pixel($g, 3);
|
||||||
|
$this->b_act = $this->classify_pixel($b, 2);
|
||||||
|
|
||||||
|
if($this->r_act > 0xE0) $this->r_act = 0xE0;
|
||||||
|
if($this->g_act > 0xE0) $this->g_act = 0xE0;
|
||||||
|
if($this->b_act > 0xC0) $this->b_act = 0xC0;
|
||||||
|
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_565 || $this->cf == self::CF_TRUE_COLOR_565_SWAP) {
|
||||||
|
$this->r_act = $this->classify_pixel($r, 5);
|
||||||
|
$this->g_act = $this->classify_pixel($g, 6);
|
||||||
|
$this->b_act = $this->classify_pixel($b, 5);
|
||||||
|
|
||||||
|
if($this->r_act > 0xF8) $this->r_act = 0xF8;
|
||||||
|
if($this->g_act > 0xFC) $this->g_act = 0xFC;
|
||||||
|
if($this->b_act > 0xF8) $this->b_act = 0xF8;
|
||||||
|
|
||||||
|
} else if($this->cf == self::CF_TRUE_COLOR_888) {
|
||||||
|
$this->r_act = $this->classify_pixel($r, 8);
|
||||||
|
$this->g_act = $this->classify_pixel($g, 8);
|
||||||
|
$this->b_act = $this->classify_pixel($b, 8);
|
||||||
|
|
||||||
|
if($this->r_act > 0xFF) $this->r_act = 0xFF;
|
||||||
|
if($this->g_act > 0xFF) $this->g_act = 0xFF;
|
||||||
|
if($this->b_act > 0xFF) $this->b_act = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function classify_pixel($value, $bits){
|
||||||
|
$tmp = 1 << (8 - $bits);
|
||||||
|
$val = round($value / $tmp, 0, PHP_ROUND_HALF_DOWN) * $tmp;
|
||||||
|
if($val < 0) $val = 0;
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$offline = 0;
|
||||||
|
if (!isset($_SERVER["HTTP_HOST"])) {
|
||||||
|
parse_str($argv[1], $_POST);
|
||||||
|
$offline = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($offline == 0){
|
||||||
|
/*The scripts runs ONLINE (likely on littelvgl.com)*/
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
$img_file = $_FILES["img_file"]["tmp_name"];
|
||||||
|
$img_file_name = $_FILES["img_file"]["name"];
|
||||||
|
$output_name = $_POST["name"];
|
||||||
|
$cf = $_POST["cf"];
|
||||||
|
$format = $_POST["format"];
|
||||||
|
$dith = $_POST["dith"];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
/*The scripts runs OFFLINE (likely in command)*/
|
||||||
|
if(isset($_POST["name"])){
|
||||||
|
$output_name = $_POST["name"];
|
||||||
|
echo"Convert:".$output_name;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo("Mising Name\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST["img"])){
|
||||||
|
$img_file = $_POST["img"];
|
||||||
|
$img_file_name = $_POST["img"];
|
||||||
|
echo "\nimg=".$img_file;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo("Mising image file\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST["format"])){
|
||||||
|
$format = $_POST["format"];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$format = "c_array";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST["dith"])){
|
||||||
|
$dith = $_POST["dith"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$dith = 0;
|
||||||
|
}
|
||||||
|
if(isset($_POST["outdir"]))
|
||||||
|
{
|
||||||
|
$outdir = $_POST["outdir"];
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
$outdir = "./";
|
||||||
|
echo "\noutdir=".$outdir;
|
||||||
|
}
|
||||||
|
if(isset($_POST["cf"])){
|
||||||
|
$cf = $_POST["cf"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$cf = "true_color";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$conv = new Converter($img_file, $img_file_name,$outdir, $output_name, $dith);
|
||||||
|
|
||||||
|
if(!strcmp($format, "c_array")) {
|
||||||
|
if(!strcmp($cf, "true_color") || !strcmp($cf, "true_color_alpha") || !strcmp($cf, "true_color_chroma")) {
|
||||||
|
$alpha = 0;
|
||||||
|
if(!strcmp($cf, "true_color_alpha")) $alpha = 1;
|
||||||
|
|
||||||
|
$conv->convert($conv::CF_TRUE_COLOR_332, $alpha);
|
||||||
|
$c_332 = $conv->format_to_c_array();
|
||||||
|
|
||||||
|
$conv->convert($conv::CF_TRUE_COLOR_565, $alpha);
|
||||||
|
$c_565 = $conv->format_to_c_array();
|
||||||
|
|
||||||
|
$conv->convert($conv::CF_TRUE_COLOR_565_SWAP, $alpha);
|
||||||
|
$c_565_swap = $conv->format_to_c_array();
|
||||||
|
|
||||||
|
$conv->convert($conv::CF_TRUE_COLOR_888, $alpha);
|
||||||
|
$c_888 = $conv->format_to_c_array();
|
||||||
|
|
||||||
|
$c_res = $c_332 . $c_565 . $c_565_swap . $c_888;
|
||||||
|
|
||||||
|
if(!strcmp($cf, "true_color")) $conv->download_c($conv->out_name, $conv::CF_TRUE_COLOR, $c_res);
|
||||||
|
if(!strcmp($cf, "true_color_alpha")) $conv->download_c($conv->out_name, $conv::CF_TRUE_COLOR_ALPHA, $c_res);
|
||||||
|
if(!strcmp($cf, "true_color_chroma")) $conv->download_c($conv->out_name, $conv::CF_TRUE_COLOR_CHROMA, $c_res);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_1")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_1_BIT, 1);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_2")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_2_BIT, 1);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_4")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_4_BIT, 1);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_8")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_8_BIT, 1);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_1")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_1_BIT);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_2")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_2_BIT);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_4")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_4_BIT);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_8")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_8_BIT);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "raw")) {
|
||||||
|
$conv->convert($conv::CF_RAW);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "raw_alpha")) {
|
||||||
|
$conv->convert($conv::CF_RAW_ALPHA, 1);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "raw_chroma")) {
|
||||||
|
$conv->convert($conv::CF_RAW_CHROMA);
|
||||||
|
$conv->download_c($conv->out_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*Binary download*/
|
||||||
|
else {
|
||||||
|
if(!strcmp($cf, "true_color") || !strcmp($cf, "true_color_alpha") || !strcmp($cf, "true_color_chroma")) {
|
||||||
|
$alpha = 0;
|
||||||
|
if(!strcmp($cf, "true_color_alpha")) $alpha = 1;
|
||||||
|
|
||||||
|
if (!strcmp($format, "bin_332")) $conv->convert($conv::CF_TRUE_COLOR_332, $alpha);
|
||||||
|
else if (!strcmp($format, "bin_565")) $conv->convert($conv::CF_TRUE_COLOR_565, $alpha);
|
||||||
|
else if (!strcmp($format, "bin_565_swap")) $conv->convert($conv::CF_TRUE_COLOR_565_SWAP, $alpha);
|
||||||
|
else if (!strcmp($format, "bin_888")) $conv->convert($conv::CF_TRUE_COLOR_888, $alpha);
|
||||||
|
else {
|
||||||
|
echo("Unknown output file format: $format");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if(!strcmp($cf, "true_color")) $conv->download_bin($conv->out_name, $conv::CF_TRUE_COLOR);
|
||||||
|
if(!strcmp($cf, "true_color_alpha")) $conv->download_bin($conv->out_name, $conv::CF_TRUE_COLOR_ALPHA);
|
||||||
|
if(!strcmp($cf, "true_color_chroma")) $conv->download_bin($conv->out_name, $conv::CF_TRUE_COLOR_CHROMA);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_1")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_1_BIT, 1);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_2")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_2_BIT, 1);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_4")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_4_BIT, 1);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "alpha_8")) {
|
||||||
|
$conv->convert($conv::CF_ALPHA_8_BIT, 1);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_1")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_1_BIT);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_2")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_2_BIT);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_4")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_4_BIT);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
else if(!strcmp($cf, "indexed_8")) {
|
||||||
|
$conv->convert($conv::CF_INDEXED_8_BIT);
|
||||||
|
$conv->download_bin($conv->out_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
$c_array .= "#include <stdint.h>
|
||||||
|
#include \"lv_conf.h\"
|
||||||
|
#include \"lvgl/lv_draw/lv_draw.h\""; */
|
||||||
|
|
||||||
|
|
||||||
|
//download("test", $c_565);
|
||||||
|
|
||||||
|
?>
|
BIN
Tool/Lvgl_image_convert_tool/lvgl_image_convert.exe
Normal file
BIN
Tool/Lvgl_image_convert_tool/lvgl_image_convert.exe
Normal file
Binary file not shown.
BIN
Tool/Lvgl_image_convert_tool/php.exe
Normal file
BIN
Tool/Lvgl_image_convert_tool/php.exe
Normal file
Binary file not shown.
4
Tool/Lvgl_image_convert_tool/php.ini
Normal file
4
Tool/Lvgl_image_convert_tool/php.ini
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
extension_dir = ".\"
|
||||||
|
extension=php_fileinfo.dll
|
||||||
|
extension=php_gd2.dll
|
||||||
|
memory_limit = 512M
|
BIN
Tool/Lvgl_image_convert_tool/php7.dll
Normal file
BIN
Tool/Lvgl_image_convert_tool/php7.dll
Normal file
Binary file not shown.
BIN
Tool/Lvgl_image_convert_tool/php_fileinfo.dll
Normal file
BIN
Tool/Lvgl_image_convert_tool/php_fileinfo.dll
Normal file
Binary file not shown.
BIN
Tool/Lvgl_image_convert_tool/php_gd2.dll
Normal file
BIN
Tool/Lvgl_image_convert_tool/php_gd2.dll
Normal file
Binary file not shown.
BIN
Tool/freqchip_font_tool_v04.rar
Normal file
BIN
Tool/freqchip_font_tool_v04.rar
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@
|
|||||||
|
//-------------------------------------------------------
|
||||||
|
//for lan_table_tool
|
||||||
|
excel_name=ref_utf8.xls
|
||||||
|
language_table_name=lan_str_table
|
||||||
|
output_for_dsp=0
|
||||||
|
//-------------------------------------------------------
|
||||||
|
font_file_name=arialuni.ttf
|
||||||
|
font_output_file_name=arialuni_field_bbp2_24px.c
|
||||||
|
font_bbp=2
|
||||||
|
font_size=24
|
||||||
|
target_file_name=lan_str_table.c
|
||||||
|
output_file_name=word_uni_24.bat
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,94 @@
|
|||||||
|
#ifndef __LAN_STR_TABLE_H__
|
||||||
|
#define __LAN_STR_TABLE_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define LAN_STR_TABLE_NUM 15
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
extern const char * const lan_str_table[][15];
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum{
|
||||||
|
STR_ID_ENGLISH,
|
||||||
|
STR_ID_APP_SCANNING_BINDING,
|
||||||
|
STR_ID_APP_ABOUT,
|
||||||
|
STR_ID_AM,
|
||||||
|
STR_ID_PM,
|
||||||
|
STR_ID_SUM,
|
||||||
|
STR_ID_MON,
|
||||||
|
STR_ID_TUE,
|
||||||
|
STR_ID_WED,
|
||||||
|
STR_ID_THU,
|
||||||
|
STR_ID_FRI,
|
||||||
|
STR_ID_SAT,
|
||||||
|
STR_ID_NORMAL,
|
||||||
|
STR_ID_MIN,
|
||||||
|
STR_ID_UPGRADING,
|
||||||
|
STR_ID_UPGRADE_SUCCESSFULLY,
|
||||||
|
STR_ID_UPGRADE_FAILURE,
|
||||||
|
STR_ID_REBOOTING,
|
||||||
|
STR_ID_IN_SYNC,
|
||||||
|
STR_ID_SYNCHRONIZATION_SUCCEEDED,
|
||||||
|
STR_ID_SECOND,
|
||||||
|
STR_ID_HOUR,
|
||||||
|
STR_ID_MINUTE,
|
||||||
|
STR_ID_CHINESE,
|
||||||
|
STR_ID_KOREAN,
|
||||||
|
STR_ID_JAPANESE,
|
||||||
|
STR_ID_GERMAN,
|
||||||
|
STR_ID_SPANISH,
|
||||||
|
STR_ID_FRENCH,
|
||||||
|
STR_ID_ITALIAN,
|
||||||
|
STR_ID_PORTUGUESE,
|
||||||
|
STR_ID_ARABIC,
|
||||||
|
STR_ID_INDIA,
|
||||||
|
STR_ID_HINDI,
|
||||||
|
STR_ID_POLISH_LANGUAGE,
|
||||||
|
STR_ID_RUSSIAN,
|
||||||
|
STR_ID_DUTCH_LANGUAGE,
|
||||||
|
STR_ID_TURKISH_LANGUAGE,
|
||||||
|
STR_ID_BENGALI_LANGUAGE,
|
||||||
|
STR_ID_URDU,
|
||||||
|
STR_ID_INDONESIAN_LANGUAGE,
|
||||||
|
STR_ID_PUNJABI_LANGUAGE,
|
||||||
|
STR_ID_THAI,
|
||||||
|
STR_ID_CZECH_LANGUAGE,
|
||||||
|
STR_ID_SETTINGS,
|
||||||
|
STR_ID_THEME,
|
||||||
|
STR_ID_LIGHT,
|
||||||
|
STR_ID_BLUETOOTH,
|
||||||
|
STR_ID_OTHER_SETTING,
|
||||||
|
STR_ID_INFORMATION,
|
||||||
|
STR_ID_RETURN,
|
||||||
|
STR_ID_PRESSURE,
|
||||||
|
STR_ID_FAULT_CODE,
|
||||||
|
STR_ID_THEME_SELECT,
|
||||||
|
STR_ID_THEME_BG,
|
||||||
|
STR_ID_SELF_ADAPTION,
|
||||||
|
STR_ID_NOW_FAULT_CODE,
|
||||||
|
STR_ID_HIS_FAULT_CODE,
|
||||||
|
STR_ID_AUTO,
|
||||||
|
STR_ID_BT_SWITCH,
|
||||||
|
STR_ID_IMPERIAL,
|
||||||
|
STR_ID_METRIC,
|
||||||
|
STR_ID_UNIT,
|
||||||
|
STR_ID_LANGUAGE,
|
||||||
|
STR_ID_IN_LEARNING,
|
||||||
|
STR_ID_SENSOR_FRONT,
|
||||||
|
STR_ID_SENSOR_REAR,
|
||||||
|
STR_ID_SENSOR_LOSS,
|
||||||
|
STR_ID_TIME,
|
||||||
|
STR_ID_SPEED_MAX,
|
||||||
|
STR_ID_SPEED_AVG,
|
||||||
|
STR_ID_MILEAGE_TRIP,
|
||||||
|
STR_ID_MILEAGE_ODO,
|
||||||
|
STR_ID_SWITCH_OPEN,
|
||||||
|
STR_ID_SWITCH_SHUT,
|
||||||
|
STR_ID_LAN_STR_TABLEMAX,
|
||||||
|
}LAN_STR_ID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
lv_font_conv --no-compress --format lvgl --font arialuni.ttf -o arialuni_field_bbp2_24px.c --bpp 2 --size 24 -r 0x20 -r 0x2d-0x2e -r 0x41-0x50 -r 0x52-0x55 -r 0x57 -r 0x5a -r 0x61-0x70 -r 0x72-0x77 -r 0x79-0x7a -r 0x41d -r 0x435 -r 0x439 -r 0x43c -r 0x43e -r 0x5b0 -r 0x5b4 -r 0x5b7 -r 0x5c1 -r 0x5d4 -r 0x5d9 -r 0x5dc -r 0x5e7 -r 0x5e9-0x5ea -r 0x30c8 -r 0x30df -r 0x30e5 -r 0x30fc -r 0x4e00 -r 0x4e09-0x4e0b -r 0x4e22 -r 0x4e2d -r 0x4e3b -r 0x4e4c -r 0x4e60 -r 0x4e8c -r 0x4e8e -r 0x4e94 -r 0x4e9a -r 0x4eae -r 0x4ed6 -r 0x4f20 -r 0x4f2f -r 0x4f4d -r 0x4fc4 -r 0x4fe1 -r 0x514b -r 0x516c-0x516d -r 0x5170 -r 0x5173 -r 0x5176 -r 0x5206-0x5207 -r 0x5229 -r 0x5236 -r 0x524d -r 0x529f-0x52a0 -r 0x52a8 -r 0x5339 -r 0x5347-0x5348 -r 0x5355 -r 0x5370 -r 0x5386 -r 0x538b -r 0x53f2 -r 0x540c -r 0x540e -r 0x542f -r 0x5468 -r 0x5668 -r 0x56db -r 0x56de -r 0x571f -r 0x5730 -r 0x5747 -r 0x5927 -r 0x5931 -r 0x5b5f -r 0x5b66 -r 0x5c0f -r 0x5c14 -r 0x5c3c -r 0x5e38 -r 0x5e73 -r 0x5e94 -r 0x5ea6 -r 0x5f00 -r 0x5f53 -r 0x5fb7 -r 0x603b -r 0x606f -r 0x610f -r 0x611f -r 0x6210 -r 0x6216 -r 0x626b -r 0x62c9 -r 0x6362 -r 0x6377 -r 0x6545 -r 0x6587 -r 0x65c1 -r 0x65e5 -r 0x65f6 -r 0x666e-0x666f -r 0x6700 -r 0x6b63 -r 0x6b65 -r 0x6cd5 -r 0x6ce2 -r 0x6cf0 -r 0x7259 -r 0x73ed -r 0x7801 -r 0x79d2 -r 0x7a0b -r 0x7ea7 -r 0x7f6e -r 0x8033 -r 0x80cc -r 0x80ce -r 0x81ea -r 0x82f1 -r 0x8377 -r 0x8404 -r 0x8461 -r 0x84dd -r 0x897f -r 0x8a00 -r 0x8ba1 -r 0x8bbe -r 0x8bed -r 0x8d25 -r 0x8f66 -r 0x8f6e -r 0x8f7d -r 0x8f86 -r 0x8fd4 -r 0x9002 -r 0x901f -r 0x906e -r 0x90fd -r 0x914d -r 0x91cc-0x91cd -r 0x949f -r 0x95f4 -r 0x963f -r 0x969c -r 0x97e9 -r 0x9898 -r 0x9ad8 -r 0xac70 -r 0xc18c -r 0xc74c
|
BIN
Tool/freqchip_tool_img_cut_rle_encode_v09.rar
Normal file
BIN
Tool/freqchip_tool_img_cut_rle_encode_v09.rar
Normal file
Binary file not shown.
@ -0,0 +1,7 @@
|
|||||||
|
img_head_address=0x00000000
|
||||||
|
img_cut_w=368
|
||||||
|
img_cut_h=76
|
||||||
|
rle_enable=0
|
||||||
|
upper_enable=1
|
||||||
|
cut_exclude_char=clock_hand
|
||||||
|
align_left_space=80
|
Binary file not shown.
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef __IMG_DEF_H__
|
||||||
|
#define __IMG_DEF_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define img_head_address 0x0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
BIN
Tool/freqchip_tool_string_c_to_bin_V02.rar
Normal file
BIN
Tool/freqchip_tool_string_c_to_bin_V02.rar
Normal file
Binary file not shown.
3
Tool/freqchip_tool_string_c_to_bin_V02/config.txt
Normal file
3
Tool/freqchip_tool_string_c_to_bin_V02/config.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
align_left_space=50
|
||||||
|
flash_head_address=0xA12000
|
||||||
|
output_c_file_dir=
|
Binary file not shown.
BIN
Tool/node-v16.15.0-x64.msi
Normal file
BIN
Tool/node-v16.15.0-x64.msi
Normal file
Binary file not shown.
BIN
Zip/MXC-A39.rar
Normal file
BIN
Zip/MXC-A39.rar
Normal file
Binary file not shown.
BIN
Zip/lvgl_Dashboard_8080.zip
Normal file
BIN
Zip/lvgl_Dashboard_8080.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user