Releases: LoganDark/stackblur-iter
Bump imgref-iter to pass Miri
This is a breaking change because of the huge MSRV hike. stackblur-iter now requires the very latest stable (1.63) for the latest version of imgref-iter. But it should now pass Miri.
Fixes #11
Fix UB in blur methods
Obtaining the column reader before writing to the rows is UB because writing to the rows invalidates the column reader's borrow.
This release fixes that. It does not update imgref-iter yet because that will be a breaking change (due to the huge MSRV hike). The version of imgref-iter used here does not pass Miri yet (the latest version does).
fix rustdoc build
:( sad I let this slip
Add SIMD and Rayon support
Using the new SIMD iterators in imgref-iter
, it's possible to implement SIMD version of stackblur. Right now SIMD doesn't offer too much of a benefit, but it is still a benefit nonetheless, and rayon definitely offers a huge benefit.
This has been sitting around in PR hell for far too long, and I don't like managing multiple disparate branches, so it's about time this gets merged and released.
Fix radius zero
I actually have fixed this before, but it was lost in a commit that I decided not to push (the precursor to imgref-iter
). I forgot that it included this fix, and therefore forgot to test radius zero again before publishing.
Quite upset about this one, honestly.
Correctness
Small optimization/cleanup release here.
-
Fixed
StackBlur
behavior with repeating iterators. It used to just continue without returning aNone
. Now it properly returns aNone
before continuing. -
Switched to new
imgref-iter
iterators. These are relatively immature (I made them in about 4 hours) but they simplify the implementation ofblur_horiz
,blur_vert
andblur
massively, as well as possibly benefitting the ecosystem of crates that useimgref
, since anyone can use the crate. -
blur
has been optimized slightly to avoid allocating more than one deque. It used to allocate two because it calledblur_horiz
andblur_vert
individually.
The perf increase is barely anything. Larger increases are planned from things like rayon
and SIMD.
Optimizations
All internal changes and optimizations. The library is now almost as fast as the original stackblur
, and additionally it no longer violates borrowing rules and no longer requires nightly.
-
The internal Argb struct (which is used by methods like
blur_argb
andblur_srgb
) has been changed to use an array instead of SIMD, due toportable_simd
being an unstable feature that also generates very inefficient code.Additionally, it now uses unsigned (but explicitly wrapping) arithmetic for another small performance boost.
-
StackBlur will now only initialize itself if it receives at least one item from the contained iterator, for a small performance boost when the end has been reached.
-
Usage of the internal deque has been optimized slightly for another small performance boost.
-
StackBlur::next is now inlineable.
-
blur_horiz
andblur_vert
now use optimized iterators internally which are much faster than their old versions, especiallyblur_vert
.
The library is now approaching the speed of the original stackblur
, and already outperforms it for large blur radii.
Initial release
v0.1.0 Exclude .idea from crate