Hello,
The development team looked into this and have found the behaviour is related to EVEs firmware.
Users can add the BITMAP_SWIZZLE(RED,GREEN,BLUE,ALPHA) before drawing the bitmap to rectify the issue.
Another finding is that if the bitmap is not in ASTC format, the colour can be shown correctly.
Here is the reference code:
void App_task_email_2020jan15() {
const uint32_t fontNo = 0;
const uint32_t fontAddr = 0;
Gpu_CoCmd_FlashHelper_SwitchFullMode(g_phost);
Common_Text("Testing bitmap issue after Cmd_SetFont2");
Gpu_CoCmd_FlashRead(g_phost, fontAddr, 20992, 1024);
uint16_t iw = 508;
uint16_t ih = 120;
uint16_t format = COMPRESSED_RGBA_ASTC_4x4_KHR;
while (1) {
/// Cmd_SetFont2
if(1){
Common_StartDisplay();
App_WrCoCmd_Buffer(g_phost, SAVE_CONTEXT());
App_WrCoCmd_Buffer(g_phost, COLOR_RGB(0, 0, 0));
Gpu_CoCmd_SetFont2(g_phost, fontNo, fontAddr, 0);
Gpu_CoCmd_Text(g_phost, 0, 0, fontNo, 0, "\x002d\x002c\x0039\x0032\x003b\x0035\x0037\x003c\x003d\x001c\x0029\x0036");
Gpu_CoCmd_ResetFonts(g_phost);
App_WrCoCmd_Buffer(g_phost, RESTORE_CONTEXT());
Common_EndDisplay();
EVE_sleep(2000);
}
Gpu_CoCmd_ColdStart(g_phost);
/// Draw bitmap with same handle number
{
if (1){
Gpu_CoCmd_Dlstart(g_phost);
App_WrCoCmd_Buffer(g_phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(g_phost, COLOR_RGB(255, 255, 255));
}
Gpu_CoCmd_ResetFonts(g_phost);
App_WrCoCmd_Buffer(g_phost, SAVE_CONTEXT());
Gpu_Hal_LoadImageToMemory(g_phost, TEST_DIR "\\car_508x120_COMPRESSED_RGBA_ASTC_4x4_KHR.raw", RAM_G + 1024, LOAD);
Gpu_CoCmd_SetBitmap(g_phost, RAM_G + 1024, format, iw, ih);
App_WrCoCmd_Buffer(g_phost, BITMAP_SWIZZLE(RED,GREEN,BLUE,ALPHA));
App_WrCoCmd_Buffer(g_phost, BITMAP_HANDLE(fontNo));
App_WrCoCmd_Buffer(g_phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(g_phost, VERTEX2II(0, 0, 0, 0));
App_WrCoCmd_Buffer(g_phost, END());
App_WrCoCmd_Buffer(g_phost, RESTORE_CONTEXT());
Common_EndDisplay();
EVE_sleep(2000);
}
} // loop forever
}
Best Regards,
BRT Community