aboutsummaryrefslogtreecommitdiff
path: root/evc/src/header.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-12-07 17:55:27 +0100
committermetamuffin <metamuffin@disroot.org>2022-12-07 17:55:27 +0100
commit8ca219c6b0d5448fd4529713ccd093e89de4e252 (patch)
tree8fe02fd35ae337766d6f8e7533da170830162d14 /evc/src/header.rs
parenta99674b911cb9b2fa398ccf61830d5933ccaf931 (diff)
downloadvideo-codec-experiments-8ca219c6b0d5448fd4529713ccd093e89de4e252.tar
video-codec-experiments-8ca219c6b0d5448fd4529713ccd093e89de4e252.tar.bz2
video-codec-experiments-8ca219c6b0d5448fd4529713ccd093e89de4e252.tar.zst
refactor
Diffstat (limited to 'evc/src/header.rs')
-rw-r--r--evc/src/header.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/evc/src/header.rs b/evc/src/header.rs
deleted file mode 100644
index 4c9118e..0000000
--- a/evc/src/header.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-use crate::{
- helpers::vector::Vec2,
- ser::{Ser, Sink, Source},
-};
-
-#[derive(Debug, Clone, PartialEq, Copy)]
-pub struct Header {
- pub resolution: Vec2<isize>,
- pub frame_count: usize,
-}
-
-pub const MAGIC: [u8; 4] = [0x5eu8, 0xb1u8, 0xc3u8, 0x08u8];
-
-impl Ser for Header {
- fn write(&self, sink: &mut impl std::io::Write) -> anyhow::Result<()> {
- sink.put(MAGIC)?;
- sink.put((self.resolution, self.frame_count))?;
- Ok(())
- }
-
- fn read(source: &mut impl std::io::Read) -> anyhow::Result<Self> {
- assert_eq!(source.get::<[u8; 4]>()?, MAGIC);
- let (resolution, frame_count) = source.get()?;
- Ok(Self {
- resolution,
- frame_count,
- })
- }
-}