Expand description
Helpers for drawing basic shapes on images.
Every draw_
function comes in two variants: one creates a new copy of the input image, one modifies the image in place.
The latter is more memory efficient, but you lose the original image.
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
Canvas
to allow the user to configure e.g. whether to use blending.
Functions§
- draw_
antialiased_ line_ segment - Draws an antialised line segment on a new copy of an image.
- draw_
antialiased_ line_ segment_ mut - Draws an antialised line segment on an image in place.
- draw_
cross - Draws a colored cross on a new copy of an image.
- draw_
cross_ mut - Draws a colored cross on an image in place.
- draw_
cubic_ bezier_ curve - Draws a cubic Bézier curve on a new copy of an image.
- draw_
cubic_ bezier_ curve_ mut - Draws a cubic Bézier curve on an image in place.
- draw_
filled_ circle - Draws a circle and its contents on a new copy of the image.
- draw_
filled_ circle_ mut - Draws a circle and its contents on an image in place.
- draw_
filled_ ellipse - Draws an ellipse and its contents on a new copy of the image.
- draw_
filled_ ellipse_ mut - Draws an ellipse and its contents on an image in place.
- draw_
filled_ rect - Draws a rectangle and its contents on a new copy of an image.
- draw_
filled_ rect_ mut - Draws a rectangle and its contents on an image in place.
- draw_
hollow_ circle - Draws the outline of a circle on a new copy of an image.
- draw_
hollow_ circle_ mut - Draws the outline of a circle on an image in place.
- draw_
hollow_ ellipse - Draws the outline of an ellipse on a new copy of an image.
- draw_
hollow_ ellipse_ mut - Draws the outline of an ellipse on an image in place.
- draw_
hollow_ rect - Draws the outline of a rectangle on a new copy of an image.
- draw_
hollow_ rect_ mut - Draws the outline of a rectangle on an image in place.
- draw_
line_ segment - Draws a line segment on a new copy of an image.
- draw_
line_ segment_ mut - Draws a line segment on an image in place.
- draw_
polygon - Draws a polygon and its contents on a new copy of an image.
- draw_
polygon_ mut - Draws a polygon and its contents on an image in place.
- draw_
text - Draws colored text on a new copy of an image.
- draw_
text_ mut - Draws colored text on an image in place.
- text_
size - Get the width and height of the given text, rendered with the given font and scale.