Merge pull request #105 from FaithBeam/master

Add compose_images_gravity
This commit is contained in:
Nathan Fiedler
2023-06-09 19:03:24 -07:00
committed by GitHub

View File

@ -262,6 +262,27 @@ impl MagickWand {
} }
} }
/// Compose another image onto self with gravity using composition_operator
pub fn compose_images_gravity(
&self,
reference: &MagickWand,
composition_operator: bindings::CompositeOperator,
gravity_type: bindings::GravityType,
) -> Result<()> {
let result = unsafe {
bindings::MagickCompositeImageGravity(
self.wand,
reference.wand,
composition_operator,
gravity_type,
)
};
match result {
bindings::MagickBooleanType_MagickTrue => Ok(()),
_ => Err(MagickError("failed to compose images")),
}
}
/// Rebuilds image sequence with each frame size the same as first frame, and composites each frame atop of previous. /// Rebuilds image sequence with each frame size the same as first frame, and composites each frame atop of previous.
/// Only affects GIF, and other formats with multiple pages/layers. /// Only affects GIF, and other formats with multiple pages/layers.
pub fn coalesce(&mut self) -> Result<()> { pub fn coalesce(&mut self) -> Result<()> {