image-rs / image

Encoding and decoding images in Rust
Apache License 2.0
4.86k stars 597 forks source link

Support for bottom-up and right-to-left images #2276

Open LucaCiucci opened 2 months ago

LucaCiucci commented 2 months ago

I could not find a way to represent images with rows ordered bottom-up. In Microsoft Media Foundations, they use negative stride but the SampleLayout struct does not handle this case. It would be great to be able to use negative strides or maybe some kind of "inverted" flag, but I suppose this would be a breaking change.

Currently, the only way I know to handle this case is to convert the buffer by swapping the rows.