From b31d6255bf13f790a6e8b7beb542ca7cf8ae1170 Mon Sep 17 00:00:00 2001 From: Sofia Date: Fri, 12 Sep 2025 14:23:14 +0300 Subject: [PATCH] Try to debug hi.qoi --- images/hi.qoi | Bin 744 -> 1253 bytes src/qoi.rs | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/images/hi.qoi b/images/hi.qoi index 21ac898ae98ae1ee0628d2658418da2f321a74f3..3e5e4f0c707fa827327d3377620f39bc0f30f879 100644 GIT binary patch literal 1253 zcmbu9O>Wdc5QPVEm%c$Cg)1Osh1jvBzd`~DS>pS;<9Ngj zD@G}G_j^^<^{UHx{OIiAYPEWz-CsSJPW^74)?xY(tFVrB=&*D4(@KjcES4Y05^Dxjj;=F;q_0PEykkc25OPBuD`i$+`!cV zmzw1qGsTci_bR-Z={{3t)U4|Dzo-PIx{9n_*sxl>SuJAW>aYjffSJ;pP1&&4*q;5& zmAF$}5o(;`jPqX0^IjX&#)OK}82LIj`HoUkA}-|y&GD4n#BHc>9pga14b_HQe1sdq z=Zx7EeMi!6!cS6Pv7dT!PCxKCH9N=HGakTlr&k24KTp$D+-Ff9+I)Kxeo>vx;xEM= zmu?AEU&=8(xUV>K4T(PzzTj2ZQDkmGp_~)7Du2gn>zcR@pV*hdF0GZ*$M$|>UAVdB z6?vLF-fv*`Z|KdMIG@p3>~1-qBEk9eKGVXD;PzHI&adB;ZLv1rp+nLbZaDi9Ww@jv zV~5B4L#E7G1=JC!uoi&|xxk!!lYh@ya#SF&sqzL8mFLt)An*Dvu%rD(tUoE>|rk~p}O z`m=tSt(D_8sLkKs? z(FSgW4UIC_iXXUEpR<*?(Rt66_$4m&h_gP3wwvl9|1V=t@v37Sdx%d3ek_iy?mcQS iMhl@ne9m~vG!907==-DwS`vo%Q!F;I{=M`yzRd>!v14EW 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 } }