diff --git a/images/hi.qoi b/images/hi.qoi index 21ac898..3e5e4f0 100644 Binary files a/images/hi.qoi and b/images/hi.qoi differ diff --git a/src/qoi.rs b/src/qoi.rs index bb776c6..b84fc77 100644 --- a/src/qoi.rs +++ b/src/qoi.rs @@ -14,7 +14,7 @@ use crate::{ }; // https://qoiformat.org/qoi-specification.pdf -const image: &[u8; 852] = include_bytes!("../images/sheep.qoi"); +const image: &[u8; 1253] = include_bytes!("../images/hi.qoi"); const BUFFER_SIZE: usize = 64; #[derive(Debug, uDebug)] @@ -73,7 +73,6 @@ pub fn draw_image( // colors[i * 2 + 1] = c2; // } // display.write(Writeable::Data(&colors)); - // display.delay.delay_ms(100); // } let mut counter = 0u32; for pixel in qoi_iter { @@ -118,7 +117,7 @@ impl<'a> QoiIterator<'a> { QoiIterator { inner: bytes, serial, - prev_pixels: [Rgb565(255, 255, 255); 64], + prev_pixels: [Rgb565(0, 255, 0); 64], prev_alphas: [255; 64], last_pixel: Rgb565(0, 0, 0), last_alpha: 255, @@ -134,6 +133,7 @@ impl<'a> Iterator for QoiIterator<'a> { fn next(&mut self) -> Option { if self.parsed_colors >= self.expected_colors { + ufmt::uwriteln!(self.serial, "Reached expected").unwrap(); return None; } self.parsed_colors += 1; @@ -245,6 +245,7 @@ impl<'a> Iterator for QoiIterator<'a> { self.prev_pixels[hash] = color; Some(color) } else { + ufmt::uwriteln!(self.serial, "End reached").unwrap(); None } }