cancel
Showing results for 
Search instead for 
Did you mean: 

Bitmap L8_RGB8888 format

OSter.1
Associate II

I need to know data format used by L8_RGB8888 image. I have found this article:

https://support.touchgfx.com/docs/development/ui-development/scenarios/using-the-l8-image-format-to-reduce-memory-consumption/

but this is absolutely useless for me, it does not tell anything how should I modify the data contained in cpp array.

I have a PNG file or BMP file, does exist some command line utility that make conversion to cpp array for me?

4 REPLIES 4
OSter.1
Associate II

I actually want to modify images from RGR8888 to L8_RGB8888, I have some existing image data in cpp array, I want to modify it in easiest possible way

OSter.1
Associate II

i would be happy to know - first byte means this, second byte means this, etc.

LTimm.1
Associate III

Maybe this can help a bit: https://support.touchgfx.com/docs/development/ui-development/scenarios/creating-dynamic-l8-images/

At least it could be a starting point for some experiments...

scottSD
Senior III

I assume you are asking what the bytes are in the cpp array created by the L8_RGB8888 conversion in the TouchGFX Designer?

Each of the bytes in the first array of the generated source cpp file are the pixels to be rendered. The values in those pixels are indexes of the 2nd array of bytes in that file (the "extra data"). As indicated in this small L8 image example. The comment says they are "L8 indexes".

KEEP extern const unsigned char _imageArray[] LOCATION_ATTRIBUTE("ExtFlashSection") = // 38x26 L8 indexes.
{

The indexes are at the end of the file in an array of the "extra data" section. Here is the CLUT (color look up table) for the example above:

KEEP extern const unsigned char _imageArray_extra_data[] LOCATION_ATTRIBUTE("ExtFlashSection") = // 86 ARGB8888 CLUT entries.
{
    0x00, 0x00, 0x56, 0x00,   // CLUT type (16-bit) and size (16-bit) data
    0xf8, 0xfc, 0xf8, 0x00, 0xc8, 0xcc, 0xc8, 0x41, 0xd0, 0xcc, 0xd0, 0x59, 0xc8, 0xcc, 0xc8, 0x59, 0xc8, 0xcc, 0xc8, 0x45, 0xd0, 0xcc, 0xd0, 0xe7, 0xc8, 0xcc, 0xc8, 0xff, 0xd0, 0xcc, 0xd0, 0xff, 0xc8, 0xcc, 0xc8, 0xae, 0xd0, 0xcc, 0xd0, 0xf3, 0xc8, 0xcc, 0xc8, 0xe3, 0xc8, 0xcc, 0xc8, 0xf7, 0xd0, 0xcc, 0xd0, 0xf7, 0xc8, 0xcc, 0xc8, 0xe7, 0xc8, 0xcc, 0xc8, 0xf3, 0xd0, 0xcc, 0xd0, 0xb2,

Note that there can be a maximum number of 255 CLUT indexes for any L8 image.

Does this help?