diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-05 21:22:00 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-05 21:22:00 +0100 |
commit | 8e4ec0943973b96addbe01f4c02f91cf04d081a7 (patch) | |
tree | 0773eb5048703adae45538050ab3dffad29b01da /evc/src/frame.rs | |
parent | 96e316ea16b7b915e02735457d5ac7495d3db305 (diff) | |
download | video-codec-experiments-8e4ec0943973b96addbe01f4c02f91cf04d081a7.tar video-codec-experiments-8e4ec0943973b96addbe01f4c02f91cf04d081a7.tar.bz2 video-codec-experiments-8e4ec0943973b96addbe01f4c02f91cf04d081a7.tar.zst |
more code
Diffstat (limited to 'evc/src/frame.rs')
-rw-r--r-- | evc/src/frame.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/evc/src/frame.rs b/evc/src/frame.rs new file mode 100644 index 0000000..8e90832 --- /dev/null +++ b/evc/src/frame.rs @@ -0,0 +1,18 @@ +use crate::pixel::Pixel; + + +pub struct Frame { + size: (usize, usize), + buffer: Vec<Vec<Pixel>>, +} + +impl Frame { + pub fn new(size: (usize, usize)) -> Self { + Self { + size, + buffer: (0..size.0) + .map(|_| (0..size.1).map(|_| Pixel::default()).collect()) + .collect(), + } + } +} |