Open fschutt opened 6 years ago
This would definitely be a good idea! I don't have any time at the moment to do this, but I'd gladly take pull requests. I'm not sure how to get this to play nicely with the image crate's ImageBuffer type that we use throughout - we'd probably have to manually convert back and forth between that type and its raw underlying buffer. Or just create our own image types or traits.
now?
I would recommend relying on auto-vectorization
Since now the compiler has SIMD instructions on stable Rust, wouldn't it be a good idea to SIMD-optimize the operations internally? I.e.:
This would use runtime feature detection, however, since an image is usually a lot of data, doing a one-time runtime check wouldn't add much overhead and with SIMD we could process 4, 8 or 16 bytes at a time, which would be much faster.