diff --git a/.gitignore b/.gitignore index 4d47cc9..25fd82e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.swp *.pyc Cargo.lock rust-bindgen diff --git a/src/wand/magick.rs b/src/wand/magick.rs index 28bd0b0..15e0a56 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -66,6 +66,14 @@ 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(()), + _ => Err("unable to add images from another wand") + } + } + pub fn append_all(&mut self, stack: bool) -> MagickWand { unsafe { bindings::MagickResetIterator(self.wand) }; MagickWand { @@ -231,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 {