Description
How is the alpha array included in the RGB565A8 color format accessed using the px_map pointer? It seems like the buffers provided to display set buffers would be structured like two arrays in contiguous memory: arrayRGB[HOR * VER * 2Bytes] + arrayAlpha[HOR * VER * 1Byte]. However when I look at the data in the last 3rd of the memory allotted to my buffers the value is always 0. I have color depth set to 16 and I have enabled all color formats for draw sw support, just in case.
What MCU/Processor/Board and compiler are you using?
RISCV
What LVGL version are you using?
9.2
What do you want to achieve?
Access RGB565A8 alpha mask/buffer/array for overlaying graphics on a input video stream.
What have you tried so far?
Using the same codebase to run in ARGB8888 using the windows simulator seeing expected values in the alpha byte.
Running on hardware using ARGB888 color format, display will not run in this format, but the alpha bytes appear as expected.
Running on hardware using RGB565 color format, graphics appear as expected, but have no transparency.
I tried memsetting the last 3rd of the display buffers to 0x7F to check if 0 was the calculated alpha value, however the 0x7F values were not overwritten and remained indefinitely even as the first 2/3s of the buffer was updated with new RGB565 values.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
lv_display_t * disp = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
lv_display_set_color_format(disp, LV_COLOR_FORMAT_RGB565A8);
lv_display_set_flush_cb(disp, disp_flush);
static uint8_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES * BYTE_PER_PIXEL];
static uint8_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES * BYTE_PER_PIXEL];
lv_display_set_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISPLAY_RENDER_MODE_DIRECT);
static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, uint8_t * px_map)
{
setRGBData(px_map);
setAlphaData(px_map + MY_DISP_HOR_RES * MY_DISP_VER_RES * BYTE_PER_PIXEL-1);
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_display_flush_ready(disp_drv);
}