Struct microbit_text::image::BitImage [−][src]
pub struct BitImage(_);
Expand description
A 5×5 image supporting only two levels of brightness (on and off).
Uses 5 bytes of storage.
For display, each pixel is treated as having brightness either 0 or MAX_BRIGHTNESS.
Implementations
Constructs a BitImage from an array of brightnesses.
The data should be an array of 5 rows (top first), each of which is an array of 5 values (left first). Each value should be either 0 or 1.
Example
const HEART: BitImage = BitImage::new(&[
[0, 1, 0, 1, 0],
[1, 0, 1, 0, 1],
[1, 0, 0, 0, 1],
[0, 1, 0, 1, 0],
[0, 0, 1, 0, 0],
]);