Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete implementation of lv_canvas_set_px() for indexed color format #6196

Closed
vitotai opened this issue May 8, 2024 · 5 comments · Fixed by #6226
Closed

Incomplete implementation of lv_canvas_set_px() for indexed color format #6196

vitotai opened this issue May 8, 2024 · 5 comments · Fixed by #6226

Comments

@vitotai
Copy link

vitotai commented May 8, 2024

LVGL version

v9.1

What happened?

if(LV_COLOR_FORMAT_IS_INDEXED(cf)) {

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));
@liamHowatt
Copy link
Collaborator

Hi, thanks for the tip. I'm not seeing it work even for I1.

From left to right: LV_COLOR_FORMAT_I1, LV_COLOR_FORMAT_I2, LV_COLOR_FORMAT_I4, LV_COLOR_FORMAT_I8, LV_COLOR_FORMAT_L8 (L8 works).

image

@kisvegabor
Copy link
Member

kisvegabor commented May 9, 2024

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?

@vitotai
Copy link
Author

vitotai commented May 13, 2024

@kisvegabor

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.

@kisvegabor
Copy link
Member

@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! 🙂

kisvegabor added a commit to kisvegabor/lvgl_upstream that referenced this issue May 14, 2024
kisvegabor added a commit to kisvegabor/lvgl_upstream that referenced this issue May 14, 2024
@kisvegabor
Copy link
Member

I couldn't resist and opened #6226 to fix it. Could you test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants