cancel
Showing results for 
Search instead for 
Did you mean: 

LTDC_PIXEL_FORMAT_RGB888, framebuffer format?

pk84
Senior

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
 
};

11 REPLIES 11
KnarfB
Principal III

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

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

pk84
Senior

How must the pixels be arranged in the array?

At the moment it's simply first pixel up to last pixel...

KnarfB
Principal III
#define LCD_COLOR_BLUE          ((uint32_t)0xFF0000FF)
#define LCD_COLOR_GREEN         ((uint32_t)0xFF00FF00)
#define LCD_COLOR_RED           ((uint32_t)0xFFFF0000)

KnarfB
Principal III

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

It's a custom board, see current display:

(layerCfg.WindowsX1 / Y1 set to 480 / 272 and layerCfg.Backcolor.Green = 255;)

0693W00000aILmpQAG.jpg

pk84
Senior

Or does somebody know how can I generate from a picture (bmp, jpg, png) a LTDC_PIXEL_FORMAT_ARGB8888 compatible output/ C-File?

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

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?

0693W00000aIM9PQAW.png