Xinyuan-LilyGO / LilyGo-EPD47

GNU General Public License v3.0
379 stars 119 forks source link

Add ability to draw partial framebuffer #80

Open sticilface opened 1 year ago

sticilface commented 1 year ago

I would like to update smaller parts of the screen rathe than the whole screen every change. I first tried to use a smaller subset of framebuffers for each region but none of the write tools work for text or lines, as they are fixed to the framebuffer size used for the display.

void IRAM_ATTR epd_draw_grayscale_image(Rect_t area, uint8_t *data);

This function can be used to write a smaller frame buffer to the output correctly, but only if area is equal the size of EPD_WIDTH and EPD_HEIGHT. so this works for pictures but i can't do this for text without using the full size framebuffer.

I would like to draw a region of the main framebuffer, or be able to use the tools on arbitrary sized frame buffers and to not assume the the framebuffer is the full size of the display.

one thought was to create a framebuffer class, that contains the width and height data, so that the output writer knows how to use it. if width is < actual width skip to the next line.

thoughts?