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
impl DrawingWand
Sourcepub fn clear_exception(&mut self) -> Result<(), MagickError>
pub fn clear_exception(&mut self) -> Result<(), MagickError>
Clears any exception currently recorded on the wand.
Sourcepub fn get_exception_type(&self) -> ExceptionType
pub fn get_exception_type(&self) -> ExceptionType
Returns the severity of the most recent exception on the wand.
Sourcepub fn get_exception(&self) -> Result<(String, ExceptionType), MagickError>
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.
Sourcepub fn is_wand(&self) -> Result<(), MagickError>
pub fn is_wand(&self) -> Result<(), MagickError>
Returns Ok(()) if this is a valid wand of the expected type.
Source§impl DrawingWand
impl DrawingWand
Sourcepub fn draw_annotation(
&mut self,
x: f64,
y: f64,
text: &str,
) -> Result<(), MagickError>
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.
Sourcepub fn draw_circle(&mut self, ox: f64, oy: f64, px: f64, py: f64)
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.
Sourcepub fn draw_rectangle(
&mut self,
upper_left_x: f64,
upper_left_y: f64,
lower_right_x: f64,
lower_right_y: f64,
)
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).
Sourcepub 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,
)
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.
Sourcepub fn draw_line(&mut self, sx: f64, sy: f64, ex: f64, ey: f64)
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.
Sourcepub fn draw_point(&mut self, x: f64, y: f64)
pub fn draw_point(&mut self, x: f64, y: f64)
Draw a single point at (x, y) using the current fill color.
Sourcepub fn draw_arc(
&mut self,
sx: f64,
sy: f64,
ex: f64,
ey: f64,
start_degrees: f64,
end_degrees: f64,
)
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.
Sourcepub fn draw_ellipse(
&mut self,
ox: f64,
oy: f64,
rx: f64,
ry: f64,
start_degrees: f64,
end_degrees: f64,
)
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).
Sourcepub fn draw_polygon(&mut self, coordinates: &[(f64, f64)])
pub fn draw_polygon(&mut self, coordinates: &[(f64, f64)])
Draw a closed polygon connecting the given (x, y) coordinates.
Sourcepub fn draw_polyline(&mut self, coordinates: &[(f64, f64)])
pub fn draw_polyline(&mut self, coordinates: &[(f64, f64)])
Draw an open series of line segments connecting the given (x, y)
coordinates.
Sourcepub fn draw_bezier(&mut self, coordinates: &[(f64, f64)])
pub fn draw_bezier(&mut self, coordinates: &[(f64, f64)])
Draw a Bezier curve through the given (x, y) control points.
Sourcepub fn draw_color(&mut self, x: f64, y: f64, paint_method: PaintMethod)
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).
Sourcepub fn get_font(&self) -> Result<String, MagickError>
pub fn get_font(&self) -> Result<String, MagickError>
Wraps ImageMagick’s DrawGetFont function.
Sourcepub fn set_font(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_font(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s DrawSetFont function.
Sourcepub fn get_font_family(&self) -> Result<String, MagickError>
pub fn get_font_family(&self) -> Result<String, MagickError>
Wraps ImageMagick’s DrawGetFontFamily function.
Sourcepub fn set_font_family(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_font_family(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s DrawSetFontFamily function.
Sourcepub fn get_vector_graphics(&self) -> Result<String, MagickError>
pub fn get_vector_graphics(&self) -> Result<String, MagickError>
Wraps ImageMagick’s DrawGetVectorGraphics function.
Sourcepub fn set_vector_graphics(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_vector_graphics(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s DrawSetVectorGraphics function.
Sourcepub fn get_clip_path(&self) -> Result<String, MagickError>
pub fn get_clip_path(&self) -> Result<String, MagickError>
Wraps ImageMagick’s DrawGetClipPath function.
Sourcepub fn set_clip_path(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_clip_path(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s DrawSetClipPath function.
pub fn fmt_string_settings(&self, f: &mut Formatter<'_>, prefix: &str) -> Result
Sourcepub fn get_text_encoding(&self) -> Result<String, MagickError>
pub fn get_text_encoding(&self) -> Result<String, MagickError>
Wraps ImageMagick’s DrawGetTextEncoding function.
Sourcepub fn set_text_encoding(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_text_encoding(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s DrawSetTextEncoding function.
pub fn fmt_string_unchecked_settings( &self, f: &mut Formatter<'_>, prefix: &str, ) -> Result
Sourcepub fn get_border_color(&self) -> PixelWand
pub fn get_border_color(&self) -> PixelWand
Wraps ImageMagick’s DrawGetBorderColor function.
Sourcepub fn set_border_color(&mut self, pw: &PixelWand)
pub fn set_border_color(&mut self, pw: &PixelWand)
Wraps ImageMagick’s DrawSetBorderColor function.
Sourcepub fn get_fill_color(&self) -> PixelWand
pub fn get_fill_color(&self) -> PixelWand
Wraps ImageMagick’s DrawGetFillColor function.
Sourcepub fn set_fill_color(&mut self, pw: &PixelWand)
pub fn set_fill_color(&mut self, pw: &PixelWand)
Wraps ImageMagick’s DrawSetFillColor function.
Sourcepub fn get_stroke_color(&self) -> PixelWand
pub fn get_stroke_color(&self) -> PixelWand
Wraps ImageMagick’s DrawGetStrokeColor function.
Sourcepub fn set_stroke_color(&mut self, pw: &PixelWand)
pub fn set_stroke_color(&mut self, pw: &PixelWand)
Wraps ImageMagick’s DrawSetStrokeColor function.
Sourcepub fn get_text_under_color(&self) -> PixelWand
pub fn get_text_under_color(&self) -> PixelWand
Wraps ImageMagick’s DrawGetTextUnderColor function.
Sourcepub fn set_text_under_color(&mut self, pw: &PixelWand)
pub fn set_text_under_color(&mut self, pw: &PixelWand)
Wraps ImageMagick’s DrawSetTextUnderColor function.
pub fn fmt_pixel_settings(&self, f: &mut Formatter<'_>, prefix: &str) -> Result
Sourcepub fn get_gravity(&self) -> GravityType
pub fn get_gravity(&self) -> GravityType
Wraps ImageMagick’s DrawGetGravity function.
Sourcepub fn set_gravity(&mut self, v: GravityType)
pub fn set_gravity(&mut self, v: GravityType)
Wraps ImageMagick’s DrawSetGravity function.
Sourcepub fn get_opacity(&self) -> f64
pub fn get_opacity(&self) -> f64
Wraps ImageMagick’s DrawGetOpacity function.
Sourcepub fn set_opacity(&mut self, v: f64)
pub fn set_opacity(&mut self, v: f64)
Wraps ImageMagick’s DrawSetOpacity function.
Sourcepub fn get_clip_rule(&self) -> FillRule
pub fn get_clip_rule(&self) -> FillRule
Wraps ImageMagick’s DrawGetClipRule function.
Sourcepub fn set_clip_rule(&mut self, v: FillRule)
pub fn set_clip_rule(&mut self, v: FillRule)
Wraps ImageMagick’s DrawSetClipRule function.
Sourcepub fn get_clip_units(&self) -> ClipPathUnits
pub fn get_clip_units(&self) -> ClipPathUnits
Wraps ImageMagick’s DrawGetClipUnits function.
Sourcepub fn set_clip_units(&mut self, v: ClipPathUnits)
pub fn set_clip_units(&mut self, v: ClipPathUnits)
Wraps ImageMagick’s DrawSetClipUnits function.
Sourcepub fn get_fill_rule(&self) -> FillRule
pub fn get_fill_rule(&self) -> FillRule
Wraps ImageMagick’s DrawGetFillRule function.
Sourcepub fn set_fill_rule(&mut self, v: FillRule)
pub fn set_fill_rule(&mut self, v: FillRule)
Wraps ImageMagick’s DrawSetFillRule function.
Sourcepub fn get_fill_opacity(&self) -> f64
pub fn get_fill_opacity(&self) -> f64
Wraps ImageMagick’s DrawGetFillOpacity function.
Sourcepub fn set_fill_opacity(&mut self, v: f64)
pub fn set_fill_opacity(&mut self, v: f64)
Wraps ImageMagick’s DrawSetFillOpacity function.
Sourcepub fn get_font_size(&self) -> f64
pub fn get_font_size(&self) -> f64
Wraps ImageMagick’s DrawGetFontSize function.
Sourcepub fn set_font_size(&mut self, v: f64)
pub fn set_font_size(&mut self, v: f64)
Wraps ImageMagick’s DrawSetFontSize function.
Sourcepub fn get_font_style(&self) -> StyleType
pub fn get_font_style(&self) -> StyleType
Wraps ImageMagick’s DrawGetFontStyle function.
Sourcepub fn set_font_style(&mut self, v: StyleType)
pub fn set_font_style(&mut self, v: StyleType)
Wraps ImageMagick’s DrawSetFontStyle function.
Sourcepub fn get_font_weight(&self) -> usize
pub fn get_font_weight(&self) -> usize
Wraps ImageMagick’s DrawGetFontWeight function.
Sourcepub fn set_font_weight(&mut self, v: usize)
pub fn set_font_weight(&mut self, v: usize)
Wraps ImageMagick’s DrawSetFontWeight function.
Sourcepub fn get_font_stretch(&self) -> StretchType
pub fn get_font_stretch(&self) -> StretchType
Wraps ImageMagick’s DrawGetFontStretch function.
Sourcepub fn set_font_stretch(&mut self, v: StretchType)
pub fn set_font_stretch(&mut self, v: StretchType)
Wraps ImageMagick’s DrawSetFontStretch function.
Sourcepub fn get_stroke_dash_offset(&self) -> f64
pub fn get_stroke_dash_offset(&self) -> f64
Wraps ImageMagick’s DrawGetStrokeDashOffset function.
Sourcepub fn set_stroke_dash_offset(&mut self, v: f64)
pub fn set_stroke_dash_offset(&mut self, v: f64)
Wraps ImageMagick’s DrawSetStrokeDashOffset function.
Sourcepub fn get_stroke_line_cap(&self) -> LineCap
pub fn get_stroke_line_cap(&self) -> LineCap
Wraps ImageMagick’s DrawGetStrokeLineCap function.
Sourcepub fn set_stroke_line_cap(&mut self, v: LineCap)
pub fn set_stroke_line_cap(&mut self, v: LineCap)
Wraps ImageMagick’s DrawSetStrokeLineCap function.
Sourcepub fn get_stroke_line_join(&self) -> LineJoin
pub fn get_stroke_line_join(&self) -> LineJoin
Wraps ImageMagick’s DrawGetStrokeLineJoin function.
Sourcepub fn set_stroke_line_join(&mut self, v: LineJoin)
pub fn set_stroke_line_join(&mut self, v: LineJoin)
Wraps ImageMagick’s DrawSetStrokeLineJoin function.
Sourcepub fn get_stroke_miter_limit(&self) -> usize
pub fn get_stroke_miter_limit(&self) -> usize
Wraps ImageMagick’s DrawGetStrokeMiterLimit function.
Sourcepub fn set_stroke_miter_limit(&mut self, v: usize)
pub fn set_stroke_miter_limit(&mut self, v: usize)
Wraps ImageMagick’s DrawSetStrokeMiterLimit function.
Sourcepub fn get_stroke_opacity(&self) -> f64
pub fn get_stroke_opacity(&self) -> f64
Wraps ImageMagick’s DrawGetStrokeOpacity function.
Sourcepub fn set_stroke_opacity(&mut self, v: f64)
pub fn set_stroke_opacity(&mut self, v: f64)
Wraps ImageMagick’s DrawSetStrokeOpacity function.
Sourcepub fn get_stroke_width(&self) -> f64
pub fn get_stroke_width(&self) -> f64
Wraps ImageMagick’s DrawGetStrokeWidth function.
Sourcepub fn set_stroke_width(&mut self, v: f64)
pub fn set_stroke_width(&mut self, v: f64)
Wraps ImageMagick’s DrawSetStrokeWidth function.
Sourcepub fn get_stroke_antialias(&self) -> MagickBooleanType
pub fn get_stroke_antialias(&self) -> MagickBooleanType
Wraps ImageMagick’s DrawGetStrokeAntialias function.
Sourcepub fn set_stroke_antialias(&mut self, v: MagickBooleanType)
pub fn set_stroke_antialias(&mut self, v: MagickBooleanType)
Wraps ImageMagick’s DrawSetStrokeAntialias function.
Sourcepub fn get_text_alignment(&self) -> AlignType
pub fn get_text_alignment(&self) -> AlignType
Wraps ImageMagick’s DrawGetTextAlignment function.
Sourcepub fn set_text_alignment(&mut self, v: AlignType)
pub fn set_text_alignment(&mut self, v: AlignType)
Wraps ImageMagick’s DrawSetTextAlignment function.
Sourcepub fn get_text_antialias(&self) -> MagickBooleanType
pub fn get_text_antialias(&self) -> MagickBooleanType
Wraps ImageMagick’s DrawGetTextAntialias function.
Sourcepub fn set_text_antialias(&mut self, v: MagickBooleanType)
pub fn set_text_antialias(&mut self, v: MagickBooleanType)
Wraps ImageMagick’s DrawSetTextAntialias function.
Sourcepub fn get_text_decoration(&self) -> DecorationType
pub fn get_text_decoration(&self) -> DecorationType
Wraps ImageMagick’s DrawGetTextDecoration function.
Sourcepub fn set_text_decoration(&mut self, v: DecorationType)
pub fn set_text_decoration(&mut self, v: DecorationType)
Wraps ImageMagick’s DrawSetTextDecoration function.
Sourcepub fn get_text_direction(&self) -> DirectionType
pub fn get_text_direction(&self) -> DirectionType
Wraps ImageMagick’s DrawGetTextDirection function.
Sourcepub fn set_text_direction(&mut self, v: DirectionType)
pub fn set_text_direction(&mut self, v: DirectionType)
Wraps ImageMagick’s DrawSetTextDirection function.
Sourcepub fn get_text_kerning(&self) -> f64
pub fn get_text_kerning(&self) -> f64
Wraps ImageMagick’s DrawGetTextKerning function.
Sourcepub fn set_text_kerning(&mut self, v: f64)
pub fn set_text_kerning(&mut self, v: f64)
Wraps ImageMagick’s DrawSetTextKerning function.
Sourcepub fn get_text_interline_spacing(&self) -> f64
pub fn get_text_interline_spacing(&self) -> f64
Wraps ImageMagick’s DrawGetTextInterlineSpacing function.
Sourcepub fn set_text_interline_spacing(&mut self, v: f64)
pub fn set_text_interline_spacing(&mut self, v: f64)
Wraps ImageMagick’s DrawSetTextInterlineSpacing function.
Sourcepub fn get_text_interword_spacing(&self) -> f64
pub fn get_text_interword_spacing(&self) -> f64
Wraps ImageMagick’s DrawGetTextInterwordSpacing function.
Sourcepub fn set_text_interword_spacing(&mut self, v: f64)
pub fn set_text_interword_spacing(&mut self, v: f64)
Wraps ImageMagick’s DrawSetTextInterwordSpacing function.