Try to debug hi.qoi
This commit is contained in:
parent
7225591e7d
commit
b31d6255bf
BIN
images/hi.qoi
BIN
images/hi.qoi
Binary file not shown.
@ -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<T: DelayNs, DCPin: PinOps, RSTPin: PinOps>(
|
||||
// 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<Self::Item> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user