[−][src]Struct raqote_display::RaqoteDisplay
This display is based on raqote's DrawTarget
and is used as draw target for the embedded graphics crate.
Example
use RaqoteDisplay_display::prelude::*; use embedded_graphics::{ image::{Image, ImageRaw, ImageRawLE}, pixelcolor::Rgb565, prelude::*, primitives::rectangle::Rectangle, style::PrimitiveStyleBuilder, }; let mut display = RaqoteDisplay::new(160, 128).unwrap(); let style = PrimitiveStyleBuilder::new().fill_color(Rgb565::BLACK).build(); let black_backdrop = Rectangle::new(Point::new(0, 0), Point::new(160, 128)).into_styled(style); black_backdrop.draw(&mut display).unwrap(); // draw ferris let image_raw: ImageRawLE<Rgb565> = ImageRaw::new(include_bytes!("../../../assets/ferris.raw"), 86, 64); let image: Image<_, Rgb565> = Image::new(&image_raw, Point::new(34, 8)); image.draw(&mut display).unwrap();
Implementations
impl RaqoteDisplay
[src]
pub fn new(width: u32, height: u32) -> Result<Self, String>
[src]
Creates a new display display with the given size.
pub fn data(&self) -> &[u32]
[src]
pub fn flip(&mut self, surface: &mut [u32])
[src]
Pushes the frame buffer to the given surface and clears the frame buffer.
Trait Implementations
impl DrawTarget<Rgb565> for RaqoteDisplay
[src]
type Error = String
Error type to return when a drawing operation fails. Read more
fn draw_pixel(&mut self, pixel: Pixel<Rgb565>) -> Result<(), Self::Error>
[src]
fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Line, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Circle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
fn draw_image<'a, 'b, I>(
&mut self,
item: &'a Image<'b, I, Rgb565>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<Rgb565>,
I: ImageDimensions,
[src]
&mut self,
item: &'a Image<'b, I, Rgb565>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<Rgb565>,
I: ImageDimensions,
fn size(&self) -> Size
[src]
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<C>>,
[src]
T: IntoIterator<Item = Pixel<C>>,
fn clear(&mut self, color: C) -> Result<(), Self::Error>
[src]
fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
Auto Trait Implementations
impl !RefUnwindSafe for RaqoteDisplay
impl !Send for RaqoteDisplay
impl !Sync for RaqoteDisplay
impl Unpin for RaqoteDisplay
impl UnwindSafe for RaqoteDisplay
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,