Binding for MagickSetSize
This commit is contained in:
@ -230,6 +230,14 @@ impl MagickWand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_size(&self, columns: size_t, rows: size_t) -> Result<(), &'static str> {
|
||||||
|
let result = unsafe { bindings::MagickSetSize(self.wand, columns, rows) };
|
||||||
|
match result {
|
||||||
|
bindings::MagickBooleanType_MagickTrue => Ok(()),
|
||||||
|
_ => Err("failed to set size of wand"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Extend the image as defined by the geometry, gravity, and wand background color. Set the
|
/// Extend the image as defined by the geometry, gravity, and wand background color. Set the
|
||||||
/// (x,y) offset of the geometry to move the original wand relative to the extended wand.
|
/// (x,y) offset of the geometry to move the original wand relative to the extended wand.
|
||||||
pub fn extend_image(
|
pub fn extend_image(
|
||||||
|
|||||||
@ -319,3 +319,9 @@ fn test_set_background_color() {
|
|||||||
assert_eq!(0u8, blob[2]);
|
assert_eq!(0u8, blob[2]);
|
||||||
assert_eq!(0u8, blob[3]);
|
assert_eq!(0u8, blob[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_set_size() {
|
||||||
|
let wand = MagickWand::new();
|
||||||
|
assert!(wand.set_size(100, 100).is_ok());
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user