FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - sergpenshin

Pages: [1]
1
Discussion - Software / SCALE() command for FT81x
« on: February 15, 2021, 11:56:17 AM »
Hi everyone.
I am  using FT811 chip and ran into a problem how to use CMD_SCALE correctly to get images  larger than 511x511 pixels.
The display witch i'm using has 800х600 pixels and working with Bitmaps I add BITMAP_LAYOUT_H and BITMAP_SIZE_H.
Everything works correctly and I can upload images with a resolution greater than 512x512.
But if I use the SCALE() command to resize an image to get over than 511x511, for example the image 160x120 with scale factor of 4, the picture is cropped as if I havn't used BITMAP_LAYOUT_H and BITMAP_SIZE_H at all.

Here is the code, please tell me what I do wrong?
Code: [Select]
int16_t imgWidth = 160;
int16_t imgHeight = 120;

App_WrCoCmd_Buffer(phost,COLOR_RGB(255,255,255));
App_WrCoCmd_Buffer(phost,BITMAP_SOURCE(0));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT(RGB565,imgWidth*2,imgHeight));
App_WrCoCmd_Buffer(phost,BITMAP_LAYOUT_H((imgWidth*2)>>10,imgHeight>>9));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE(NEAREST,BORDER,BORDER,imgWidth,imgHeight));
App_WrCoCmd_Buffer(phost,BITMAP_SIZE_H(imgWidth>>9,imgHeight>>9));

App_WrCoCmd_Buffer(phost,BEGIN(BITMAPS)); // start drawing bitmaps

Gpu_CoCmd_LoadIdentity(phost);
Gpu_CoCmd_Scale(phost,4*65536, 4*65536);
Gpu_CoCmd_SetMatrix(phost);

App_WrCoCmd_Buffer(phost,VERTEX2F(0,0));
App_WrCoCmd_Buffer(phost, END());



Pages: [1]