diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-17 18:05:23 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-17 18:05:23 +0100 |
commit | a7335ae0f8c04c8042f47a56f3845d2e5fc5c452 (patch) | |
tree | 96a1d2a1d674547e46c15cf93019c43a37553e06 | |
parent | 0a346b8372140b56bf65a6df1c00e2cd6c6cdf86 (diff) | |
download | video-codec-experiments-a7335ae0f8c04c8042f47a56f3845d2e5fc5c452.tar video-codec-experiments-a7335ae0f8c04c8042f47a56f3845d2e5fc5c452.tar.bz2 video-codec-experiments-a7335ae0f8c04c8042f47a56f3845d2e5fc5c452.tar.zst |
specify/swap literal block layout
-rw-r--r-- | evc/spec.md | 2 | ||||
-rw-r--r-- | evc/src/view.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/evc/spec.md b/evc/spec.md index f35128d..42be71f 100644 --- a/evc/spec.md +++ b/evc/spec.md @@ -37,7 +37,7 @@ _**JPEG? just DCT? idk**_ - block kind: _`u8` (see tags below)_ - block: _one of the following_ - 0 **Literal-Block** - - pixels: _`[[u8; 3]; (inferred)]`_ + - pixels: _`[[u8; 3]; (inferred)]`_ (stored line-by-line) - 1 **Compressed-Literal-Block** - length: _`u32`_ - data: _`[[u8; length]`_ diff --git a/evc/src/view.rs b/evc/src/view.rs index 5868680..f153597 100644 --- a/evc/src/view.rs +++ b/evc/src/view.rs @@ -160,8 +160,8 @@ impl<T: Index<Vec2<isize>, Output = Pixel>> View<&T> { pub fn pixels(&self) -> Vec<Pixel> { let mut v = vec![]; - for x in 0..self.size.x { - for y in 0..self.size.y { + for y in 0..self.size.y { + for x in 0..self.size.x { v.push(self[(x, y)]); } } @@ -185,8 +185,8 @@ impl View<&mut Frame> { } pub fn set_pixels(&mut self, pixels: &Vec<Pixel>) { - for x in 0..self.size.x { - for y in 0..self.size.y { + for y in 0..self.size.y { + for x in 0..self.size.x { self[(x, y)] = pixels[(x * self.size.y + y) as usize] } } |