Skip to main content

DrawingWand

Struct DrawingWand 

Source
pub struct DrawingWand { /* private fields */ }
Expand description

A safe wrapper around an ImageMagick DrawingWand.

The wand owns the underlying ImageMagick handle and destroys it when dropped.

Implementations§

Source§

impl DrawingWand

Source

pub fn new() -> Self

Creates a new, empty DrawingWand.

Source

pub fn clear_exception(&mut self) -> Result<(), MagickError>

Clears any exception currently recorded on the wand.

Source

pub fn get_exception_type(&self) -> ExceptionType

Returns the severity of the most recent exception on the wand.

Source

pub fn get_exception(&self) -> Result<(String, ExceptionType), MagickError>

Returns the most recent exception on the wand as a (message, severity) pair, or an error if no exception message is available.

Source

pub fn is_wand(&self) -> Result<(), MagickError>

Returns Ok(()) if this is a valid wand of the expected type.

Source§

impl DrawingWand

Source

pub fn draw_annotation( &mut self, x: f64, y: f64, text: &str, ) -> Result<(), MagickError>

Draw the given text at (x, y) using the current font and fill color.

Source

pub fn draw_circle(&mut self, ox: f64, oy: f64, px: f64, py: f64)

Draw a circle centered at (ox, oy) with (px, py) a point on its perimeter.

Source

pub fn draw_rectangle( &mut self, upper_left_x: f64, upper_left_y: f64, lower_right_x: f64, lower_right_y: f64, )

Draw a rectangle from the upper-left corner (upper_left_x, upper_left_y) to the lower-right corner (lower_right_x, lower_right_y).

Source

pub fn draw_round_rectangle( &mut self, upper_left_x: f64, upper_left_y: f64, lower_right_x: f64, lower_right_y: f64, rx: f64, ry: f64, )

Draw a rectangle with rounded corners, where rx and ry are the corner radii in the x and y directions.

Source

pub fn draw_line(&mut self, sx: f64, sy: f64, ex: f64, ey: f64)

Draw a line from (sx, sy) to (ex, ey) using the current stroke color and width.

Source

pub fn draw_point(&mut self, x: f64, y: f64)

Draw a single point at (x, y) using the current fill color.

Source

pub fn draw_arc( &mut self, sx: f64, sy: f64, ex: f64, ey: f64, start_degrees: f64, end_degrees: f64, )

Draw an arc within the bounding rectangle (sx, sy)-(ex, ey), sweeping from start_degrees to end_degrees.

Source

pub fn draw_ellipse( &mut self, ox: f64, oy: f64, rx: f64, ry: f64, start_degrees: f64, end_degrees: f64, )

Draw an ellipse centered at (ox, oy) with radii rx and ry, sweeping from start_degrees to end_degrees (use 0 and 360 for a full ellipse).

Source

pub fn draw_polygon(&mut self, coordinates: &[(f64, f64)])

Draw a closed polygon connecting the given (x, y) coordinates.

Source

pub fn draw_polyline(&mut self, coordinates: &[(f64, f64)])

Draw an open series of line segments connecting the given (x, y) coordinates.

Source

pub fn draw_bezier(&mut self, coordinates: &[(f64, f64)])

Draw a Bezier curve through the given (x, y) control points.

Source

pub fn draw_color(&mut self, x: f64, y: f64, paint_method: PaintMethod)

Paint at (x, y) using the current fill color and the given paint method (for example flood-filling a region).

Source

pub fn get_font(&self) -> Result<String, MagickError>

Wraps ImageMagick’s DrawGetFont function.

Source

pub fn set_font(&mut self, s: &str) -> Result<(), MagickError>

Wraps ImageMagick’s DrawSetFont function.

Source

pub fn get_font_family(&self) -> Result<String, MagickError>

Wraps ImageMagick’s DrawGetFontFamily function.

Source

pub fn set_font_family(&mut self, s: &str) -> Result<(), MagickError>

Wraps ImageMagick’s DrawSetFontFamily function.

Source

pub fn get_vector_graphics(&self) -> Result<String, MagickError>

Wraps ImageMagick’s DrawGetVectorGraphics function.

Source

pub fn set_vector_graphics(&mut self, s: &str) -> Result<(), MagickError>

Wraps ImageMagick’s DrawSetVectorGraphics function.

Source

pub fn get_clip_path(&self) -> Result<String, MagickError>

Wraps ImageMagick’s DrawGetClipPath function.

Source

pub fn set_clip_path(&mut self, s: &str) -> Result<(), MagickError>

Wraps ImageMagick’s DrawSetClipPath function.

Source

pub fn fmt_string_settings(&self, f: &mut Formatter<'_>, prefix: &str) -> Result

Source

pub fn get_text_encoding(&self) -> Result<String, MagickError>

Wraps ImageMagick’s DrawGetTextEncoding function.

Source

pub fn set_text_encoding(&mut self, s: &str) -> Result<(), MagickError>

Wraps ImageMagick’s DrawSetTextEncoding function.

Source

pub fn fmt_string_unchecked_settings( &self, f: &mut Formatter<'_>, prefix: &str, ) -> Result

Source

pub fn get_border_color(&self) -> PixelWand

Wraps ImageMagick’s DrawGetBorderColor function.

Source

pub fn set_border_color(&mut self, pw: &PixelWand)

Wraps ImageMagick’s DrawSetBorderColor function.

Source

pub fn get_fill_color(&self) -> PixelWand

Wraps ImageMagick’s DrawGetFillColor function.

Source

pub fn set_fill_color(&mut self, pw: &PixelWand)

Wraps ImageMagick’s DrawSetFillColor function.

Source

pub fn get_stroke_color(&self) -> PixelWand

Wraps ImageMagick’s DrawGetStrokeColor function.

Source

pub fn set_stroke_color(&mut self, pw: &PixelWand)

Wraps ImageMagick’s DrawSetStrokeColor function.

Source

pub fn get_text_under_color(&self) -> PixelWand

Wraps ImageMagick’s DrawGetTextUnderColor function.

Source

pub fn set_text_under_color(&mut self, pw: &PixelWand)

Wraps ImageMagick’s DrawSetTextUnderColor function.

Source

pub fn fmt_pixel_settings(&self, f: &mut Formatter<'_>, prefix: &str) -> Result

Source

pub fn get_gravity(&self) -> GravityType

Wraps ImageMagick’s DrawGetGravity function.

Source

pub fn set_gravity(&mut self, v: GravityType)

Wraps ImageMagick’s DrawSetGravity function.

Source

pub fn get_opacity(&self) -> f64

Wraps ImageMagick’s DrawGetOpacity function.

Source

pub fn set_opacity(&mut self, v: f64)

Wraps ImageMagick’s DrawSetOpacity function.

Source

pub fn get_clip_rule(&self) -> FillRule

Wraps ImageMagick’s DrawGetClipRule function.

Source

pub fn set_clip_rule(&mut self, v: FillRule)

Wraps ImageMagick’s DrawSetClipRule function.

Source

pub fn get_clip_units(&self) -> ClipPathUnits

Wraps ImageMagick’s DrawGetClipUnits function.

Source

pub fn set_clip_units(&mut self, v: ClipPathUnits)

Wraps ImageMagick’s DrawSetClipUnits function.

Source

pub fn get_fill_rule(&self) -> FillRule

Wraps ImageMagick’s DrawGetFillRule function.

Source

pub fn set_fill_rule(&mut self, v: FillRule)

Wraps ImageMagick’s DrawSetFillRule function.

Source

pub fn get_fill_opacity(&self) -> f64

Wraps ImageMagick’s DrawGetFillOpacity function.

Source

pub fn set_fill_opacity(&mut self, v: f64)

Wraps ImageMagick’s DrawSetFillOpacity function.

Source

pub fn get_font_size(&self) -> f64

Wraps ImageMagick’s DrawGetFontSize function.

Source

pub fn set_font_size(&mut self, v: f64)

Wraps ImageMagick’s DrawSetFontSize function.

Source

pub fn get_font_style(&self) -> StyleType

Wraps ImageMagick’s DrawGetFontStyle function.

Source

pub fn set_font_style(&mut self, v: StyleType)

Wraps ImageMagick’s DrawSetFontStyle function.

Source

pub fn get_font_weight(&self) -> usize

Wraps ImageMagick’s DrawGetFontWeight function.

Source

pub fn set_font_weight(&mut self, v: usize)

Wraps ImageMagick’s DrawSetFontWeight function.

Source

pub fn get_font_stretch(&self) -> StretchType

Wraps ImageMagick’s DrawGetFontStretch function.

Source

pub fn set_font_stretch(&mut self, v: StretchType)

Wraps ImageMagick’s DrawSetFontStretch function.

Source

pub fn get_stroke_dash_offset(&self) -> f64

Wraps ImageMagick’s DrawGetStrokeDashOffset function.

Source

pub fn set_stroke_dash_offset(&mut self, v: f64)

Wraps ImageMagick’s DrawSetStrokeDashOffset function.

Source

pub fn get_stroke_line_cap(&self) -> LineCap

Wraps ImageMagick’s DrawGetStrokeLineCap function.

Source

pub fn set_stroke_line_cap(&mut self, v: LineCap)

Wraps ImageMagick’s DrawSetStrokeLineCap function.

Source

pub fn get_stroke_line_join(&self) -> LineJoin

Wraps ImageMagick’s DrawGetStrokeLineJoin function.

Source

pub fn set_stroke_line_join(&mut self, v: LineJoin)

Wraps ImageMagick’s DrawSetStrokeLineJoin function.

Source

pub fn get_stroke_miter_limit(&self) -> usize

Wraps ImageMagick’s DrawGetStrokeMiterLimit function.

Source

pub fn set_stroke_miter_limit(&mut self, v: usize)

Wraps ImageMagick’s DrawSetStrokeMiterLimit function.

Source

pub fn get_stroke_opacity(&self) -> f64

Wraps ImageMagick’s DrawGetStrokeOpacity function.

Source

pub fn set_stroke_opacity(&mut self, v: f64)

Wraps ImageMagick’s DrawSetStrokeOpacity function.

Source

pub fn get_stroke_width(&self) -> f64

Wraps ImageMagick’s DrawGetStrokeWidth function.

Source

pub fn set_stroke_width(&mut self, v: f64)

Wraps ImageMagick’s DrawSetStrokeWidth function.

Source

pub fn get_stroke_antialias(&self) -> MagickBooleanType

Wraps ImageMagick’s DrawGetStrokeAntialias function.

Source

pub fn set_stroke_antialias(&mut self, v: MagickBooleanType)

Wraps ImageMagick’s DrawSetStrokeAntialias function.

Source

pub fn get_text_alignment(&self) -> AlignType

Wraps ImageMagick’s DrawGetTextAlignment function.

Source

pub fn set_text_alignment(&mut self, v: AlignType)

Wraps ImageMagick’s DrawSetTextAlignment function.

Source

pub fn get_text_antialias(&self) -> MagickBooleanType

Wraps ImageMagick’s DrawGetTextAntialias function.

Source

pub fn set_text_antialias(&mut self, v: MagickBooleanType)

Wraps ImageMagick’s DrawSetTextAntialias function.

Source

pub fn get_text_decoration(&self) -> DecorationType

Wraps ImageMagick’s DrawGetTextDecoration function.

Source

pub fn set_text_decoration(&mut self, v: DecorationType)

Wraps ImageMagick’s DrawSetTextDecoration function.

Source

pub fn get_text_direction(&self) -> DirectionType

Wraps ImageMagick’s DrawGetTextDirection function.

Source

pub fn set_text_direction(&mut self, v: DirectionType)

Wraps ImageMagick’s DrawSetTextDirection function.

Source

pub fn get_text_kerning(&self) -> f64

Wraps ImageMagick’s DrawGetTextKerning function.

Source

pub fn set_text_kerning(&mut self, v: f64)

Wraps ImageMagick’s DrawSetTextKerning function.

Source

pub fn get_text_interline_spacing(&self) -> f64

Wraps ImageMagick’s DrawGetTextInterlineSpacing function.

Source

pub fn set_text_interline_spacing(&mut self, v: f64)

Wraps ImageMagick’s DrawSetTextInterlineSpacing function.

Source

pub fn get_text_interword_spacing(&self) -> f64

Wraps ImageMagick’s DrawGetTextInterwordSpacing function.

Source

pub fn set_text_interword_spacing(&mut self, v: f64)

Wraps ImageMagick’s DrawSetTextInterwordSpacing function.

Source

pub fn fmt_unchecked_settings( &self, f: &mut Formatter<'_>, prefix: &str, ) -> Result

Trait Implementations§

Source§

impl Clone for DrawingWand

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DrawingWand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DrawingWand

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for DrawingWand

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for DrawingWand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.