Add DitherMethod type

This commit is contained in:
5ohue
2024-05-09 21:42:51 +03:00
parent e419039647
commit cfbdbd4c0e
5 changed files with 31 additions and 6 deletions

View File

@ -32,6 +32,7 @@ use super::{DrawingWand, PixelWand};
use crate::{
ColorspaceType,
CompositeOperator,
DitherMethod,
MetricType,
ResourceType
};
@ -1106,14 +1107,14 @@ impl MagickWand {
number_of_colors: size_t,
colorspace: ColorspaceType,
tree_depth: size_t,
dither_method: bindings::DitherMethod,
dither_method: DitherMethod,
measure_error: bool) -> Result<()> {
match unsafe { bindings::MagickQuantizeImage(
self.wand,
number_of_colors,
colorspace.into(),
tree_depth,
dither_method,
dither_method.into(),
measure_error.to_magick()) } {
bindings::MagickBooleanType_MagickTrue => Ok(()),
_ => Err(MagickError("failed to quantize image")),
@ -1126,14 +1127,14 @@ impl MagickWand {
number_of_colors: size_t,
colorspace: ColorspaceType,
tree_depth: size_t,
dither_method: bindings::DitherMethod,
dither_method: DitherMethod,
measure_error: bool) -> Result<()> {
match unsafe { bindings::MagickQuantizeImages(
self.wand,
number_of_colors,
colorspace.into(),
tree_depth,
dither_method,
dither_method.into(),
measure_error.to_magick()) } {
bindings::MagickBooleanType_MagickTrue => Ok(()),
_ => Err(MagickError("failed to quantize images")),