diff options
Diffstat (limited to 'mtree-test')
-rw-r--r-- | mtree-test/Cargo.toml | 8 | ||||
-rw-r--r-- | mtree-test/src/bin/decode.rs | 24 | ||||
-rw-r--r-- | mtree-test/src/bin/encode.rs | 24 | ||||
-rw-r--r-- | mtree-test/src/lib.rs | 0 |
4 files changed, 56 insertions, 0 deletions
diff --git a/mtree-test/Cargo.toml b/mtree-test/Cargo.toml new file mode 100644 index 0000000..5dbe38c --- /dev/null +++ b/mtree-test/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "mtree-test" +version = "0.1.0" +edition = "2024" + +[dependencies] +framework = { path = "../framework" } +glam = "0.30.3" diff --git a/mtree-test/src/bin/decode.rs b/mtree-test/src/bin/decode.rs new file mode 100644 index 0000000..6ff2cb3 --- /dev/null +++ b/mtree-test/src/bin/decode.rs @@ -0,0 +1,24 @@ +use framework::{BitstreamFilter, bitstream_filter_main}; +use glam::{I16Vec2, i16vec2}; +use std::io::Result; + +fn main() -> Result<()> { + bitstream_filter_main::<Dec>() +} + +struct Dec { + res: I16Vec2, +} +impl BitstreamFilter for Dec { + const INPUT_CODEC_ID: &str = "V_VCEMTREE"; + const OUTPUT_CODEC_ID: &str = "V_UNCOMPRESSED"; + + fn new(width: u32, height: u32) -> Self { + Self { + res: i16vec2(width as i16, height as i16), + } + } + fn process_block(&mut self, a: Vec<u8>) -> Vec<u8> { + a + } +} diff --git a/mtree-test/src/bin/encode.rs b/mtree-test/src/bin/encode.rs new file mode 100644 index 0000000..f85e4c0 --- /dev/null +++ b/mtree-test/src/bin/encode.rs @@ -0,0 +1,24 @@ +use framework::{BitstreamFilter, bitstream_filter_main}; +use glam::{I16Vec2, i16vec2}; +use std::io::Result; + +fn main() -> Result<()> { + bitstream_filter_main::<Enc>() +} + +struct Enc { + res: I16Vec2, +} +impl BitstreamFilter for Enc { + const INPUT_CODEC_ID: &str = "V_UNCOMPRESSED"; + const OUTPUT_CODEC_ID: &str = "V_VCEMTREE"; + + fn new(width: u32, height: u32) -> Self { + Self { + res: i16vec2(width as i16, height as i16), + } + } + fn process_block(&mut self, a: Vec<u8>) -> Vec<u8> { + a + } +} diff --git a/mtree-test/src/lib.rs b/mtree-test/src/lib.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/mtree-test/src/lib.rs |