[][src]Struct micro_gui::core::buffer::Buffer

pub struct Buffer<'a, Pixel> {
    pub width: usize,
    pub height: usize,
    pub porch_bytes: usize,
    pub trailer_bytes: usize,
    pub line_width_bytes: usize,
    pub data: &'a mut [u8],
    // some fields omitted
}

Buffer implements a generic display buffer over an arbitrary pixel type

Fields

width: usizeheight: usizeporch_bytes: usizetrailer_bytes: usizeline_width_bytes: usizedata: &'a mut [u8]

Methods

impl<'a, Pixel> Buffer<'a, Pixel>[src]

pub fn data(&self) -> &[u8][src]

impl<'a> Buffer<'a, PixelBW>[src]

pub fn new(
    width: usize,
    height: usize,
    porch_bytes: usize,
    trailer_bytes: usize,
    data: &'a mut [u8]
) -> Self
[src]

impl<'a> Buffer<'a, PixelRGB24>[src]

pub fn new(
    width: usize,
    height: usize,
    porch_bytes: usize,
    trailer_bytes: usize,
    data: &'a mut [u8]
) -> Self
[src]

Trait Implementations

impl<'a> Buff<bool> for Buffer<'a, PixelBW>[src]

fn set(&mut self, x: usize, y: usize, p: &PixelBW)[src]

Black and white mode pixel set function

fn get(&self, x: usize, y: usize) -> PixelBW[src]

Black and white mode pixel get function

fn clear(&mut self, p: &PixelBW)[src]

Black and White mode buffer clear function

fn size(&self) -> (usize, usize)[src]

Fetch the buffer size in pixels

impl<'a> Buff<PixelRGB24> for Buffer<'a, PixelRGB24>[src]

fn set(&mut self, x: usize, y: usize, p: &PixelRGB24)[src]

RGB24 mode pixel set function

fn get(&self, x: usize, y: usize) -> PixelRGB24[src]

RGB24 mode pixel get function

fn clear(&mut self, p: &PixelRGB24)[src]

RGB24 mode buffer clear function

fn size(&self) -> (usize, usize)[src]

Fetch the buffer size in pixels

impl<'a, Pixel> Display for Buffer<'a, Pixel>[src]

Format implementation for the buffer

impl<'a, Pixel: Debug> Debug for Buffer<'a, Pixel>[src]

Auto Trait Implementations

impl<'a, Pixel> Send for Buffer<'a, Pixel> where
    Pixel: Send

impl<'a, Pixel> Sync for Buffer<'a, Pixel> where
    Pixel: Sync

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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