From 9ab67384e7bb2e0b8bc3912dea1c4911f6d7425e Mon Sep 17 00:00:00 2001 From: Ralf Fuest Date: Thu, 26 Jun 2025 17:08:51 +0200 Subject: [PATCH] Update embedded-graphics to latest GIT version --- Cargo.toml | 4 ++++ src/raw_bmp.rs | 14 +++++++------- src/raw_iter.rs | 10 +++++----- tests/logo.rs | 6 +++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4a58f57..e14194e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,3 +33,7 @@ embedded-graphics = "0.8.0" clap = { version = "3.1.6", features = ["derive"] } criterion = "0.3.5" embedded-graphics-simulator = { version = "0.5.0", default-features = false } + +[patch.crates-io] +embedded-graphics = { git = "https://github.com/embedded-graphics/embedded-graphics.git" } +embedded-graphics-simulator = { git = "https://github.com/embedded-graphics/simulator.git" } diff --git a/src/raw_bmp.rs b/src/raw_bmp.rs index d61685f..af0e52e 100644 --- a/src/raw_bmp.rs +++ b/src/raw_bmp.rs @@ -1,7 +1,7 @@ use embedded_graphics::{ geometry::Point, iterator::raw::RawDataSlice, - pixelcolor::raw::{LittleEndian, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8}, + pixelcolor::raw::{LittleEndianMsb0, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8}, prelude::RawData, }; @@ -137,27 +137,27 @@ impl<'a> RawBmp<'a> { }?; match self.header.bpp { - Bpp::Bits1 => RawDataSlice::::new(row) + Bpp::Bits1 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| u32::from(raw.into_inner())), - Bpp::Bits4 => RawDataSlice::::new(row) + Bpp::Bits4 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| u32::from(raw.into_inner())), - Bpp::Bits8 => RawDataSlice::::new(row) + Bpp::Bits8 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| u32::from(raw.into_inner())), - Bpp::Bits16 => RawDataSlice::::new(row) + Bpp::Bits16 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| u32::from(raw.into_inner())), - Bpp::Bits24 => RawDataSlice::::new(row) + Bpp::Bits24 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| raw.into_inner()), - Bpp::Bits32 => RawDataSlice::::new(row) + Bpp::Bits32 => RawDataSlice::::new(row) .into_iter() .nth(p.x as usize) .map(|raw| raw.into_inner()), diff --git a/src/raw_iter.rs b/src/raw_iter.rs index de572b7..b502325 100644 --- a/src/raw_iter.rs +++ b/src/raw_iter.rs @@ -2,7 +2,7 @@ use core::{iter, slice}; use embedded_graphics::{ iterator::raw::RawDataSlice, - pixelcolor::raw::{LittleEndian, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8}, + pixelcolor::raw::{LittleEndianMsb0, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8}, prelude::*, primitives::{rectangle, Rectangle}, }; @@ -16,17 +16,17 @@ use crate::{ #[allow(missing_debug_implementations)] pub struct RawColors<'a, R> where - RawDataSlice<'a, R, LittleEndian>: IntoIterator, + RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator, { rows: slice::ChunksExact<'a, u8>, row_order: RowOrder, - current_row: iter::Take< as IntoIterator>::IntoIter>, + current_row: iter::Take< as IntoIterator>::IntoIter>, width: usize, } impl<'a, R> RawColors<'a, R> where - RawDataSlice<'a, R, LittleEndian>: IntoIterator, + RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator, { pub(crate) fn new(raw_bmp: &'a RawBmp<'a>) -> Self { let header = raw_bmp.header(); @@ -44,7 +44,7 @@ where impl<'a, R> Iterator for RawColors<'a, R> where - RawDataSlice<'a, R, LittleEndian>: IntoIterator, + RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator, { type Item = R; diff --git a/tests/logo.rs b/tests/logo.rs index b748cce..1945f85 100644 --- a/tests/logo.rs +++ b/tests/logo.rs @@ -1,7 +1,7 @@ use embedded_graphics::{ image::{GetPixel, Image, ImageRaw}, iterator::raw::RawDataSlice, - pixelcolor::{raw::LittleEndian, Bgr888, Rgb555, Rgb565, Rgb888}, + pixelcolor::{raw::LittleEndianMsb0, Bgr888, Rgb555, Rgb565, Rgb888}, prelude::*, }; use tinybmp::Bmp; @@ -85,9 +85,9 @@ impl OriginDimensions for Framebuffer { fn draw_raw(data: &[u8]) -> Framebuffer where C: PixelColor + From + From + std::fmt::Debug, - for<'a> RawDataSlice<'a, C::Raw, LittleEndian>: IntoIterator, + for<'a> RawDataSlice<'a, C::Raw, LittleEndianMsb0>: IntoIterator, { - let raw = ImageRaw::::new(data, 240); + let raw = ImageRaw::::new(data, Size::new(240, 320)).unwrap(); Framebuffer::from_image(raw) }