Incomplete implementation of lv_canvas_set_px() for indexed color format
Closed this issue · 5 comments
LVGL version
v9.1
What happened?
lvgl/src/widgets/canvas/lv_canvas.c
Line 113 in 46887db
It only works for 1bit indexed format, not for others.
How to reproduce?
uint32_t px = ((dsc->header.w + 7) >> 3) * y + x;
buf_u8[px] = buf_u8[px] & ~(1 << (7 - bit));
buf_u8[px] = buf_u8[px] | ((c.full & 0x1) << (7 - bit));
It's implemented but really seems related to 1 bit only.
I think it's not too difficult to fix it. The only trick is that the palette at the beginning needs to be skipped (buf += 8;
)
@vitotai would you be interested in sending a pull request?
I am not good at operating those GitHub.com operations. It's a simple fix for the developers of LVGL given the fact that there is similar code in V8.
I just wanted to remind the developers and people who might be stuck on this issue.
@vitotai Always the first step is the hardest. Getting started with Pull requests, contributing to a project might be scary a little for the first time. However, I think learning these is pretty useful. Anyway, no push, we can fix it too, however if you change your mind, just let us know. We are here to help! 🙂
I couldn't resist and opened #6226 to fix it. Could you test it?