aboutsummaryrefslogtreecommitdiff
path: root/bv1/codec/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bv1/codec/src/lib.rs')
-rw-r--r--bv1/codec/src/lib.rs55
1 files changed, 55 insertions, 0 deletions
diff --git a/bv1/codec/src/lib.rs b/bv1/codec/src/lib.rs
new file mode 100644
index 0000000..c764211
--- /dev/null
+++ b/bv1/codec/src/lib.rs
@@ -0,0 +1,55 @@
+#![feature(portable_simd)]
+#![feature(io_error_other)]
+#![feature(box_syntax)]
+
+pub mod debug;
+pub mod decode;
+pub mod diff;
+pub mod encode;
+pub mod frameio;
+pub mod huff;
+pub mod impls;
+pub mod serialize;
+pub mod split;
+
+pub type PixelValue = i16;
+
+pub use decode::{decode, Decoder};
+pub use encode::encode;
+
+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
+pub struct Pixel {
+ pub r: PixelValue,
+ pub g: PixelValue,
+ pub b: PixelValue,
+}
+
+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
+pub struct P2 {
+ pub x: i32,
+ pub y: i32,
+}
+
+pub struct Frame {
+ pub size: P2,
+ pub pixels: Vec<Pixel>,
+}
+
+#[derive(Debug, Clone, Copy)]
+pub struct View {
+ pub a: P2,
+ pub b: P2,
+}
+
+#[derive(Debug, Clone)]
+pub enum Block {
+ Split(Box<Block>, Box<Block>),
+ Lit(Vec<Pixel>),
+ Ref(Ref),
+}
+
+#[derive(Debug, Clone, Copy, Default)]
+pub struct Ref {
+ pub pos_off: P2,
+ pub color_off: Pixel,
+}