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],
]);

Returns a new blank BitImage.

All pixel values are 0.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the brightness value for a single LED. Read more

Returns the brightness value for a single LED. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.