aboutsummaryrefslogtreecommitdiff
path: root/lvc/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lvc/src/lib.rs')
-rw-r--r--lvc/src/lib.rs44
1 files changed, 44 insertions, 0 deletions
diff --git a/lvc/src/lib.rs b/lvc/src/lib.rs
new file mode 100644
index 0000000..ad284df
--- /dev/null
+++ b/lvc/src/lib.rs
@@ -0,0 +1,44 @@
+#![feature(portable_simd)]
+
+pub mod diff;
+pub mod encode;
+pub mod impls;
+
+pub type PixelValue = u8;
+
+#[repr(C, align(2))]
+#[derive(Debug, Clone, Copy, Default)]
+pub struct Pixel {
+ pub r: PixelValue,
+ pub g: PixelValue,
+ pub b: PixelValue,
+}
+
+#[derive(Debug, Clone, Copy, Default)]
+pub struct P2 {
+ pub x: i32,
+ pub y: i32,
+}
+
+pub struct Frame {
+ pub size: P2,
+ pub pixels: Vec<Pixel>,
+}
+
+pub struct View {
+ pub a: P2,
+ pub b: P2,
+}
+
+#[derive(Debug, Clone)]
+pub enum Block {
+ Lit(Vec<Pixel>),
+ Split([Box<Block>; 2]),
+ Ref(Ref),
+}
+
+#[derive(Debug, Clone, Default)]
+pub struct Ref {
+ pub pos_off: P2,
+ pub color_off: Pixel,
+}