diff options
author | metamuffin <metamuffin@disroot.org> | 2023-03-08 21:26:35 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-03-08 21:26:35 +0100 |
commit | 292519649c4244adb6672488efe7c2e906726c58 (patch) | |
tree | 41e2cd62d53b47afa7995d91a326ef2e361029c7 /lvc/src/impls.rs | |
parent | 5b3c03bc0cfcf89e76953dde13ed58a39b5d1dd0 (diff) | |
download | video-codec-experiments-292519649c4244adb6672488efe7c2e906726c58.tar video-codec-experiments-292519649c4244adb6672488efe7c2e906726c58.tar.bz2 video-codec-experiments-292519649c4244adb6672488efe7c2e906726c58.tar.zst |
about to implement huff
Diffstat (limited to 'lvc/src/impls.rs')
-rw-r--r-- | lvc/src/impls.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lvc/src/impls.rs b/lvc/src/impls.rs index 04699c6..098db39 100644 --- a/lvc/src/impls.rs +++ b/lvc/src/impls.rs @@ -1,5 +1,5 @@ use crate::{Frame, Pixel, Ref, View, P2}; -use std::ops::{Add, Index, IndexMut, Sub}; +use std::ops::{Add, AddAssign, Index, IndexMut, Sub}; impl Frame { pub fn export(&self, view: View) -> Vec<Pixel> { @@ -18,6 +18,7 @@ impl Frame { source = &source[1..]; } } + assert_eq!(source.len(), 0) } pub fn new(size: P2) -> Self { Self { @@ -39,6 +40,12 @@ impl Pixel { pub const GREEN: Pixel = Pixel { r: 0, g: 255, b: 0 }; pub const BLUE: Pixel = Pixel { r: 0, g: 0, b: 255 }; } +impl AddAssign for P2 { + fn add_assign(&mut self, rhs: Self) { + self.x += rhs.x; + self.y += rhs.y; + } +} impl Add for Pixel { type Output = Pixel; #[inline] |