diff --git a/src/wand/magick.rs b/src/wand/magick.rs index ee23858..15e0a56 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -66,6 +66,7 @@ impl MagickWand { } } + /// Add all images from another wand to this wand at the current index. pub fn add_image(&mut self, other_wand: &MagickWand) -> Result<(), &'static str> { match unsafe { bindings::MagickAddImage(self.wand, other_wand.wand) } { bindings::MagickBooleanType::MagickTrue => Ok(()), @@ -238,6 +239,15 @@ impl MagickWand { } } + /// Rotate the currently selected image by the given number of degrees, + /// filling any empty space with the background color of a given PixelWand + pub fn rotate_image(&self, background: &PixelWand, degrees: f64) -> Result<(), &'static str> { + match unsafe { bindings::MagickRotateImage(self.wand, background.wand, degrees) } { + bindings::MagickBooleanType::MagickTrue => Ok(()), + _ => Err("failed to rotate image") + } + } + /// Trim the image removing the backround color from the edges. pub fn trim_image(&self, fuzz: f64) -> Result<(), &'static str> { let result = unsafe {