rustzx_core/host/
frame_buffer.rs

1use crate::zx::video::colors::{ZXBrightness, ZXColor};
2
3pub enum FrameBufferSource {
4    Screen,
5    Border,
6}
7
8pub trait FrameBuffer {
9    type Context: Clone;
10    /// Creates canvas size with required dimensions (`width`, `height`)
11    fn new(width: usize, height: usize, source: FrameBufferSource, context: Self::Context) -> Self;
12    /// Set `color` with `brightness` for pixel on canvas at (`x`, `y`)
13    fn set_color(&mut self, x: usize, y: usize, color: ZXColor, brightness: ZXBrightness);
14}