Crate embedded_graphics[−][src]
Embedded graphics
This crate aims to make drawing 2D graphics primitives super easy. It currently supports the following:
- 1 bit-per-pixel images
- 8 bit-per-pixel images
- Primitives
- Lines
- Rectangles (and squares)
- Circles
- Text with multiple fonts
A core goal is to do the above without using any buffers; the crate should work without a
dynamic memory allocator and without pre-allocating large chunks of memory. To achieve this, it
takes an Iterator
based approach, where pixel values and positions are calculated on the fly,
with the minimum of saved state. This allows the consuming application to use far less RAM at
little to no performance penalty.
To use this crate in a driver, you only need to implement the Drawing
trait to start drawing
things.
You can also add your own objects by implementing IntoIterator<Item = Pixel<C>>
to create an
iterator that Drawable#draw()
can consume.
Crate features
nalgebra_support
- use the Nalgebra crate withno_std
support to use as theCoord
type. This should allow you to use most Nalgebra methods on objects rendered by embedded_graphics.
Modules
coord |
2D signed coordinate in screen space |
dev |
Devlopment/test helpers |
drawable |
|
fonts |
Pixel based fonts |
image |
Image object |
pixelcolor |
Pixel color trait |
prelude |
Prelude |
primitives |
Graphics primitives |
style |
Styling struct to customise the look of objects. |
transform |
Transformations for graphics objects |
unsignedcoord |
2D unsigned coordinate in screen space |
Traits
Drawing |
The main trait of this crate. All graphics objects must implement it. |