Fix system-settings icon dark fill on focus blue rows.
Treat baked #242B3A as transparent when drawing icons, and limit #IV octave drop to keys 10-12. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
280aa1f752
commit
0a0bd9b3ea
|
|
@ -1240,8 +1240,10 @@ uint8_t GetChordNotesByType(uint8_t MIDI_Index,uint8_t type,uint8_t *buff)
|
|||
for (i = 0; i < n; i++)
|
||||
buff[i] += mGuiData[GUI_TRANSPOSE].Current;
|
||||
|
||||
/* 音师:所有调的 #四级 — 整组和弦低八度,音域压在一个八度内 */
|
||||
if (chord_type_index_map[MIDI_Index].PitchOffset == 2)
|
||||
/* 音师:仅所有调的 #四级(键 10~12 + 升)— 整组低八度,音域压在一个八度内
|
||||
* 最低音 = #IV,最高音 ≤ 自然 IV。勿对六级等其它升号和弦套用。 */
|
||||
if (MIDI_Index >= 10 && MIDI_Index <= 12 &&
|
||||
chord_type_index_map[MIDI_Index].PitchOffset == 2)
|
||||
{
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1166,7 +1166,7 @@ void Draw_System_Item_List(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
|||
}
|
||||
break;
|
||||
case GUI_BLUETOOTH_SW:
|
||||
/* 蓝牙符:外置 Flash 当前在 RESTORE 槽(13x21);SET_BLUETOOTH 槽曾误打包调音台 */
|
||||
/* 素材:系统设置图标-11(白蓝牙符);Flash 槽名 RESTORE,尺寸 13x21 */
|
||||
LCD_WR_PIC_FROM_FLASH_Trans(UI->x + 12,
|
||||
(uint16_t)(UI->y + (UI->h - UI0902_ICON_SYS_RESTORE_H) / 2),
|
||||
UI0902_ICON_SYS_RESTORE_W, UI0902_ICON_SYS_RESTORE_H,
|
||||
|
|
@ -1183,7 +1183,7 @@ void Draw_System_Item_List(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
|||
drv_nvm_save_to_flash();
|
||||
break;
|
||||
case GUI_AUTOCLOSE:
|
||||
/* 0902-07:电源图标;档位按手册 15/30/45/60/不自动 */
|
||||
/* 素材:系统设置图标-12(电源符 / ABOUT 槽 18x21) */
|
||||
LCD_WR_PIC_FROM_FLASH_Trans(UI->x+12, UI->y + (UI->h - 21) / 2, 18, 21, UI0902_ICON_SYS_ABOUT_ADDR);
|
||||
ApplyAutoCloseIndex(Group->Current);
|
||||
UI_DrawTriLeft(val_x1, chev_cy);
|
||||
|
|
|
|||
|
|
@ -168,7 +168,23 @@ void LCD_WR_PIC(uint16_t x, uint16_t y, uint16_t length, uint16_t width, const u
|
|||
}
|
||||
}
|
||||
|
||||
/* 跳过近黑色像素(图标导出底色常为 0x0000/0x0001/0x0022,非纯 BLACK) */
|
||||
/* 跳过近黑色像素(图标导出底色常为 0x0000/0x0001/0x0022,非纯 BLACK)
|
||||
* 同时跳过列表行底 #242B3A(0x2147):系统设置等图标把未选中行色烘焙进 PNG,
|
||||
* 焦点蓝底上若不抠掉会呈黑块。 */
|
||||
static uint8_t LCD_PicColorIsTransparent(uint16_t c)
|
||||
{
|
||||
uint8_t r5 = (uint8_t)((c >> 11) & 0x1F);
|
||||
uint8_t g6 = (uint8_t)((c >> 5) & 0x3F);
|
||||
uint8_t b5 = (uint8_t)(c & 0x1F);
|
||||
|
||||
if (r5 <= 1 && g6 <= 2 && b5 <= 2)
|
||||
return 1;
|
||||
/* UI0902_ROW_BG 0x2147 ≈ R5=4 G6=10 B5=7;含打包抗锯齿邻色 */
|
||||
if (r5 >= 2 && r5 <= 6 && g6 >= 7 && g6 <= 14 && b5 >= 4 && b5 <= 11)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LCD_WR_PIC_Trans(uint16_t x, uint16_t y, uint16_t length, uint16_t width,
|
||||
const uint8_t data[], uint16_t key_color)
|
||||
{
|
||||
|
|
@ -184,12 +200,8 @@ void LCD_WR_PIC_Trans(uint16_t x, uint16_t y, uint16_t length, uint16_t width,
|
|||
uint8_t hi = data[i * 2];
|
||||
uint8_t lo = data[i * 2 + 1];
|
||||
uint16_t c = (uint16_t)((hi << 8) | lo);
|
||||
uint8_t r5 = (uint8_t)((c >> 11) & 0x1F);
|
||||
uint8_t g6 = (uint8_t)((c >> 5) & 0x3F);
|
||||
uint8_t b5 = (uint8_t)(c & 0x1F);
|
||||
|
||||
/* 近黑视为透明,避免图标黑底方块 */
|
||||
if (r5 <= 1 && g6 <= 2 && b5 <= 2)
|
||||
if (LCD_PicColorIsTransparent(c))
|
||||
continue;
|
||||
|
||||
LCD_DrawPoint((uint16_t)(x + (i % length)),
|
||||
|
|
@ -254,7 +266,7 @@ void LCD_WR_PIC_ClipX(uint16_t x, uint16_t y, uint16_t full_w, uint16_t h,
|
|||
}
|
||||
}
|
||||
|
||||
/* 从 W25Q128 按行读取并透明显示(跳过近黑像素),复用 pic_batch_buf,无大块静态 RAM */
|
||||
/* 从 W25Q128 按行读取并透明显示(跳过近黑 / 行底色像素),复用 pic_batch_buf,无大块静态 RAM */
|
||||
void LCD_WR_PIC_FROM_FLASH_Trans(uint16_t x, uint16_t y, uint16_t length, uint16_t width, uint32_t flash_addr)
|
||||
{
|
||||
uint16_t row, col;
|
||||
|
|
@ -267,10 +279,7 @@ void LCD_WR_PIC_FROM_FLASH_Trans(uint16_t x, uint16_t y, uint16_t length, uint16
|
|||
for (col = 0; col < length; col++)
|
||||
{
|
||||
uint16_t c = (uint16_t)((pic_batch_buf[col * 2U] << 8) | pic_batch_buf[col * 2U + 1U]);
|
||||
uint8_t r5 = (uint8_t)((c >> 11) & 0x1F);
|
||||
uint8_t g6 = (uint8_t)((c >> 5) & 0x3F);
|
||||
uint8_t b5 = (uint8_t)(c & 0x1F);
|
||||
if (r5 <= 1 && g6 <= 2 && b5 <= 2)
|
||||
if (LCD_PicColorIsTransparent(c))
|
||||
continue;
|
||||
LCD_DrawPoint((uint16_t)(x + col), (uint16_t)(y + row), c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,13 @@ def rgba_to_rgb565(im):
|
|||
for y in range(h):
|
||||
for x in range(w):
|
||||
r, g, b, a = px[x, y]
|
||||
# 低透明 / 近黑 / 列表行底 #242B3A → 透明(焦点蓝底上避免黑块)
|
||||
if a < 40 or (r < 12 and g < 12 and b < 12):
|
||||
out[i] = 0
|
||||
out[i + 1] = 0
|
||||
elif abs(r - ROW_BG[0]) <= 18 and abs(g - ROW_BG[1]) <= 18 and abs(b - ROW_BG[2]) <= 18:
|
||||
out[i] = 0
|
||||
out[i + 1] = 0
|
||||
else:
|
||||
r = (r * a) // 255
|
||||
g = (g * a) // 255
|
||||
|
|
|
|||
Loading…
Reference in New Issue