-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Allocate a static buffer for 1bpp/2bpp/4bpp greyscale sprites and draw bitmaps on it #541
Comments
I understand exactly what you mean, and I was originally going to implement it as well. |
I actually have quite a few problems with the current LovyanGFX V1 implementation, and am considering creating a new V2 design from HAL. So we don't want to spend time supporting V1. |
Just add a function prototype like this. I think it takes just a few bytes. However, most of projects do not use this prototype. |
By the way, if you copy an RGB565 image to a palette image, what kind of result do you expect to get? |
It is not easy to copy a normal image like RGB565, RGB888 etc to a palette image. But it is easier to copy to a 1bpp/2bpp/4bpp greyscale image. I will create my own transform function if I must copy from an normal image to a palette image. So, I just hope to add a prototype for creating a static sprite. You do not need to do anything else for V1. void setBuffer(void* buffer, int32_t w, int32_t h, color_depth_t bpp = rgb565_2Byte); Source code reference previous text. |
Use this |
I'm developing a library for E-paper displays. It supports 16-level grey display for most common E-paper displays.
I hope you can pay more attention to greyscale bitmaps and sprites.
Firstly. Setting buffer for static greyscale bitmaps.
I tried using
setBuffer
function for my static 8-bpp greyscale bitmap array. Bit it was always converted toRGB332
colour format.Now I have to edit your library to show a static greyscale bitmap.
Now there is an available function prototype for
setBuffer
at file LGFX_Sprite.hpp line 155.Could you add a function like this?
Next. My ESP32 Halted when copying from an RGB sprite to a 4bpp greyscale sprite.
When copying from an RGB565 or RGB888 sprite to a grey bitmap (1bpp, 2bpp and 4bpp) the library halted at file LGFX_Sprite.cpp line 481: in
void Panel_Sprite::writeImage(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, pixelcopy_t* param, bool)
fp_copy is nullptr.my destination sprite is greyscale 4bit color type. Source sprite is RGB565 color type.
I have tried these:
At file pixelcopy.hpp line 115.
I think this nullptr is the reason.
Please add pixel copying support for 1bpp,2bpp and 4bpp bitmaps and sprites.
Thanks.
The text was updated successfully, but these errors were encountered: