imgref
imgref copied to clipboard
A trivial Rust struct for interchange of pixel buffers with width, height & stride
I recently implemented a Rust wrapper for my [zxing-cpp](https://github.com/zxing-cpp/zxing-cpp/tree/master/wrappers/rust) barcode scanning library. On the c++ side I have the [ImageView](https://github.com/zxing-cpp/zxing-cpp/blob/fb8d447c52aa583d6a499012792a9be93330749e/core/src/ImageView.h#L41) class that I needed to wrap/replace in Rust. I thought...
Reproducer: ```rust fn foo(img: ImgRef) -> ImgVec { | ------------ expected `imgref::Img` because of return type 96 | img.to_owned() | ^^^^^^^^^^^^^^ expected `Img`, found `Img` | = note: expected struct...
I sometimes need to iterate over all pixels of an image and do some operation depending on their coordinates. I typically want to do this mutably, which I can do...
I'm using the `image` crate to load images, and I was wondering: is there a method to easily and quickly convert a loaded `RgbaImage` into an `Img`? Right now I'm...
Using SIMD instructions on windows requires allocations be aligned to 16 bytes. Vec does not align to 16 bytes when allocating. Vec on stable does not permit fallible allocations either,...
Currently the struct is tied to a particular layout/implementation and doesn't support: * upside-down bitmaps (negative stride) * byte-based stride that isn't multiple of full pixels (e.g. 2-byte gaps in...
I'm trying to use [inline-python](https://github.com/fusion-engineering/inline-python) to get a pic from OpenCV camera, then manipulate this image with Rust, so I wrote the below code that catch the photo correctly, but...
This is doable with the current API using row iterators, but it's slightly annoying. I'd like a single function that does this. My use case is building font atlases from...
Interoperability with other libraries may require getting the underlying buffer as a slice or vec, but entirely continuous (where `width == stride`).
`row(n)` access that gives row slices. Perhaps `rows()[n]`, too?