blurslice 0.1.0

An implementation of "Fastest Gaussian Blur" for N-channel image slices
Documentation
  • Coverage
  • 62.5%
    5 out of 8 items documented4 out of 4 items with examples
  • Size
  • Source code size: 164.28 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.7 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lsr0/blurslice
    3 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lsr0

A fast linear-time gaussian blur based on http://blog.ivank.net/fastest-gaussian-blur.html.

This implementation was based on https://github.com/fschutt/fastblur.

These functions in-place blur a given slice of (presumably) image data, with any number of channels and the given blur radius. Performance is roughly linear time, and uses a single allocation for a backing store, of the same size as the input slice.

Example

Blur an RgbImage

fn blur_fast(rgb_image: &mut image::RgbImage, radius: f32) -> Result<(), blurslice::SliceSizeError> {
    let width = rgb_image.width() as usize;
    let height = rgb_image.width() as usize;
    let samples = rgb_image.as_flat_samples_mut();
    blurslice::gaussian_blur_bytes::<3>(samples.samples, width, height, radius)
}

Changes:

  • Support any number of channels via const generics
  • No allocation for passes list generation, uses const generic stack array

TODO:

  • Support arbitrary stride, for over-aligned data or vertical image sub-slices
  • Allow providing a backing store, to allow for zero-allocation execution