feat: HDMI-Tool 与 I2C-Inject 首版工具集
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
生成 800x600 纯色测试图, 供 RGB 位交换(0x606E)验证使用
|
||||
================================================================
|
||||
配合 demo 板当前 EDID 首选时序 800x600@60, 全屏纯色输出。
|
||||
用法: python gen_solid_colors.py → 输出到 tools/dist/solid_*.png
|
||||
在 HDMI-Tool 中通过自定义栏位(⚙ 换图)加载。
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
||||
W, H = 800, 600 # 与 demo 板 EDID 首选时序一致, 全屏铺满
|
||||
BASE = os.path.dirname(os.path.abspath(__file__))
|
||||
OUT = os.path.join(BASE, 'dist')
|
||||
|
||||
# (文件名后缀, RGB 值, 用途)
|
||||
COLORS = [
|
||||
('FF0000', (0xFF, 0x00, 0x00), '通道映射: R=D[23:16]'),
|
||||
('00FF00', (0x00, 0xFF, 0x00), '通道映射: G=D[15:8]'),
|
||||
('0000FF', (0x00, 0x00, 0xFF), '通道映射: B=D[7:0]'),
|
||||
('AA0000', (0xAA, 0x00, 0x00), 'R 交换检测: 0xAA(10101010)'),
|
||||
('550000', (0x55, 0x00, 0x00), 'R 交换检测: 0x55(01010101)'),
|
||||
('00AA00', (0x00, 0xAA, 0x00), 'G 交换检测'),
|
||||
('005500', (0x00, 0x55, 0x00), 'G 交换检测'),
|
||||
('0000AA', (0x00, 0x00, 0xAA), 'B 交换检测'),
|
||||
('000055', (0x00, 0x00, 0x55), 'B 交换检测'),
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
os.makedirs(OUT, exist_ok=True)
|
||||
for suffix, rgb, note in COLORS:
|
||||
img = Image.new('RGB', (W, H), rgb)
|
||||
path = os.path.join(OUT, f'solid_{suffix}.png')
|
||||
img.save(path)
|
||||
print(f'写出 {path} # {note}')
|
||||
print(f'\n共 {len(COLORS)} 张, 分辨率 {W}x{H}(匹配 demo 板 800x600 EDID)。')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user