Add set_image_mask function

This commit is contained in:
5ohue
2024-05-12 22:06:10 +03:00
parent e31675e477
commit 1752b0073c
3 changed files with 46 additions and 0 deletions

View File

@ -51,6 +51,7 @@ use crate::{
MorphologyMethod,
OrientationType,
PixelInterpolateMethod,
PixelMask,
RenderingIntent,
ResolutionType,
ResourceType,
@ -1239,6 +1240,27 @@ impl MagickWand {
}
}
/// Sets image clip mask.
///
/// * `pixel_mask`: type of mask, Read or Write.
/// * `clip_mask`: the clip_mask wand.
pub fn set_image_mask(
&mut self,
pixel_mask: PixelMask,
clip_mask: &MagickWand
) -> Result<()> {
match unsafe {
bindings::MagickSetImageMask(
self.wand,
pixel_mask.into(),
clip_mask.wand
)
} {
MagickTrue => Ok(()),
_ => Err(MagickError("failed to set image mask")),
}
}
/// Set image channel mask
pub fn set_image_channel_mask(
&mut self,