How to access CLUT of L8 compressed bitmaps
Hello,
It's quite easy to manipulate the CLUT for an L8 uncompressed Bitmap but how could we find the CLUT entries when the Bitmap is compressed with either RLE or LZW methods?
When looking at the .cpp generated for such an image around the extra_data definition, the extra data starts with a 4 bytes header giving the format (here 0x00,0x03 for an LZW compressed image) then the CLUT size (0x100 or 256 entries) ... BUT ... the following bytes are not the CLUT but, I guess, some dictionary entries for the LZW encoder... the actual CLUT is at the end of the extra_data section ... but there is no obvious mean to know where the CLUt starts ...
LOCATION_PRAGMA("ExtFlashSection")
KEEP extern const unsigned char image_worldmap_extra_data[] LOCATION_ATTRIBUTE("ExtFlashSection") = { // 256 ARGB8888 CLUT entries.
0x00, 0x03, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x32,
.....
0x00, 0x00, 0x3a, 0xa2,
0x00, 0x00, 0x3a, 0xd4,
0xf8, 0xfc, 0xf8, 0x00, 0xf8, 0xfc, 0xf8, 0x04, 0xf8, 0xfc, 0xf8, 0x05, // Here is the actual CLUT
0xf8, 0xfc, 0xf8, 0x03, 0xf8, 0xfc, 0xf8, 0x11, 0xf8, 0xfc, 0xf8, 0x4f,
0xf8, 0xfc, 0xf8, 0x59, 0xf8, 0xfc, 0xf8, 0x5a, 0xf8, 0xfc, 0xf8, 0x5b,
Is there a way to know the location of the CLUT ?
Thanks,
Pierre
