Binding for set_image_background_color

This commit is contained in:
Magic Len
2018-08-12 23:05:45 +08:00
parent be0c6f5914
commit fd8f5e49a2
3 changed files with 48 additions and 1 deletions

View File

@ -381,6 +381,19 @@ impl MagickWand {
}
}
/// Set the image background color.
pub fn set_image_background_color(&self, pixel_wand: &PixelWand) -> Result<(), &'static str> {
match unsafe { bindings::MagickSetImageBackgroundColor(self.wand, pixel_wand.wand) } {
bindings::MagickBooleanType::MagickTrue => Ok(()),
_ => Err("SetImageBackgroundColor returned false")
}
}
/// Returns the image resolution as a pair (horizontal resolution, vertical resolution)
pub fn get_image_resolution(&self) -> Result<(f64, f64), &'static str> {
let mut x_resolution = 0f64;