From fe9b6f805d2d0e3a29b9390b7654356b2cd2ad51 Mon Sep 17 00:00:00 2001 From: 42 Date: Tue, 7 Jan 2020 20:53:10 +0200 Subject: [PATCH] Add gaussian blur function --- src/wand/magick.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wand/magick.rs b/src/wand/magick.rs index 55631a6..8c557bb 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -286,6 +286,14 @@ impl MagickWand { } } + pub fn gaussian_blur_image(&self, radius: f64, sigma: f64) -> Result<(), &'static str> { + let result = unsafe { bindings::MagickGaussianBlurImage(self.wand, radius, sigma) }; + match result { + bindings::MagickBooleanType_MagickTrue => Ok(()), + _ => Err("failed to blur image"), + } + } + /// Adaptively resize the currently selected image. pub fn adaptive_resize_image(&self, width: usize, height: usize) -> Result<(), &'static str> { match unsafe { bindings::MagickAdaptiveResizeImage(self.wand, width, height) } {