Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Feature Request: decompress from input `Iterator` to output `Iterator` (for low RAM usage in embedded Rust) #140

Open neil-morrison44 opened 11 months ago

neil-morrison44 commented 11 months ago

Hi,

Feel free to point me in the right direction if this is supported just now (or is implemented in another crate I've not found yet), but what I'm looking for is a function with an input similar to decompress_slice_iter_to_slice but that returns an iterator I can iterate over to get decompressed data. I'm trying to run on RAM constrained devices in no_std, eventually reading image files and writing pixels directly to the display.

Ideally, and I might be far off here from how it'd actually need to work:

Ideally the size of the internal buffer would be definable by the user (const generic?, heapless does something similar) within whatever bounds make sense.

This is potentially related to https://github.com/Frommi/miniz_oxide/issues/25 but more targeted towards resource-constrained devices (embedded Rust etc)

oyvindln commented 11 months ago

Yeah it seems reasonable to have something like this for cases where flate2 is too heavy. I've not personally done much work on this library in quite a while, might look into it at some point if no one else starts tinkering with it but might take a while.