@@ -22,7 +22,7 @@ const BUF_SIZE: usize = 96 * 64 * 2;
2222/// use embedded_graphics::{
2323/// fonts::{Font6x8, Text},
2424/// geometry::Point,
25- /// image::ImageLE ,
25+ /// image::{Image, ImageRawLE} ,
2626/// pixelcolor::Rgb565,
2727/// prelude::*,
2828/// primitives::{Circle, Line, Rectangle},
@@ -36,7 +36,9 @@ const BUF_SIZE: usize = 96 * 64 * 2;
3636/// let dc = Pin;
3737///
3838/// let mut display = Ssd1331::new(spi, dc, Rotate0);
39- /// let image = ImageLE::new(include_bytes!("../examples/ferris.raw"), 86, 64);
39+ /// let raw = ImageRawLE::new(include_bytes!("../examples/ferris.raw"), 86, 64);
40+ ///
41+ /// let image: Image<ImageRawLE<Rgb565>, Rgb565> = Image::new(&raw, Point::zero());
4042///
4143/// // Initialise and clear the display
4244/// display.init().unwrap();
@@ -369,20 +371,24 @@ where
369371 SPI : hal:: blocking:: spi:: Write < u8 > ,
370372 DC : OutputPin ,
371373{
372- fn draw_pixel ( & mut self , pixel : drawable:: Pixel < Rgb565 > ) {
374+ type Error = core:: convert:: Infallible ;
375+
376+ fn draw_pixel ( & mut self , pixel : drawable:: Pixel < Rgb565 > ) -> Result < ( ) , Self :: Error > {
373377 let drawable:: Pixel ( pos, color) = pixel;
374378
375379 // Guard against negative values. All positive i32 values from `pos` can be represented in
376380 // the `u32`s that `set_pixel()` accepts.
377381 if pos. x < 0 || pos. y < 0 {
378- return ;
382+ return Ok ( ( ) ) ;
379383 }
380384
381385 self . set_pixel (
382386 ( pos. x ) . try_into ( ) . unwrap ( ) ,
383387 ( pos. y ) . try_into ( ) . unwrap ( ) ,
384388 RawU16 :: from ( color) . into_inner ( ) ,
385389 ) ;
390+
391+ Ok ( ( ) )
386392 }
387393
388394 fn size ( & self ) -> Size {
0 commit comments