fastblur
fastblur copied to clipboard
Fast (linear time) implementation of the Gaussian Blur algorithm in Rust
This probably has very little effect on the output, but I noticed that the + 1.0 was after the sqrt, [whereas the blog post](http://blog.ivank.net/fastest-gaussian-blur.html) has it inside the sqrt Original:...
`resvg` crate now includes [a modified copy](https://github.com/RazrFalcon/resvg/commit/695c0680fd32388015f16ef5c1e92669c41ab543#diff-ce811c080df082862d76f31b16c2e560R557) of the blur algorithm in this crate. Most notably it includes alpha channel support as well RGB/BRG/etc, but also fixes #13.
Isn't this line should contain `blur_radius - width`? https://github.com/fschutt/fastblur/blob/d1b3bff65d2c54f0116d11370e336df4f5f7ae0f/src/blur.rs#L226
Currently, we blur horizontally first, but it produces strange artifacts:  (left - hor -> ver, right - ver -> hor) Maybe we should blur vertically first?
`create_box_gauss()` currently returns a `Vec` with length specified by the input parameter `n`. Vectors are always allocated on the heap, which is costly. Even the tiny vectors of 3 elements...
Blur radius of 500000000000000000.0 causes a panic in debug mode on overflow. Release mode doesn't check for overflows and doesn't panic.
It should be possible to make the code faster by using iterators instead of indexing, which lets the compiler eliminate bounds checks on every lookup. Using iterators also makes the...