"lv_img_dsc_t" const structure initialization?



The initialization of this type of structure should not be declared const ?

Or does this structure need to be in ram memory for speed reasons ?

Although only using 4 uint32_t.

lv_img_dsc_t img_bubble_test = 
    .header.always_zero = 0,
    .header.w = 234,
    .header.h = 480,
    .data_size = 112320 * LV_COLOR_SIZE / 8,
    .header.cf = LV_IMG_CF_TRUE_COLOR,
    .data = img_bubble_test_map,

What MCU/Processor/Board and compiler are you using?



It depends on your needs.
For example, you might want to decode a PNG picture data and put the result into a ‘lv_img_dsc_t’ variable. Then you shouldn’t define it as a const. Or in another scenario, your data are decoded and are in the flash. So then you might want to define it as const.

I’m actually not sure why this isn’t declared const like the raw image data. This is probably an oversight.

Thank you all.

Probably it’s really just an oversight.
I’ve updated it in the image converter.