1
Discussion - Software / Re: Basic Question - Image overlap
« on: September 04, 2020, 01:06:59 AM »
This is a testing code.
Please , check the code.
And, LCD screen is changed for a short time.
I think that the if RAM_G is updating, than LCD screen is changed .
Is there a command (methods) on the LCD to lock or stop the output while modifying the RAM_G data?
Thanks you.
#define Handle_BG 0
#define Handle_Small 1
void Image_Test_2(Gpu_Hal_Context_t *phost)
{
uint8_t *p;
uint32_t imgID;
uint32_t imgFormat, imgSize, sizeX, sizeY, posX, posY;
// Large Image ------------------------------------------------------------
p = (uint8_t *)Large_Image;
imgFormat = RGB565;
imgSize = 52804;
sizeX = 480;
sizeY = 272;
posX = 0;
posY = 0;
/* Load Compressed Image */
Gpu_CoCmd_Inflate(phost, 0);
Gpu_Hal_WrCmdBufFromFlash(phost, p, imgSize);
//
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR_TAG(1));
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
// App_WrCoCmd_Buffer(phost, COLOR_A(255));
// App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_BG));
App_WrCoCmd_Buffer(phost,BITMAP_SOURCE(0));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT(imgFormat, (sizeX*2), sizeY));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE(NEAREST, BORDER, BORDER, sizeX, sizeY));
App_WrCoCmd_Buffer(phost,BEGIN(BITMAPS));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_BG));
App_WrCoCmd_Buffer(phost,VERTEX2F(posX<<4 , posY<<4)); // (posX * 16, posY * 16)
//Start drawing bitmap
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, RESTORE_CONTEXT());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
// for Test
HAL_Delay(1000);
// Samll Image ------------------------------------------------------------
p = (uint8_t *)Samll_Image;
imgFormat = ARGB4;
imgSize = 6703;
sizeX = 264;
sizeY = 80;
posX = 100;
posY = 100;
/* Load Compressed Image */
Gpu_CoCmd_Inflate(phost, 0);
Gpu_Hal_WrCmdBufFromFlash(phost, p, imgSize);
//
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost,SCISSOR_XY( posX, posY));
App_WrCoCmd_Buffer(phost,SCISSOR_SIZE(sizeX,sizeY));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, CLEAR_TAG(1));
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, COLOR_A(255));
App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_Small));
App_WrCoCmd_Buffer(phost,BITMAP_SOURCE(0));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT(imgFormat, (sizeX*2), sizeY));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE(NEAREST, BORDER, BORDER, sizeX, sizeY));
App_WrCoCmd_Buffer(phost,BEGIN(BITMAPS));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_Small));
App_WrCoCmd_Buffer(phost,VERTEX2F(posX<<4 , posY<<4)); // (posX * 16, posY * 16)
//Start drawing bitmap
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, RESTORE_CONTEXT());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
}
Please , check the code.
And, LCD screen is changed for a short time.
I think that the if RAM_G is updating, than LCD screen is changed .
Is there a command (methods) on the LCD to lock or stop the output while modifying the RAM_G data?
Thanks you.
#define Handle_BG 0
#define Handle_Small 1
void Image_Test_2(Gpu_Hal_Context_t *phost)
{
uint8_t *p;
uint32_t imgID;
uint32_t imgFormat, imgSize, sizeX, sizeY, posX, posY;
// Large Image ------------------------------------------------------------
p = (uint8_t *)Large_Image;
imgFormat = RGB565;
imgSize = 52804;
sizeX = 480;
sizeY = 272;
posX = 0;
posY = 0;
/* Load Compressed Image */
Gpu_CoCmd_Inflate(phost, 0);
Gpu_Hal_WrCmdBufFromFlash(phost, p, imgSize);
//
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR_TAG(1));
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
// App_WrCoCmd_Buffer(phost, COLOR_A(255));
// App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_BG));
App_WrCoCmd_Buffer(phost,BITMAP_SOURCE(0));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT(imgFormat, (sizeX*2), sizeY));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE(NEAREST, BORDER, BORDER, sizeX, sizeY));
App_WrCoCmd_Buffer(phost,BEGIN(BITMAPS));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_BG));
App_WrCoCmd_Buffer(phost,VERTEX2F(posX<<4 , posY<<4)); // (posX * 16, posY * 16)
//Start drawing bitmap
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, RESTORE_CONTEXT());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
// for Test
HAL_Delay(1000);
// Samll Image ------------------------------------------------------------
p = (uint8_t *)Samll_Image;
imgFormat = ARGB4;
imgSize = 6703;
sizeX = 264;
sizeY = 80;
posX = 100;
posY = 100;
/* Load Compressed Image */
Gpu_CoCmd_Inflate(phost, 0);
Gpu_Hal_WrCmdBufFromFlash(phost, p, imgSize);
//
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost,SCISSOR_XY( posX, posY));
App_WrCoCmd_Buffer(phost,SCISSOR_SIZE(sizeX,sizeY));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, CLEAR_TAG(1));
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, COLOR_A(255));
App_WrCoCmd_Buffer(phost, COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_Small));
App_WrCoCmd_Buffer(phost,BITMAP_SOURCE(0));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT(imgFormat, (sizeX*2), sizeY));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE(NEAREST, BORDER, BORDER, sizeX, sizeY));
App_WrCoCmd_Buffer(phost,BEGIN(BITMAPS));
// App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(Handle_Small));
App_WrCoCmd_Buffer(phost,VERTEX2F(posX<<4 , posY<<4)); // (posX * 16, posY * 16)
//Start drawing bitmap
App_WrCoCmd_Buffer(phost, END());
App_WrCoCmd_Buffer(phost, RESTORE_CONTEXT());
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
}