Crates.io | blurslice |
lib.rs | blurslice |
version | 0.1.0 |
source | src |
created_at | 2022-06-26 09:29:24.595764 |
updated_at | 2022-06-26 09:29:24.595764 |
description | An implementation of "Fastest Gaussian Blur" for N-channel image slices |
homepage | |
repository | https://github.com/lsr0/blurslice |
max_upload_size | |
id | 613465 |
size | 127,333 |
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.
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)
}