fn as_array(&self) -> Vec<u8> {
        let mut arr: Vec<u8> = vec![];

        match self.rotation {
            // 1 2 3    1 2 3
            // 4 5 6 => 4 5 6 => 1 2 3 4 5 6 7 8 9
            // 7 8 9    7 8 9
            Rotate::RotNone => arr.extend_from_slice(self.leds.as_slice()),
            // 1 2 3    7 4 1
            // 4 5 6 => 8 5 2 => 7 4 1 8 5 2 9 6 3
            // 7 8 9    9 6 3
            Rotate::RotCW90 => for x in 0..16 {
                for y in (0..16).rev() {
                    let led = self.get_pixel(x, y);
                    arr.extend_from_slice(led.as_slice());
                }
            },
            // 1 2 3    3 6 9
            // 4 5 6 => 2 5 8 => 3 6 9 2 5 8 1 4 7
            // 7 8 9    1 4 7
            Rotate::RotCCW90 => for x in (0..16).rev() {
                for y in 0..16 {
                    let led = self.get_pixel(x, y);
                    arr.extend_from_slice(led.as_slice());
                }
            },
            // 1 2 3    9 8 7
            // 4 5 6 => 6 5 4 => 9 8 7 6 5 4 3 2 1
            // 7 8 9    3 2 1
            Rotate::Rot180 => for led in self.leds.iter().rev() {
                arr.extend_from_slice(led.as_slice());
            },
        }

        arr
    }
/// Translate the internal buffer into a `Vec<u8>` of RGB values. The LEDs on
/// the Unicorn HAT HD are addressed in the following order, with each LED
/// consisting of three `u8`, one each for the R, G, and B values (assuming no
/// rotation has been set):
///
/// Physical LEDs => Vec<u8> order
///     1 2 3
///     4 5 6     => 1 2 3 4 5 6 7 8 9
///     7 8 9
Translate the internal buffer into a `Vec` of RGB values. The LEDs on
the Unicorn HAT HD are addressed in the following order, with each LED
consisting of three `u8`, one each for the R, G, and B values (assuming no
rotation has been set).


Translate the internal buffer into a ` Vec ` of RGB values . The LEDs on the Unicorn HAT HD are addressed in the following order with each LED consisting of three ` u8 ` one each for the R G and B values ( assuming no rotation has been set ) .
fn as_array(&self) -> Vec<u8> {
        let mut arr: Vec<u8> = vec![];
        match self.rotation {
            // 1 2 3    1 2 3
            // 4 5 6 => 4 5 6 => 1 2 3 4 5 6 7 8 9
            // 7 8 9    7 8 9
            Rotate::RotNone => arr.extend_from_slice(self.leds.as_slice()),
            // 1 2 3    7 4 1
            // 4 5 6 => 8 5 2 => 7 4 1 8 5 2 9 6 3
            // 7 8 9    9 6 3
            Rotate::RotCW90 => for x in 0..16 {
                for y in (0..16).rev() {
                    let led = self.get_pixel(x, y);
                    arr.extend_from_slice(led.as_slice());
                }
            },
            // 1 2 3    3 6 9
            // 4 5 6 => 2 5 8 => 3 6 9 2 5 8 1 4 7
            // 7 8 9    1 4 7
            Rotate::RotCCW90 => for x in (0..16).rev() {
                for y in 0..16 {
                    let led = self.get_pixel(x, y);
                    arr.extend_from_slice(led.as_slice());
                }
            },
            // 1 2 3    9 8 7
            // 4 5 6 => 6 5 4 => 9 8 7 6 5 4 3 2 1
            // 7 8 9    3 2 1
            Rotate::Rot180 => for led in self.leds.iter().rev() {
                arr.extend_from_slice(led.as_slice());
            },
        }
        arr
    }
fn as_array ( & self ) -> Vec < u8 > { let mut arr : Vec < u8 > = vec ! [ ] ; match self . rotation { // 1 2 3    1 2 3 // 4 5 6 => 4 5 6 => 1 2 3 4 5 6 7 8 9 // 7 8 9    7 8 9 Rotate :: RotNone => arr . extend_from_slice ( self . leds . as_slice ( ) ) , // 1 2 3    7 4 1 // 4 5 6 => 8 5 2 => 7 4 1 8 5 2 9 6 3 // 7 8 9    9 6 3 Rotate :: RotCW90 => for x in 0 .. 16 { for y in ( 0 .. 16 ) . rev ( ) { let led = self . get_pixel ( x , y ) ; arr . extend_from_slice ( led . as_slice ( ) ) ; } } , // 1 2 3    3 6 9 // 4 5 6 => 2 5 8 => 3 6 9 2 5 8 1 4 7 // 7 8 9    1 4 7 Rotate :: RotCCW90 => for x in ( 0 .. 16 ) . rev ( ) { for y in 0 .. 16 { let led = self . get_pixel ( x , y ) ; arr . extend_from_slice ( led . as_slice ( ) ) ; } } , // 1 2 3    9 8 7 // 4 5 6 => 6 5 4 => 9 8 7 6 5 4 3 2 1 // 7 8 9    3 2 1 Rotate :: Rot180 => for led in self . leds . iter ( ) . rev ( ) { arr . extend_from_slice ( led . as_slice ( ) ) ; } , } arr }
Translate the internal buffer into a `Vec<u8>` of RGB values.
Translate the internal buffer into a ` Vec<u8 > ` of RGB values .
&self
&self