(&mut self, pixels: I)
| 54 | type Error = core::convert::Infallible; |
| 55 | |
| 56 | fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error> |
| 57 | where |
| 58 | I: IntoIterator<Item = embedded_graphics::Pixel<Self::Color>>, |
| 59 | { |
| 60 | pixels.into_iter().for_each(|px| { |
| 61 | let idx = ((self.point.y + px.0.y) * VIRTGPU_XRES as i32 + self.point.x + px.0.x) |
| 62 | as usize |
| 63 | * 4; |
| 64 | if idx + 2 >= self.fb.len() { |
| 65 | return; |
| 66 | } |
| 67 | self.fb[idx] = px.1.b(); |
| 68 | self.fb[idx + 1] = px.1.g(); |
| 69 | self.fb[idx + 2] = px.1.r(); |
| 70 | }); |
| 71 | framebuffer_flush(); |
| 72 | Ok(()) |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | pub struct DrawingBoard { |
nothing calls this directly
no test coverage detected