pub const fn new(im: &[[u8; 5]; 5]) -> BitImage {
        // FIXME: can we reject values other than 0 or 1?
        const fn row_byte(row: [u8; 5]) -> u8 {
            row[0] | row[1] << 1 | row[2] << 2 | row[3] << 3 | row[4] << 4
        }
        BitImage([
            row_byte(im[0]),
            row_byte(im[1]),
            row_byte(im[2]),
            row_byte(im[3]),
            row_byte(im[4]),
        ])
    }
/// 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
///
/// ```no_run
/// # use microbit_common as microbit;
/// # use microbit::display::nonblocking::BitImage;
/// 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],
/// ]);
/// ```
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.
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 .
pub const fn new(im: &[[u8; 5]; 5]) -> BitImage {
        // FIXME: can we reject values other than 0 or 1?
        const fn row_byte(row: [u8; 5]) -> u8 {
            row[0] | row[1] << 1 | row[2] << 2 | row[3] << 3 | row[4] << 4
        }
        BitImage([
            row_byte(im[0]),
            row_byte(im[1]),
            row_byte(im[2]),
            row_byte(im[3]),
            row_byte(im[4]),
        ])
    }
pub const fn new ( im : & [ [ u8 ; 5 ] ; 5 ] ) -> BitImage { // FIXME: can we reject values other than 0 or 1? const fn row_byte ( row : [ u8 ; 5 ] ) -> u8 { row [ 0 ] | row [ 1 ] << 1 | row [ 2 ] << 2 | row [ 3 ] << 3 | row [ 4 ] << 4 } BitImage ( [ row_byte ( im [ 0 ] ) , row_byte ( im [ 1 ] ) , row_byte ( im [ 2 ] ) , row_byte ( im [ 3 ] ) , row_byte ( im [ 4 ] ) , ] ) }
Constructs a BitImage from an array of brightnesses.
Constructs a BitImage from an array of brightnesses .
im
&[[u8; 5]; 5]
im
&[[u8; 5]; 5]
example
None
use microbit_common as microbit;
None
use microbit::display::nonblocking::bitimage;
None