pub struct SimpleFrameBuffer { /* private fields */ }Implementations§
Trait Implementations§
Source§impl FrameBuffer for SimpleFrameBuffer
impl FrameBuffer for SimpleFrameBuffer
fn get_width(&self) -> usize
fn get_height(&self) -> usize
fn set(&self, x: usize, y: usize, rgba: u32)
Source§fn set_multi_from_start_index(
&self,
starting_index: usize,
pixels: &[u8],
) -> usize
fn set_multi_from_start_index( &self, starting_index: usize, pixels: &[u8], ) -> usize
Returns the number of pixels copied
fn as_bytes(&self) -> &[u8] ⓘ
fn as_pixels(&self) -> &[u32]
fn get_size(&self) -> usize
fn get(&self, x: usize, y: usize) -> Option<u32>
Source§fn set_multi(
&self,
start_x: usize,
start_y: usize,
pixels: &[u8],
) -> (usize, usize)
fn set_multi( &self, start_x: usize, start_y: usize, pixels: &[u8], ) -> (usize, usize)
We can not take an
&[u32] for the pixel here, as std::slice::from_raw_parts requires the data to be
aligned. As the data already is stored in a buffer we can not guarantee it’s correctly aligned, so let’s just
treat the pixels as raw bytes. Read moreAuto Trait Implementations§
impl Freeze for SimpleFrameBuffer
impl RefUnwindSafe for SimpleFrameBuffer
impl Send for SimpleFrameBuffer
impl Sync for SimpleFrameBuffer
impl Unpin for SimpleFrameBuffer
impl UnwindSafe for SimpleFrameBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more