aboutsummaryrefslogtreecommitdiff
path: root/lvc/src/impls.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-03-08 21:26:35 +0100
committermetamuffin <metamuffin@disroot.org>2023-03-08 21:26:35 +0100
commit292519649c4244adb6672488efe7c2e906726c58 (patch)
tree41e2cd62d53b47afa7995d91a326ef2e361029c7 /lvc/src/impls.rs
parent5b3c03bc0cfcf89e76953dde13ed58a39b5d1dd0 (diff)
downloadvideo-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.rs9
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]