Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fbc506983 | |||
| da465daa20 |
@ -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
|
# 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.
|
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.
|
||||||
|
|||||||
2
build.rs
2
build.rs
@ -58,7 +58,7 @@ fn main() {
|
|||||||
.arg("--cppflags")
|
.arg("--cppflags")
|
||||||
.output()
|
.output()
|
||||||
} else {
|
} else {
|
||||||
Command::new("MagickCore-config").arg("--cppflags").output()
|
Command::new("pkg-config").args(["--cflags", "--libs", "MagickCore"]).output()
|
||||||
};
|
};
|
||||||
if let Ok(ok_cppflags) = check_cppflags {
|
if let Ok(ok_cppflags) = check_cppflags {
|
||||||
let cppflags = ok_cppflags.stdout;
|
let cppflags = ok_cppflags.stdout;
|
||||||
|
|||||||
@ -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!(
|
mutations!(
|
||||||
/// Sets the image to the specified alpha level.
|
/// Sets the image to the specified alpha level.
|
||||||
MagickSetImageAlpha => set_image_alpha(alpha: f64)
|
MagickSetImageAlpha => set_image_alpha(alpha: f64)
|
||||||
|
|||||||
Reference in New Issue
Block a user