Add MagickEvaluateOperator type

This commit is contained in:
5ohue
2024-05-11 23:59:16 +03:00
parent 7c43f8018e
commit 26a8dd3df7
3 changed files with 57 additions and 2 deletions

View File

@ -44,6 +44,7 @@ use crate::{
GravityType,
ImageType,
InterlaceType,
MagickEvaluateOperator,
MagickFunction,
MetricType,
OrientationType,
@ -1201,8 +1202,8 @@ impl MagickWand {
/// expression to an image. Use these operators to lighten or darken an image,
/// to increase or decrease contrast in an image, or to produce the "negative"
/// of an image.
pub fn evaluate_image(&mut self, op: bindings::MagickEvaluateOperator, val: f64) -> Result<()> {
let res = unsafe { bindings::MagickEvaluateImage(self.wand, op, val) };
pub fn evaluate_image(&mut self, op: MagickEvaluateOperator, val: f64) -> Result<()> {
let res = unsafe { bindings::MagickEvaluateImage(self.wand, op.into(), val) };
match res {
MagickTrue => Ok(()),
_ => Err(MagickError("failed to evaluate image")),