kikuchan / pngle

Pngle - PNG Loader for Embedding
MIT License
109 stars 20 forks source link

Need a way to disable Adam7 interleaving #11

Open codewitch-honey-crisis opened 2 months ago

codewitch-honey-crisis commented 2 months ago

Hi,

Presently I have to fork your code in order to remove the Adam 7 interleaving as it makes performance much slower than it otherwise needs to be depending on the situation.

The problem with the interleaving is twofold, from a performance perspective:

  1. You cannot cluster points onto a small bitmap region and then send that to the display using DMA, slowing down draws.
  2. You cannot early out if the bottom of the image lies outside the display area.

I'll consider submitting a PR with a #define to disable this feature but I don't even know how you would feel about it, and I don't want to waste time with it if you're not interested in incorporating the change.

kikuchan commented 2 months ago

Thank you for choosing Pngle!

Unfortunately, it's by design. Optimization methods and performance requirements can vary based on specific use cases, so customizing Pngle to fit your needs is often recommended.

Here’s an example of one of the most heavily customized versions I know: https://github.com/lovyan03/LovyanGFX/blob/master/src/lgfx/utility/lgfx_pngle.c

Let me know if your version is published, and I'll be happy to add it to the README.

Thanks.