Expand description
Helpers for drawing basic shapes on images.
Structs§
- Blend
- A canvas that blends pixels when drawing.
- Bresenham
Line Iter - Iterates over the coordinates in a line segment using Bresenham’s line drawing algorithm.
- Bresenham
Line Pixel Iter - Iterates over the image pixels in a line segment using Bresenham’s line drawing algorithm.
- Bresenham
Line Pixel Iter Mut - Iterates over the image pixels in a line segment using Bresenham’s line drawing algorithm.
Traits§
- Canvas
- A surface for drawing on - many drawing functions in this
library are generic over a
Canvasto allow the user to configure e.g. whether to use blending.
Functions§
- draw_
antialiased_ line_ segment - Draws an antialised line segment on an image.
- draw_
antialiased_ line_ segment_ mut - An in-place version of
draw_antialiased_line_segment(). - draw_
antialiased_ polygon - Draws an anti-aliased polygon polygon and its contents on an image.
- draw_
antialiased_ polygon_ mut - An in-place version of
draw_antialiased_polygon(). - draw_
cross - Draws a colored cross on an image.
- draw_
cross_ mut - An in-place version of
draw_cross(). - draw_
cubic_ bezier_ curve - Draws a cubic Bézier curve on an image.
- draw_
cubic_ bezier_ curve_ mut - An in-place version of
draw_cubic_bezier_curve(). - draw_
filled_ circle - Draws a circle and its contents on an image.
- draw_
filled_ circle_ mut - An in-place version of
draw_filled_circle(). - draw_
filled_ ellipse - Draws an ellipse and its contents on an image.
- draw_
filled_ ellipse_ mut - An in-place version of
draw_filled_ellipse(). - draw_
filled_ rect - Draws a rectangle and its contents on an image.
- draw_
filled_ rect_ mut - An in-place version of
draw_filled_rect(). - draw_
hollow_ circle - Draws the outline of a circle on an image.
- draw_
hollow_ circle_ mut - An in-place version of
draw_hollow_circle(). - draw_
hollow_ ellipse - Draws the outline of an ellipse on an image.
- draw_
hollow_ ellipse_ mut - An in-place version of
draw_hollow_ellipse(). - draw_
hollow_ polygon - Draws the outline of a polygon on an image in place.
- draw_
hollow_ polygon_ mut - An in-place version of
draw_hollow_polygon(). - draw_
hollow_ rect - Draws the outline of a rectangle on an image.
- draw_
hollow_ rect_ mut - An in-place version of
draw_hollow_rect(). - draw_
line_ segment - Draws a line segment on an image.
- draw_
line_ segment_ mut - An in-place version of
draw_line_segment(). - draw_
polygon - Draws a polygon and its contents on an image.
- draw_
polygon_ mut - An in-place version of
draw_polygon(). - draw_
text - Draws colored text on an image.
- draw_
text_ mut - An in-place version of
draw_text(). - flood_
fill - Equivalent to bucket tool in MS-PAINT Performs 4-way flood-fill based on this algorithm: https://en.wikipedia.org/wiki/Flood_fill#Span_filling
- flood_
fill_ mut - An in-place version of
flood_fill(). - text_
size - Get the width and height of the given text, rendered with the given font and scale.