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