Buffer

Struct Buffer 

Source
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],
    /* private fields */
}
Expand description

Buffer implements a generic display buffer over an arbitrary pixel type

Fields§

§width: usize§height: usize§porch_bytes: usize§trailer_bytes: usize§line_width_bytes: usize§data: &'a mut [u8]

Implementations§

Source§

impl<'a, Pixel> Buffer<'a, Pixel>

Source

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

Source§

impl<'a> Buffer<'a, PixelBW>

Source

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

Source§

impl<'a> Buffer<'a, PixelRGB24>

Source

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

Trait Implementations§

Source§

impl<'a> Buff<PixelRGB24> for Buffer<'a, PixelRGB24>

Source§

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

RGB24 mode pixel set function

Source§

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

RGB24 mode pixel get function

Source§

fn clear(&mut self, p: &PixelRGB24)

RGB24 mode buffer clear function

Source§

fn size(&self) -> (usize, usize)

Fetch the buffer size in pixels

Source§

impl<'a> Buff<bool> for Buffer<'a, PixelBW>

Source§

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

Black and white mode pixel set function

Source§

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

Black and white mode pixel get function

Source§

fn clear(&mut self, p: &PixelBW)

Black and White mode buffer clear function

Source§

fn size(&self) -> (usize, usize)

Fetch the buffer size in pixels

Source§

impl<'a, Pixel: Debug> Debug for Buffer<'a, Pixel>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, Pixel> Display for Buffer<'a, Pixel>

Format implementation for the buffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Pixel> Freeze for Buffer<'a, Pixel>

§

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

§

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

§

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

§

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

§

impl<'a, Pixel> !UnwindSafe for Buffer<'a, Pixel>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.