[][src]Struct sensehat_screen::frame::PixelFrame

pub struct PixelFrame(_);

A frame of pixels. This is the basic representation for the LED Matrix display.

Implementations

impl PixelFrame[src]

Methods enabled by the clip feature.

pub fn clip(&self, other: &PixelFrame, clip_at: Offset) -> Self[src]

Shortcut to get a PixelFrame from a temporary Clip, at a given Offset. For memory reallocation, such as when rendering a clip at multiple offsets, it is better to use PixelFrame::build_clip.

pub fn build_clip(&self, other: &PixelFrame) -> Clip[src]

Create a Clip with this and another PixelFrame.

impl PixelFrame[src]

Methods enabled by the offset feature.

pub fn offset(&self, offset: Offset) -> Self[src]

Offset the PixelFrame by a number of pixels in any of the possible directions:

Example

    let frame: PixelFrame = Default::default();
    let moved_1px_to_the_left = frame.offset(Offset::left(1));

Panics

If offset is out of bounds (> 8).

impl PixelFrame[src]

Methods enabled by the rotate feature.

pub fn rotate(&self, rotate: Rotate) -> Self[src]

Create a new PixelFrame that is rotated by a multiple of 90°, counter-clockwise.

impl PixelFrame[src]

impl PixelFrame[src]

pub fn new(pixels: &[PixelColor; 64]) -> Self[src]

Create a FrameLine representing the current PixelFrame.

pub fn frame_line(&self) -> FrameLine[src]

Create a FrameLine representing the current PixelFrame.

pub fn transpose(&mut self)[src]

Transpose the LED Matrix. Rows become columns.

pub fn flip_h(&mut self)[src]

Flip the LED Matrix horizontally.

pub fn flip_v(&mut self)[src]

Flip the LED Matrix vertically.

pub fn reverse(&mut self)[src]

Reverse the LED Matrix.

pub fn as_rows(&self) -> [[PixelColor; 8]; 8][src]

Returns a [[PixelColor; 8]; 8], organized by rows, from top to bottom.

pub fn as_columns(&self) -> [[PixelColor; 8]; 8][src]

Returns a [[PixelColor; 8]; 8], organized by columns, from left to right.

pub fn from_rows(rows: &[[PixelColor; 8]; 8]) -> Self[src]

Create a new PixelFrame from a [[PixelColor; 8]; 8], of 8 rows with 8 PixelColors.

pub fn from_columns(columns: &[[PixelColor; 8]; 8]) -> Self[src]

Create a new PixelFrame from a [[PixelColor; 8]; 8], of 8 columns with 8 PixelColors.

Trait Implementations

impl Clone for PixelFrame[src]

impl Copy for PixelFrame[src]

impl Debug for PixelFrame[src]

impl Default for PixelFrame[src]

impl<'a> From<&'a [PixelColor; 64]> for PixelFrame[src]

impl From<[PixelColor; 64]> for PixelFrame[src]

impl From<FontFrame> for PixelFrame[src]

impl Index<usize> for PixelFrame[src]

type Output = PixelColor

The returned type after indexing.

impl IndexMut<usize> for PixelFrame[src]

impl Into<[PixelColor; 64]> for PixelFrame[src]

impl PartialEq<PixelFrame> for PixelFrame[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.