feat: MagickBlurImage

A faster alternative to gaussian blur
This commit is contained in:
Daniel Rönnkvist
2020-04-22 16:13:04 +02:00
parent fefc89387d
commit cd590d0335

View File

@ -335,11 +335,19 @@ impl MagickWand {
} }
} }
pub fn blur_image(&self, radius: f64, sigma: f64) -> Result<(), &'static str> {
let result = unsafe { bindings::MagickBlurImage(self.wand, radius, sigma) };
match result {
bindings::MagickBooleanType_MagickTrue => Ok(()),
_ => Err("failed to blur image"),
}
}
pub fn gaussian_blur_image(&self, radius: f64, sigma: f64) -> Result<(), &'static str> { pub fn gaussian_blur_image(&self, radius: f64, sigma: f64) -> Result<(), &'static str> {
let result = unsafe { bindings::MagickGaussianBlurImage(self.wand, radius, sigma) }; let result = unsafe { bindings::MagickGaussianBlurImage(self.wand, radius, sigma) };
match result { match result {
bindings::MagickBooleanType_MagickTrue => Ok(()), bindings::MagickBooleanType_MagickTrue => Ok(()),
_ => Err("failed to blur image"), _ => Err("failed to gaussian blur image"),
} }
} }