From 5fbc506983d57576533f273657e3317cbe5a30fb Mon Sep 17 00:00:00 2001 From: Seoxi Ryouko Date: Thu, 15 May 2025 04:15:50 -0500 Subject: [PATCH] Updated readme - DO NOT USE --- README.md | 6 ++++++ src/wand/magick.rs | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 6fe6b21..eb18e24 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + +# DO NOT USE + +I just hacked in a tiny code block in order to use ImageMagick's opaque paint image function. +this isn't a fork so much as a mediocre workaround for my own usecase. + # magick-rust A somewhat safe Rust interface to the [ImageMagick](http://www.imagemagick.org/) system, in particular, the MagickWand library. Many of the functions in the MagickWand API are still missing, but over time more will be added. Pull requests are welcome, as are bug reports, and requests for examples. diff --git a/src/wand/magick.rs b/src/wand/magick.rs index 844be7b..16ce3ee 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -1580,6 +1580,15 @@ impl MagickWand { }; } + pub fn opaque_paint_image(&self, src: &PixelWand, target: &PixelWand, fuzz: f64, invert: bool) -> Result<()> { + let result = unsafe { bindings::MagickOpaquePaintImage(self.wand, src.wand, target.wand, fuzz, invert.into()) }; + match result { + MagickTrue => Ok(()), + _ => Err(MagickError(self.get_exception()?.0)), + } + } + + mutations!( /// Sets the image to the specified alpha level. MagickSetImageAlpha => set_image_alpha(alpha: f64)