From f30dfb43fe9542ce0dde4d29d4b0aa4a84fe6feb Mon Sep 17 00:00:00 2001 From: Maks Rawski Date: Sun, 13 Nov 2022 18:38:59 +0100 Subject: [PATCH 1/3] add draw_rectangle method --- src/wand/drawing.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wand/drawing.rs b/src/wand/drawing.rs index 85b08a7..6740123 100644 --- a/src/wand/drawing.rs +++ b/src/wand/drawing.rs @@ -51,6 +51,24 @@ impl DrawingWand { } } + pub fn draw_rectangle( + &mut self, + upper_left_x: f64, + upper_left_y: f64, + lower_right_x: f64, + lower_right_y: f64, + ) { + unsafe { + bindings::DrawRectangle( + self.wand, + upper_left_x, + upper_left_y, + lower_right_x, + lower_right_y, + ); + } + } + string_set_get!( get_font, set_font, DrawGetFont, DrawSetFont get_font_family, set_font_family, DrawGetFontFamily, DrawSetFontFamily From b3fc4473b91a90e75b57e029d471d90fd4f364f4 Mon Sep 17 00:00:00 2001 From: Maks Rawski Date: Sun, 13 Nov 2022 18:40:00 +0100 Subject: [PATCH 2/3] add MagickBrightnessContrastImage --- src/wand/magick.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wand/magick.rs b/src/wand/magick.rs index d115937..b564eab 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -992,6 +992,9 @@ impl MagickWand { // Control the brightness, saturation, and hue of an image MagickModulateImage => modulate_image(brightness: f64, saturation: f64, hue: f64) + /// Control the brightness and contrast + MagickBrightnessContrastImage => brightness_contrast_image(brightness: f64, contrast: f64) + /// Set the image alpha channel mode. MagickSetImageAlphaChannel => set_image_alpha_channel( alpha_channel: bindings::AlphaChannelOption) From d123b95b9e135c2f0dbaff9c99986673ede90da6 Mon Sep 17 00:00:00 2001 From: Maks Rawski Date: Sun, 13 Nov 2022 18:41:07 +0100 Subject: [PATCH 3/3] change 2 normal comments in magick.rs into docstrings --- src/wand/magick.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wand/magick.rs b/src/wand/magick.rs index b564eab..27a1556 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -986,10 +986,10 @@ impl MagickWand { MagickTransformImageColorspace => transform_image_colorspace( colorspace: bindings::ColorspaceType) - // Sets the image to the specified alpha level. + /// Sets the image to the specified alpha level. MagickSetImageAlpha => set_image_alpha(alpha: f64) - // Control the brightness, saturation, and hue of an image + /// Control the brightness, saturation, and hue of an image MagickModulateImage => modulate_image(brightness: f64, saturation: f64, hue: f64) /// Control the brightness and contrast