randy408 / libspng

Simple, modern libpng alternative
https://libspng.org
BSD 2-Clause "Simplified" License
741 stars 75 forks source link

incremental decoding #223

Open pumbur opened 2 years ago

pumbur commented 2 years ago

approach alternative to #39 and #40, but on the same path to #35 and #4. somewhat inspired by libjpeg.

idea is to add SPNG_IO_SUSPENDED error and return it when not enough data available. and read_fn should return either negative io errors or num of bytes read.

no additional callbacks and functions needed, when new data available user will call previously failed spng_decode_scanline again, which will ask read_fn callback for new data.