Skip to content

Commit 9ab6738

Browse files
committed
Update embedded-graphics to latest GIT version
1 parent 2c67eec commit 9ab6738

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ embedded-graphics = "0.8.0"
3333
clap = { version = "3.1.6", features = ["derive"] }
3434
criterion = "0.3.5"
3535
embedded-graphics-simulator = { version = "0.5.0", default-features = false }
36+
37+
[patch.crates-io]
38+
embedded-graphics = { git = "https://github.com/embedded-graphics/embedded-graphics.git" }
39+
embedded-graphics-simulator = { git = "https://github.com/embedded-graphics/simulator.git" }

src/raw_bmp.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use embedded_graphics::{
22
geometry::Point,
33
iterator::raw::RawDataSlice,
4-
pixelcolor::raw::{LittleEndian, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8},
4+
pixelcolor::raw::{LittleEndianMsb0, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8},
55
prelude::RawData,
66
};
77

@@ -137,27 +137,27 @@ impl<'a> RawBmp<'a> {
137137
}?;
138138

139139
match self.header.bpp {
140-
Bpp::Bits1 => RawDataSlice::<RawU1, LittleEndian>::new(row)
140+
Bpp::Bits1 => RawDataSlice::<RawU1, LittleEndianMsb0>::new(row)
141141
.into_iter()
142142
.nth(p.x as usize)
143143
.map(|raw| u32::from(raw.into_inner())),
144-
Bpp::Bits4 => RawDataSlice::<RawU4, LittleEndian>::new(row)
144+
Bpp::Bits4 => RawDataSlice::<RawU4, LittleEndianMsb0>::new(row)
145145
.into_iter()
146146
.nth(p.x as usize)
147147
.map(|raw| u32::from(raw.into_inner())),
148-
Bpp::Bits8 => RawDataSlice::<RawU8, LittleEndian>::new(row)
148+
Bpp::Bits8 => RawDataSlice::<RawU8, LittleEndianMsb0>::new(row)
149149
.into_iter()
150150
.nth(p.x as usize)
151151
.map(|raw| u32::from(raw.into_inner())),
152-
Bpp::Bits16 => RawDataSlice::<RawU16, LittleEndian>::new(row)
152+
Bpp::Bits16 => RawDataSlice::<RawU16, LittleEndianMsb0>::new(row)
153153
.into_iter()
154154
.nth(p.x as usize)
155155
.map(|raw| u32::from(raw.into_inner())),
156-
Bpp::Bits24 => RawDataSlice::<RawU24, LittleEndian>::new(row)
156+
Bpp::Bits24 => RawDataSlice::<RawU24, LittleEndianMsb0>::new(row)
157157
.into_iter()
158158
.nth(p.x as usize)
159159
.map(|raw| raw.into_inner()),
160-
Bpp::Bits32 => RawDataSlice::<RawU32, LittleEndian>::new(row)
160+
Bpp::Bits32 => RawDataSlice::<RawU32, LittleEndianMsb0>::new(row)
161161
.into_iter()
162162
.nth(p.x as usize)
163163
.map(|raw| raw.into_inner()),

src/raw_iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::{iter, slice};
22

33
use embedded_graphics::{
44
iterator::raw::RawDataSlice,
5-
pixelcolor::raw::{LittleEndian, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8},
5+
pixelcolor::raw::{LittleEndianMsb0, RawU1, RawU16, RawU24, RawU32, RawU4, RawU8},
66
prelude::*,
77
primitives::{rectangle, Rectangle},
88
};
@@ -16,17 +16,17 @@ use crate::{
1616
#[allow(missing_debug_implementations)]
1717
pub struct RawColors<'a, R>
1818
where
19-
RawDataSlice<'a, R, LittleEndian>: IntoIterator<Item = R>,
19+
RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator<Item = R>,
2020
{
2121
rows: slice::ChunksExact<'a, u8>,
2222
row_order: RowOrder,
23-
current_row: iter::Take<<RawDataSlice<'a, R, LittleEndian> as IntoIterator>::IntoIter>,
23+
current_row: iter::Take<<RawDataSlice<'a, R, LittleEndianMsb0> as IntoIterator>::IntoIter>,
2424
width: usize,
2525
}
2626

2727
impl<'a, R> RawColors<'a, R>
2828
where
29-
RawDataSlice<'a, R, LittleEndian>: IntoIterator<Item = R>,
29+
RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator<Item = R>,
3030
{
3131
pub(crate) fn new(raw_bmp: &'a RawBmp<'a>) -> Self {
3232
let header = raw_bmp.header();
@@ -44,7 +44,7 @@ where
4444

4545
impl<'a, R> Iterator for RawColors<'a, R>
4646
where
47-
RawDataSlice<'a, R, LittleEndian>: IntoIterator<Item = R>,
47+
RawDataSlice<'a, R, LittleEndianMsb0>: IntoIterator<Item = R>,
4848
{
4949
type Item = R;
5050

tests/logo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use embedded_graphics::{
22
image::{GetPixel, Image, ImageRaw},
33
iterator::raw::RawDataSlice,
4-
pixelcolor::{raw::LittleEndian, Bgr888, Rgb555, Rgb565, Rgb888},
4+
pixelcolor::{raw::LittleEndianMsb0, Bgr888, Rgb555, Rgb565, Rgb888},
55
prelude::*,
66
};
77
use tinybmp::Bmp;
@@ -85,9 +85,9 @@ impl<C> OriginDimensions for Framebuffer<C> {
8585
fn draw_raw<C>(data: &[u8]) -> Framebuffer<C>
8686
where
8787
C: PixelColor + From<C::Raw> + From<Rgb888> + std::fmt::Debug,
88-
for<'a> RawDataSlice<'a, C::Raw, LittleEndian>: IntoIterator<Item = C::Raw>,
88+
for<'a> RawDataSlice<'a, C::Raw, LittleEndianMsb0>: IntoIterator<Item = C::Raw>,
8989
{
90-
let raw = ImageRaw::<C, LittleEndian>::new(data, 240);
90+
let raw = ImageRaw::<C, LittleEndianMsb0>::new(data, Size::new(240, 320)).unwrap();
9191

9292
Framebuffer::from_image(raw)
9393
}

0 commit comments

Comments
 (0)