pub struct BufferedLcd<L: Lcd> { /* private fields */ }Expand description
Implements buffering for a backing slow LCD L that renders text with the font F.
All drawing operations are saved to a memory-backed framebuffer. If syncing is enabled, drawing primitives are flushed right away to the device; otherwise, they are applied to memory only until an explicit sync is requested. The framebuffer is also used to implement all pixel data reading.
Implementations§
Trait Implementations§
Source§impl<L> Drop for BufferedLcd<L>where
L: Lcd,
impl<L> Drop for BufferedLcd<L>where
L: Lcd,
Source§impl<L> RasterOps for BufferedLcd<L>where
L: Lcd,
impl<L> RasterOps for BufferedLcd<L>where
L: Lcd,
Source§fn get_info(&self) -> RasterInfo
fn get_info(&self) -> RasterInfo
Queries information about the backend.
Source§fn set_draw_color(&mut self, color: RGB)
fn set_draw_color(&mut self, color: RGB)
Sets the drawing color for subsequent operations.
Source§fn set_sync(&mut self, enabled: bool)
fn set_sync(&mut self, enabled: bool)
Sets whether automatic presentation of the canvas is enabled or not. Read more
Source§fn present_canvas(&mut self) -> Result<()>
fn present_canvas(&mut self) -> Result<()>
Displays any buffered changes to the console. Read more
Source§fn read_pixels(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<Self::ID>
fn read_pixels(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<Self::ID>
Reads the raw pixel data for the rectangular region specified by
xy and size.Source§fn put_pixels(&mut self, xy: PixelsXY, (pixels, size): &Self::ID) -> Result<()>
fn put_pixels(&mut self, xy: PixelsXY, (pixels, size): &Self::ID) -> Result<()>
Restores the rectangular region stored in
data at the xy coordinates.Source§fn move_pixels(
&mut self,
x1y1: PixelsXY,
x2y2: PixelsXY,
size: SizeInPixels,
) -> Result<()>
fn move_pixels( &mut self, x1y1: PixelsXY, x2y2: PixelsXY, size: SizeInPixels, ) -> Result<()>
Moves the rectangular region specified by
x1y1 and size to x2y2. The original region
is erased with the current drawing color.Source§fn write_text(&mut self, xy: PixelsXY, text: &str) -> Result<()>
fn write_text(&mut self, xy: PixelsXY, text: &str) -> Result<()>
Writes
text starting at xy with the current drawing color.Source§fn draw_circle(&mut self, center: PixelsXY, radius: u16) -> Result<()>
fn draw_circle(&mut self, center: PixelsXY, radius: u16) -> Result<()>
Draws the outline of a circle at
center with radius using the current drawing color.Source§fn draw_circle_filled(&mut self, center: PixelsXY, radius: u16) -> Result<()>
fn draw_circle_filled(&mut self, center: PixelsXY, radius: u16) -> Result<()>
Draws a filled circle at
center with radius using the current drawing color.Source§fn draw_line(&mut self, x1y1: PixelsXY, x2y2: PixelsXY) -> Result<()>
fn draw_line(&mut self, x1y1: PixelsXY, x2y2: PixelsXY) -> Result<()>
Draws a line from
x1y1 to x2y2 using the current drawing color.Source§fn draw_pixel(&mut self, xy: PixelsXY) -> Result<()>
fn draw_pixel(&mut self, xy: PixelsXY) -> Result<()>
Draws a single pixel at
xy using the current drawing color.Source§fn draw_rect(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<()>
fn draw_rect(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<()>
Draws the outline of a rectangle from
x1y1 to x2y2 using the current drawing color.Source§fn draw_rect_filled(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<()>
fn draw_rect_filled(&mut self, xy: PixelsXY, size: SizeInPixels) -> Result<()>
Draws a filled rectangle from
x1y1 to x2y2 using the current drawing color.Auto Trait Implementations§
impl<L> Freeze for BufferedLcd<L>
impl<L> RefUnwindSafe for BufferedLcd<L>
impl<L> Send for BufferedLcd<L>
impl<L> Sync for BufferedLcd<L>
impl<L> Unpin for BufferedLcd<L>
impl<L> UnsafeUnpin for BufferedLcd<L>
impl<L> UnwindSafe for BufferedLcd<L>
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