牛卧堂MCU技术交流

标题: How to change color format from RGB565 to RGB888 [打印本页]

作者: yli    时间: 2020-4-24 09:33
标题: How to change color format from RGB565 to RGB888
Platform: N9H20
Platform resource link: https://www.nuvoton.com/hq/products/app ... _locale=en
BSP link: https://github.com/OpenNuvoton/N9H20_emWin_NonOS
BSP contains tool and BSP sample pre-built binaries: https://www.nuvoton.com/products/microp ... ware&tab=2
Sample code brief: BSP emWin sample utilizes RGB565 as default color format for performance purpose, now change RGB888 to get more quality improvement.
IDE and tool-chain: Keil professional and ARMCC5
Notice:
1. This sample will refer to modified main.c and LCDConf.c

Please note that to run the sample code we need to download the latest version of N9H20 BSP from OpenNuvoton.

2:
To modify LCDConf.c, and the source path is in \N9H20_emWin_NonOS-master\BSP\ThirdParty\emWin\Config\LCDConf.c

Before:
#define COLOR_CONVERSION GUICC_M565
#define DISPLAY_DRIVER GUIDRV_LIN_16

After:
#define COLOR_CONVERSION GUICC_M888
#define DISPLAY_DRIVER GUIDRV_LIN_32

3:
To modify main.c, and the source path is in \N9H20_emWin_NonOS-master\BSP\SampleCode\emWin\SimpleDemo\main.c

Before:
UINT8 u8FrameBuf[XSIZE_PHYS*YSIZE_PHYS*2] __attribute__((aligned(32)));
lcdFormat.ucVASrcFormat = DRVVPOST_FRAME_RGB565;

After:
UINT8 u8FrameBuf[XSIZE_PHYS*YSIZE_PHYS*4] __attribute__((aligned(32)));
lcdFormat.ucVASrcFormat = DRVVPOST_FRAME_RGBx888;

SimpleDemo_565to888.zip (23.42 KB, 下载次数: 1205)






欢迎光临 牛卧堂MCU技术交流 (http://nuvoton-mcu.com/) Powered by Discuz! X3.2