From 2167abcf72d978b4ac2f08fa7cbbddaada01f165 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 7 Mar 2023 08:00:00 +0100 Subject: a --- lvc/src/lib.rs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lvc/src/lib.rs (limited to 'lvc/src/lib.rs') 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, +} + +pub struct View { + pub a: P2, + pub b: P2, +} + +#[derive(Debug, Clone)] +pub enum Block { + Lit(Vec), + Split([Box; 2]), + Ref(Ref), +} + +#[derive(Debug, Clone, Default)] +pub struct Ref { + pub pos_off: P2, + pub color_off: Pixel, +} -- cgit v1.2.3-70-g09d2