#embedded-graphics #graphics

no-std embedded-graphics-core

Core traits and functionality for embedded-graphics

8 releases

0.4.0 May 14, 2023
0.3.3 Sep 9, 2021
0.3.2 Jun 5, 2021
0.3.1 May 3, 2021
0.1.0 Nov 29, 2020

#528 in Embedded development

Download history 8827/week @ 2024-07-20 7390/week @ 2024-07-27 8445/week @ 2024-08-03 8967/week @ 2024-08-10 7984/week @ 2024-08-17 7823/week @ 2024-08-24 10972/week @ 2024-08-31 6574/week @ 2024-09-07 6661/week @ 2024-09-14 7344/week @ 2024-09-21 6406/week @ 2024-09-28 5661/week @ 2024-10-05 6923/week @ 2024-10-12 6668/week @ 2024-10-19 6628/week @ 2024-10-26 7092/week @ 2024-11-02

28,011 downloads per month
Used in 187 crates (65 directly)

MIT/Apache

185KB
3K SLoC

Embedded graphics logo

Build Status Crates.io Docs.rs embedded-graphics on Matrix

Embedded graphics core

embedded-graphics-core contains the core components of embedded-graphics that are required to add embedded-graphics support to display drivers, image libraries, text renderers and other third party crates.

This crate should only be used by crates that extend embedded-graphics. Applications should instead depend on embedded-graphics itself.

Like any other crate, embedded-graphics-core will change over time, however it will change at a much slower rate than embedded-graphics itself, and will likely release fewer breaking changes. This will provide more stability and compatability for the weider embedded-graphics ecosystem, whilst allowing non-core features of embedded-graphics to evolve at a faster pace. The same version of embedded-graphics-core may be used for multiple major versions of embedded-graphics.

Core functionality

  • DrawTarget - By implementing a draw target for a display driver, all embedded-graphics drawables can be drawn to that display.
  • Drawable - This trait can be implemented to make an object drawable to any DrawTarget. Examples include shapes, text, UI elements, etc.
  • ImageDrawable
  • Color types - see below.
  • Geometry - Point, Size and Rectangle provide ways of defining positions, dimensions and rectangular areas respectively.

Colors

The pixelcolor module provides various standard color types, from BinaryColor to Rgb888. See the pixelcolor module documentation for the complete list of color depths and formats available.

Display drivers

See the DrawTarget documentation for examples on how to integrate embedded-graphics with a display driver using the DrawTarget trait.

Images

The ImageDrawable trait should be implemented for any image or image-like item, for example a spritemap.

Features

  • defmt - implements defmt::Format for all types where this is possible.

Minimum supported Rust version

The minimum supported Rust version for embedded-graphics-core is 1.61 or greater. Ensure you have the correct version of Rust installed, preferably through https://rustup.rs.

Development setup

Please see the development setup guide.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–1MB
~21K SLoC