2023-03-06 10:46 PM
Hello,
I'm using LTDC_Display_1Layer example.
In case I use "LTDC_PIXEL_FORMAT_RGB888" in which format should I store a picture in the framebuffer?
I did following, but the pictures is not displayed correctly. 24bit value of a pixel is stored in one 32bit array position. Is that wrong?
const uint32_t RGB888_1024x600[614400] =
{
0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
..
0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff
};
2023-03-06 11:04 PM
RGB888 is, and has ever been, a 24-bit pixel format, not a 32-bit one. Either pack your pixels manually to 24-bit, say in a uint8_t array, or use LTDC_PIXEL_FORMAT_ARGB8888 which is a 32-bit format with a 4th alpha (blending) byte.
hth
KnarfB
2023-03-06 11:09 PM
Thank you. Still does not work with ARGB8888, at which position should be the 8bit alpha value?
Should it have the bold position, see below:
0x00ffffff
2023-03-06 11:32 PM
How must the pixels be arranged in the array?
At the moment it's simply first pixel up to last pixel...
2023-03-06 11:45 PM
#define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)
#define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)
#define LCD_COLOR_RED ((uint32_t)0xFFFF0000)
2023-03-06 11:49 PM
Basically: yes, line by line. The lines in RAM may be longer than the actually visible part due to alignment. Depends on the setup. What board are you using?
hth
KnarfB
2023-03-06 11:56 PM
It's a custom board, see current display:
(layerCfg.WindowsX1 / Y1 set to 480 / 272 and layerCfg.Backcolor.Green = 255;)
2023-03-07 12:12 AM
Or does somebody know how can I generate from a picture (bmp, jpg, png) a LTDC_PIXEL_FORMAT_ARGB8888 compatible output/ C-File?
2023-03-07 12:52 AM
So the background works, but the pixels don't? Framebuffer in external RAM? Are you sure that the external RAM works correctly? Passed some RAM tests?
hth
KnarfB
2023-03-07 01:01 AM
I think is located at Flash memory (see screenshot below).... I use example from ST, "LTDC_Display_1Layer"
However, for testing purposes, how can I generate a RGB888 or ARGB8888 file from a picture?