robweber / omni-epd

An EPD (electronic paper display) class abstraction to simplify communications across multiple display types.
GNU General Public License v3.0
75 stars 16 forks source link

Add Partial Update Support #68

Open aaronr8684 opened 2 years ago

aaronr8684 commented 2 years ago

If I have time, I can work on a solution, but in the meantime, I'm just going to add this here as a future feature request. Not sure if MissionFloyd wants to take a crack at it. I imagine that it could be another mode since only the bw/grey screens seem to support it.

Screens with official partial update support:

robweber commented 2 years ago

Just to add to this a bit I can see a few hurdles to the partial implementation. T

Project Developer Experience

We'll need a unified way of flagging what screens support it and which don't. This will more than likely require some sort of partial_supported boolean being added to the VirtualEPD class. This would allow developers to code around support easily.

When trying to use the partial update functionality a developer could call epd.display(image, partial=True). If the screen supports partial updates that method would be used vs the full update. A point of debate here would be what does omni-epd do as a fallback?

  1. Do a full update if partial is not supported? This may cause issues with parts of the expected image just not working
  2. Throw an error, something along the lines of Partial Update not supported

Neither of these are ideal. The alternative would be that the developer will need to check if the display supports partial updating and code their stuff accordingly. An alternative might be making the developer code for if(epd.partial_supported) and call either display() or display_partial() as appropriate. The latter could still throw an error if called the screen didn't support it?

Driver Implementation

Often the displays that support partial refresh use separate init() and display() functions for the partial update, or you need to pass in some kind of variable to alert the driver to the fact that you're doing a partial update. A child class _display_partial() could be implemented for devices that allow for partial display. Similarly the prepare() method will need both a full and partial update check as well.

Nico04 commented 5 months ago

I'm new here, looking for a good library to control FAST refreshing EPD like the Waveshare 6inch IT8951 display. Partial refreshing is also key for fast refresh. This project looks very promising, do you know if this feature is implemented yet? Thanks 😊

robweber commented 5 months ago

It is not implemented. Personally I don't have a screen that supports it for testing. To even get one working it would take someone with a partial display EPD to flesh out the details, implement, and test. Once one is working the code could likely be applied to the others that support it.