Skip to content

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

@neil-morrison44

Description

@neil-morrison44

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:

  • the decompress_* function gets called & is given an Iterator that returns u8s
  • it returns a struct implementing core::iter::Iterator over u8s
  • calling next() on the returned iter will fill a (small) internal buffer by calling the input Iterator, decompressing, then transparently returning values from the output buffer until it's consumed, refilling it as needed

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 #25 but more targeted towards resource-constrained devices (embedded Rust etc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions