diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-07 17:16:40 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-07 17:16:40 +0100 |
commit | 85d20c4f4cf3656fbf7c27b6b8bbf9536e3ae04d (patch) | |
tree | 06497577894131a66f3f4874a9865da5b814fe17 /evc/src/block.rs | |
parent | a713143ef9c1187c37004043b1d3322d773f9ea0 (diff) | |
download | video-codec-experiments-85d20c4f4cf3656fbf7c27b6b8bbf9536e3ae04d.tar video-codec-experiments-85d20c4f4cf3656fbf7c27b6b8bbf9536e3ae04d.tar.bz2 video-codec-experiments-85d20c4f4cf3656fbf7c27b6b8bbf9536e3ae04d.tar.zst |
refactor, matrix math
Diffstat (limited to 'evc/src/block.rs')
-rw-r--r-- | evc/src/block.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/evc/src/block.rs b/evc/src/block.rs index 929793d..dd23207 100644 --- a/evc/src/block.rs +++ b/evc/src/block.rs @@ -3,14 +3,14 @@ use anyhow::bail; use crate::{ pixel::Pixel, ser::{Ser, Sink, Source}, - vec2::{Small, Vec2}, + helpers::vector::{Small, Vec2}, }; #[derive(Clone, Debug)] pub enum Block { Literal(Vec<Pixel>), Split(Box<[Block; 2]>), - Reference { translation: Vec2 }, + Reference { translation: Vec2<isize> }, } impl Block { @@ -33,7 +33,7 @@ impl Block { Ok(()) } - pub fn read(source: &mut impl std::io::Read, size: Vec2) -> anyhow::Result<Self> { + pub fn read(source: &mut impl std::io::Read, size: Vec2<isize>) -> anyhow::Result<Self> { Ok(match source.get::<u8>()? { 0 => Block::Literal(source.get()?), 1 => Block::Split(Box::new({ @@ -54,7 +54,7 @@ impl Block { [a, b] })), 2 => Block::Reference { - translation: source.get::<Small<Vec2>>()?.0, + translation: source.get::<Small<Vec2<isize>>>()?.0, }, x => bail!("corrupt block type ({})", x), }) |