about summary refs log tree commit diff
path: root/src/block/screendescriptor.rs
diff options
context:
space:
mode:
authorGenny <gen@nyble.dev>2021-09-23 20:33:50 -0500
committerGenny <gen@nyble.dev>2021-09-23 20:33:50 -0500
commit637441239434fabedfe83f5abc1af4232c802f7a (patch)
treedbc84cd1a31686077fc046fd42d223f1ca08f890 /src/block/screendescriptor.rs
parent7b8081a79fb3db4a76f9e4cca8f8a88e6e7f873c (diff)
downloadgifed-637441239434fabedfe83f5abc1af4232c802f7a.tar.gz
gifed-637441239434fabedfe83f5abc1af4232c802f7a.zip
Improve API, monocommit, sorry
Diffstat (limited to 'src/block/screendescriptor.rs')
-rw-r--r--src/block/screendescriptor.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/block/screendescriptor.rs b/src/block/screendescriptor.rs
index ff70896..444b44f 100644
--- a/src/block/screendescriptor.rs
+++ b/src/block/screendescriptor.rs
@@ -9,6 +9,16 @@ pub struct ScreenDescriptor {
 }
 
 impl ScreenDescriptor {
+    pub fn new(width: u16, height: u16) -> Self {
+        Self {
+            width,
+            height,
+            packed: 0,
+            background_color_index: 0,
+            pixel_aspect_ratio: 0,
+        }
+    }
+
     pub fn set_color_table_present(&mut self, is_present: bool) {
         if is_present {
             self.packed |= 0b1000_0000;