Closed owenthewizard closed 2 years ago
There is an implementation of 1. in pure rust AFAIK: https://github.com/fschutt/fastblur
Hope this helps.
Follow up to my previous comment, there seems to be an improved version of the blur algorithm in resvg
. This might help too.
I got fastblur to work but it's pretty slow. Probably because it's unoptimized and does a lot of allocations. I'm thinking stackblur would be better, it can be done in-place with just a small (kernel * pixel size) additional buffer allocated.
I've tried to implement stackblur in Rust several times but I haven't been successful yet 😞 .
I finally got stackblur implemented. Soon I'll get it up to snuff with the current C version, stabilized, and then used with i3lockr.
Better implementation: https://github.com/LoganDark/stackblur-iter
Ideally the blur routine would be in Rust and multithreaded. Currently it is written in C. Possible algorithms are "fastest guardian blur (O(n))"[1], and "stackblur"[2]
1: http://blog.ivank.net/fastest-gaussian-blur.html 2: https://github.com/Quasimondo/QuasimondoJS/blob/master/blur/stackblur.pdf