From a368be4dfb3c1f75f6bcfdc297fe0372fb5f6092 Mon Sep 17 00:00:00 2001 From: Genny Date: Mon, 8 Mar 2021 21:02:50 -0600 Subject: Rename a few things --- src/block/block.rs | 9 ++++ src/block/colortable.rs | 67 +++++++++++++++++++++++++ src/block/image.rs | 47 ++++++++++++++++++ src/block/imagedescriptor.rs | 45 +++++++++++++++++ src/block/mod.rs | 13 +++++ src/block/screendescriptor.rs | 40 +++++++++++++++ src/block/version.rs | 13 +++++ src/color.rs | 11 +++++ src/components/color.rs | 11 ----- src/components/colortable.rs | 67 ------------------------- src/components/gif.rs | 82 ------------------------------- src/components/image.rs | 47 ------------------ src/components/imagedescriptor.rs | 45 ----------------- src/components/logicalscreendescriptor.rs | 40 --------------- src/components/mod.rs | 15 ------ src/components/version.rs | 13 ----- src/gif.rs | 82 +++++++++++++++++++++++++++++++ src/lib.rs | 8 ++- src/writer/gifbuilder.rs | 9 ++-- src/writer/imagebuilder.rs | 2 +- 20 files changed, 339 insertions(+), 327 deletions(-) create mode 100644 src/block/block.rs create mode 100644 src/block/colortable.rs create mode 100644 src/block/image.rs create mode 100644 src/block/imagedescriptor.rs create mode 100644 src/block/mod.rs create mode 100644 src/block/screendescriptor.rs create mode 100644 src/block/version.rs create mode 100644 src/color.rs delete mode 100644 src/components/color.rs delete mode 100644 src/components/colortable.rs delete mode 100644 src/components/gif.rs delete mode 100644 src/components/image.rs delete mode 100644 src/components/imagedescriptor.rs delete mode 100644 src/components/logicalscreendescriptor.rs delete mode 100644 src/components/mod.rs delete mode 100644 src/components/version.rs create mode 100644 src/gif.rs diff --git a/src/block/block.rs b/src/block/block.rs new file mode 100644 index 0000000..95ff12e --- /dev/null +++ b/src/block/block.rs @@ -0,0 +1,9 @@ +use crate::block::Version; + +use super::ScreenDescriptor; + + +pub enum Block { + Version(Version), + LogicalScreenDescriptor(ScreenDescriptor) +} \ No newline at end of file diff --git a/src/block/colortable.rs b/src/block/colortable.rs new file mode 100644 index 0000000..97b428f --- /dev/null +++ b/src/block/colortable.rs @@ -0,0 +1,67 @@ +use std::ops::Deref; +pub use crate::Color; + +pub struct ColorTable { + table: Vec +} + +impl ColorTable { + pub fn new() -> Self { + Self { + table: vec![] + } + } + + /// Returns the number of colors in the color table as used by the packed + /// fields in the Logical Screen Descriptor and Image Descriptor. You can + /// get the actual size with the [`len`](struct.ColorTable.html#method.len) method. + pub fn packed_len(&self) -> u8 { + ((self.table.len() as f32).log2().ceil() - 1f32) as u8 + } + + /// Returns the number of items in the table + pub fn len(&self) -> usize { + self.table.len() + } + + /// Pushes a color on to the end of the table + pub fn push(&mut self, color: Color) { + self.table.push(color); + } +} + +impl Deref for ColorTable { + type Target = [Color]; + + fn deref(&self) -> &Self::Target { + &self.table + } +} + +impl From> for ColorTable { + fn from(table: Vec) -> Self{ + ColorTable { + table + } + } +} + +impl From<&ColorTable> for Box<[u8]> { + fn from(table: &ColorTable) -> Self { + let mut vec = vec![]; + + for color in table.iter() { + vec.extend_from_slice(&[color.r, color.g, color.b]); + } + + let packed_len = 2u8.pow(table.packed_len() as u32 + 1); + let padding = (packed_len as usize - table.len()) * 3; + if padding > 0 { + vec.extend_from_slice(&vec![0; padding]); + } + + vec.into_boxed_slice() + } +} + +//TODO: TryFrom Vec (must be multiple of 3 len) and From Vec \ No newline at end of file diff --git a/src/block/image.rs b/src/block/image.rs new file mode 100644 index 0000000..07f9555 --- /dev/null +++ b/src/block/image.rs @@ -0,0 +1,47 @@ +use crate::LZW; +use super::{ColorTable, ImageDescriptor}; + +pub struct Image { + pub image_descriptor: ImageDescriptor, + pub local_color_table: Option, + pub indicies: Vec +} + +impl Image { + pub fn as_boxed_slice(&self, minimum_code_size: u8) -> Box<[u8]> { + let mut out = vec![]; + + let mut boxed: Box<[u8]> = (&self.image_descriptor).into(); + out.extend_from_slice(&*boxed); + + // Table based image data // + + // Get the mcs while we write out the color table + let mut mcs = if let Some(lct) = &self.local_color_table { + boxed = lct.into(); + out.extend_from_slice(&*boxed); + + lct.packed_len() + } else { + minimum_code_size + }; + + if mcs < 2 { + mcs = 2; // Must be true: 0 <= mcs <= 8 + } + + // First write out the MCS + out.push(mcs); + + let compressed = LZW::encode(mcs, &self.indicies); + + for chunk in compressed.chunks(255) { + out.push(chunk.len() as u8); + out.extend_from_slice(chunk); + } + // Data block length 0 to indicate an end + out.push(0x00); + + out.into_boxed_slice() + } +} \ No newline at end of file diff --git a/src/block/imagedescriptor.rs b/src/block/imagedescriptor.rs new file mode 100644 index 0000000..c911baa --- /dev/null +++ b/src/block/imagedescriptor.rs @@ -0,0 +1,45 @@ +pub struct ImageDescriptor { + // Image Seperator 0x2C is the first byte // + pub left: u16, + pub top: u16, + pub width: u16, + pub height: u16, + pub packed: u8 +} + +impl ImageDescriptor { + pub fn color_table_present(&mut self, is_present: bool) { + if is_present { + self.packed |= 0b1000_0000; + } else { + self.packed &= 0b0111_1111; + } + } + + pub fn color_table_size(&mut self, size: u8) { + // GCT size is calulated by raising two to this number plus one, + // so we have to work backwards. + let size = (size as f32).log2().ceil() - 1f32; + self.packed |= size as u8; + } + + //TODO: Setter for sort flag in packed field + //TODO: Setter for interlace flag in packed field +} + +impl From<&ImageDescriptor> for Box<[u8]> { + fn from(desc: &ImageDescriptor) -> Self { + let mut vec = vec![]; + + vec.push(0x2C); // Image Seperator + vec.extend_from_slice(&desc.left.to_le_bytes()); + vec.extend_from_slice(&desc.top.to_le_bytes()); + vec.extend_from_slice(&desc.width.to_le_bytes()); + vec.extend_from_slice(&desc.height.to_le_bytes()); + vec.push(desc.packed); + + vec.into_boxed_slice() + } +} + +//TODO: Impl to allow changing the packed field easier \ No newline at end of file diff --git a/src/block/mod.rs b/src/block/mod.rs new file mode 100644 index 0000000..049b39a --- /dev/null +++ b/src/block/mod.rs @@ -0,0 +1,13 @@ +mod block; +mod colortable; +mod image; +mod imagedescriptor; +mod screendescriptor; +mod version; + +pub use block::Block; +pub use colortable::ColorTable; +pub use image::Image; +pub use imagedescriptor::ImageDescriptor; +pub use screendescriptor::ScreenDescriptor; +pub use version::Version; \ No newline at end of file diff --git a/src/block/screendescriptor.rs b/src/block/screendescriptor.rs new file mode 100644 index 0000000..d53d252 --- /dev/null +++ b/src/block/screendescriptor.rs @@ -0,0 +1,40 @@ +pub struct ScreenDescriptor { + pub width: u16, + pub height: u16, + pub packed: u8, + pub background_color_index: u8, + pub pixel_aspect_ratio: u8 +} + +impl ScreenDescriptor { + pub fn color_table_present(&mut self, is_present: bool) { + if is_present { + self.packed |= 0b1000_0000; + } else { + self.packed &= 0b0111_1111; + } + } + + pub fn color_table_size(&mut self, size: u8) { + // GCT size is calulated by raising two to this number plus one, + // so we have to work backwards. + let size = (size as f32).log2().ceil() - 1f32; + self.packed |= size as u8; + } + + //TODO: Setter for sort flag in packed field + //TODO: Setter for color resolution in packed field +} + +impl From<&ScreenDescriptor> for Box<[u8]> { + fn from(lsd: &ScreenDescriptor) -> Self { + let mut vec = vec![]; + vec.extend_from_slice(&lsd.width.to_le_bytes()); + vec.extend_from_slice(&lsd.height.to_le_bytes()); + vec.push(lsd.packed); + vec.push(lsd.background_color_index); + vec.push(lsd.pixel_aspect_ratio); + + vec.into_boxed_slice() + } +} \ No newline at end of file diff --git a/src/block/version.rs b/src/block/version.rs new file mode 100644 index 0000000..a5d688d --- /dev/null +++ b/src/block/version.rs @@ -0,0 +1,13 @@ +pub enum Version { + Gif87a, + Gif89a +} + +impl From<&Version> for &[u8] { + fn from(version: &Version) -> Self { + match version { + Version::Gif87a => b"GIF87a", + Version::Gif89a => b"GIF89a" + } + } +} \ No newline at end of file diff --git a/src/color.rs b/src/color.rs new file mode 100644 index 0000000..dc134ef --- /dev/null +++ b/src/color.rs @@ -0,0 +1,11 @@ +pub struct Color { + pub r: u8, + pub g: u8, + pub b: u8 +} + +impl Color { + pub fn new(r: u8, g: u8, b: u8) -> Self { + Self { r, g, b } + } +} \ No newline at end of file diff --git a/src/components/color.rs b/src/components/color.rs deleted file mode 100644 index dc134ef..0000000 --- a/src/components/color.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub struct Color { - pub r: u8, - pub g: u8, - pub b: u8 -} - -impl Color { - pub fn new(r: u8, g: u8, b: u8) -> Self { - Self { r, g, b } - } -} \ No newline at end of file diff --git a/src/components/colortable.rs b/src/components/colortable.rs deleted file mode 100644 index f756169..0000000 --- a/src/components/colortable.rs +++ /dev/null @@ -1,67 +0,0 @@ -use std::ops::Deref; -pub use super::Color; - -pub struct ColorTable { - table: Vec -} - -impl ColorTable { - pub fn new() -> Self { - Self { - table: vec![] - } - } - - /// Returns the number of colors in the color table as used by the packed - /// fields in the Logical Screen Descriptor and Image Descriptor. You can - /// get the actual size with the [`len`](struct.ColorTable.html#method.len) method. - pub fn packed_len(&self) -> u8 { - ((self.table.len() as f32).log2().ceil() - 1f32) as u8 - } - - /// Returns the number of items in the table - pub fn len(&self) -> usize { - self.table.len() - } - - /// Pushes a color on to the end of the table - pub fn push(&mut self, color: Color) { - self.table.push(color); - } -} - -impl Deref for ColorTable { - type Target = [Color]; - - fn deref(&self) -> &Self::Target { - &self.table - } -} - -impl From> for ColorTable { - fn from(table: Vec) -> Self{ - ColorTable { - table - } - } -} - -impl From<&ColorTable> for Box<[u8]> { - fn from(table: &ColorTable) -> Self { - let mut vec = vec![]; - - for color in table.iter() { - vec.extend_from_slice(&[color.r, color.g, color.b]); - } - - let packed_len = 2u8.pow(table.packed_len() as u32 + 1); - let padding = (packed_len as usize - table.len()) * 3; - if padding > 0 { - vec.extend_from_slice(&vec![0; padding]); - } - - vec.into_boxed_slice() - } -} - -//TODO: TryFrom Vec (must be multiple of 3 len) and From Vec \ No newline at end of file diff --git a/src/components/gif.rs b/src/components/gif.rs deleted file mode 100644 index 2709fe8..0000000 --- a/src/components/gif.rs +++ /dev/null @@ -1,82 +0,0 @@ -use super::{ColorTable, Image, LogicalScreenDescriptor, Version}; - -pub struct Gif { - pub header: Version, - pub logical_screen_descriptor: LogicalScreenDescriptor, - pub global_color_table: Option, - pub images: Vec - // Trailer at the end of this struct is 0x3B // -} - -impl Gif { - pub fn to_vec(&self) -> Vec { - let mut out = vec![]; - - out.extend_from_slice((&self.header).into()); - - let mut boxed: Box<[u8]> = (&self.logical_screen_descriptor).into(); - out.extend_from_slice(&*boxed); - - // While we output the color table, grab it's length to use when - // outputting the image, or 0 if we don't have a GCT - let mcs = if let Some(gct) = &self.global_color_table { - boxed = gct.into(); - out.extend_from_slice(&*boxed); - - gct.packed_len() - } else { - 0 - }; - - for image in self.images.iter() { - boxed = image.as_boxed_slice(mcs); - out.extend_from_slice(&*boxed); - } - - // Write Trailer - out.push(0x3B); - - out - } -} - -#[cfg(test)] -pub mod gif { - use crate::Color; - use crate::writer::{GifBuilder, ImageBuilder}; - use super::*; - - #[test] - fn to_vec() { - let gct = vec![ - Color::new(1, 2, 3), Color::new(253, 254, 255) - ]; - let colortable = vec![ - Color::new(0, 0, 0), Color::new(128, 0, 255) - ]; - let indicies = vec![0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0]; - - let expected_out = vec![ - 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, // Version - GIF87a - 0x04, 0x00, 0x04, 0x00, 0b1000_0000, 0x00, 0x00, // Logical Screen Descriptor - 1, 2, 3, 253, 254, 255, // Global Color Table - 0x2C, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0b1000_0000, // Image Descriptor 1 - 0, 0, 0, 128, 0, 255, // Color Table - 0x02, 0x05, 0x84, 0x1D, 0x81, 0x7A, 0x50, 0x00, // Image Data 1 - 0x2C, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0b0000_0000, // Image Descriptor 2 - 0x02, 0x05, 0x84, 0x1D, 0x81, 0x7A, 0x50, 0x00, // Image Data 2 - 0x3B // Trailer - ]; - - let actual_out = GifBuilder::new(Version::Gif87a, 4, 4) - .global_color_table(gct.into()) - .image(ImageBuilder::new(4, 4) - .color_table(colortable.into()) - .indicies(indicies.clone()) - ).image(ImageBuilder::new(4, 4) - .indicies(indicies) - ).build().to_vec(); - - assert_eq!(actual_out, expected_out); - } -} \ No newline at end of file diff --git a/src/components/image.rs b/src/components/image.rs deleted file mode 100644 index 07f9555..0000000 --- a/src/components/image.rs +++ /dev/null @@ -1,47 +0,0 @@ -use crate::LZW; -use super::{ColorTable, ImageDescriptor}; - -pub struct Image { - pub image_descriptor: ImageDescriptor, - pub local_color_table: Option, - pub indicies: Vec -} - -impl Image { - pub fn as_boxed_slice(&self, minimum_code_size: u8) -> Box<[u8]> { - let mut out = vec![]; - - let mut boxed: Box<[u8]> = (&self.image_descriptor).into(); - out.extend_from_slice(&*boxed); - - // Table based image data // - - // Get the mcs while we write out the color table - let mut mcs = if let Some(lct) = &self.local_color_table { - boxed = lct.into(); - out.extend_from_slice(&*boxed); - - lct.packed_len() - } else { - minimum_code_size - }; - - if mcs < 2 { - mcs = 2; // Must be true: 0 <= mcs <= 8 - } - - // First write out the MCS - out.push(mcs); - - let compressed = LZW::encode(mcs, &self.indicies); - - for chunk in compressed.chunks(255) { - out.push(chunk.len() as u8); - out.extend_from_slice(chunk); - } - // Data block length 0 to indicate an end - out.push(0x00); - - out.into_boxed_slice() - } -} \ No newline at end of file diff --git a/src/components/imagedescriptor.rs b/src/components/imagedescriptor.rs deleted file mode 100644 index c911baa..0000000 --- a/src/components/imagedescriptor.rs +++ /dev/null @@ -1,45 +0,0 @@ -pub struct ImageDescriptor { - // Image Seperator 0x2C is the first byte // - pub left: u16, - pub top: u16, - pub width: u16, - pub height: u16, - pub packed: u8 -} - -impl ImageDescriptor { - pub fn color_table_present(&mut self, is_present: bool) { - if is_present { - self.packed |= 0b1000_0000; - } else { - self.packed &= 0b0111_1111; - } - } - - pub fn color_table_size(&mut self, size: u8) { - // GCT size is calulated by raising two to this number plus one, - // so we have to work backwards. - let size = (size as f32).log2().ceil() - 1f32; - self.packed |= size as u8; - } - - //TODO: Setter for sort flag in packed field - //TODO: Setter for interlace flag in packed field -} - -impl From<&ImageDescriptor> for Box<[u8]> { - fn from(desc: &ImageDescriptor) -> Self { - let mut vec = vec![]; - - vec.push(0x2C); // Image Seperator - vec.extend_from_slice(&desc.left.to_le_bytes()); - vec.extend_from_slice(&desc.top.to_le_bytes()); - vec.extend_from_slice(&desc.width.to_le_bytes()); - vec.extend_from_slice(&desc.height.to_le_bytes()); - vec.push(desc.packed); - - vec.into_boxed_slice() - } -} - -//TODO: Impl to allow changing the packed field easier \ No newline at end of file diff --git a/src/components/logicalscreendescriptor.rs b/src/components/logicalscreendescriptor.rs deleted file mode 100644 index b20c9d5..0000000 --- a/src/components/logicalscreendescriptor.rs +++ /dev/null @@ -1,40 +0,0 @@ -pub struct LogicalScreenDescriptor { - pub width: u16, - pub height: u16, - pub packed: u8, - pub background_color_index: u8, - pub pixel_aspect_ratio: u8 -} - -impl LogicalScreenDescriptor { - pub fn color_table_present(&mut self, is_present: bool) { - if is_present { - self.packed |= 0b1000_0000; - } else { - self.packed &= 0b0111_1111; - } - } - - pub fn color_table_size(&mut self, size: u8) { - // GCT size is calulated by raising two to this number plus one, - // so we have to work backwards. - let size = (size as f32).log2().ceil() - 1f32; - self.packed |= size as u8; - } - - //TODO: Setter for sort flag in packed field - //TODO: Setter for color resolution in packed field -} - -impl From<&LogicalScreenDescriptor> for Box<[u8]> { - fn from(lsd: &LogicalScreenDescriptor) -> Self { - let mut vec = vec![]; - vec.extend_from_slice(&lsd.width.to_le_bytes()); - vec.extend_from_slice(&lsd.height.to_le_bytes()); - vec.push(lsd.packed); - vec.push(lsd.background_color_index); - vec.push(lsd.pixel_aspect_ratio); - - vec.into_boxed_slice() - } -} \ No newline at end of file diff --git a/src/components/mod.rs b/src/components/mod.rs deleted file mode 100644 index 1650d36..0000000 --- a/src/components/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod color; -mod colortable; -mod gif; -mod image; -mod imagedescriptor; -mod logicalscreendescriptor; -mod version; - -pub use color::Color; -pub use colortable::ColorTable; -pub use gif::Gif; -pub use image::Image; -pub use imagedescriptor::ImageDescriptor; -pub use logicalscreendescriptor::LogicalScreenDescriptor; -pub use version::Version; \ No newline at end of file diff --git a/src/components/version.rs b/src/components/version.rs deleted file mode 100644 index a5d688d..0000000 --- a/src/components/version.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub enum Version { - Gif87a, - Gif89a -} - -impl From<&Version> for &[u8] { - fn from(version: &Version) -> Self { - match version { - Version::Gif87a => b"GIF87a", - Version::Gif89a => b"GIF89a" - } - } -} \ No newline at end of file diff --git a/src/gif.rs b/src/gif.rs new file mode 100644 index 0000000..c3ef56b --- /dev/null +++ b/src/gif.rs @@ -0,0 +1,82 @@ +use crate::block::{ColorTable, Image, ScreenDescriptor, Version}; + +pub struct Gif { + pub header: Version, + pub screen_descriptor: ScreenDescriptor, + pub global_color_table: Option, + pub images: Vec + // Trailer at the end of this struct is 0x3B // +} + +impl Gif { + pub fn to_vec(&self) -> Vec { + let mut out = vec![]; + + out.extend_from_slice((&self.header).into()); + + let mut boxed: Box<[u8]> = (&self.screen_descriptor).into(); + out.extend_from_slice(&*boxed); + + // While we output the color table, grab it's length to use when + // outputting the image, or 0 if we don't have a GCT + let mcs = if let Some(gct) = &self.global_color_table { + boxed = gct.into(); + out.extend_from_slice(&*boxed); + + gct.packed_len() + } else { + 0 + }; + + for image in self.images.iter() { + boxed = image.as_boxed_slice(mcs); + out.extend_from_slice(&*boxed); + } + + // Write Trailer + out.push(0x3B); + + out + } +} + +#[cfg(test)] +pub mod gif { + use crate::Color; + use crate::writer::{GifBuilder, ImageBuilder}; + use super::*; + + #[test] + fn to_vec() { + let gct = vec![ + Color::new(1, 2, 3), Color::new(253, 254, 255) + ]; + let colortable = vec![ + Color::new(0, 0, 0), Color::new(128, 0, 255) + ]; + let indicies = vec![0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0]; + + let expected_out = vec![ + 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, // Version - GIF87a + 0x04, 0x00, 0x04, 0x00, 0b1000_0000, 0x00, 0x00, // Logical Screen Descriptor + 1, 2, 3, 253, 254, 255, // Global Color Table + 0x2C, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0b1000_0000, // Image Descriptor 1 + 0, 0, 0, 128, 0, 255, // Color Table + 0x02, 0x05, 0x84, 0x1D, 0x81, 0x7A, 0x50, 0x00, // Image Data 1 + 0x2C, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0b0000_0000, // Image Descriptor 2 + 0x02, 0x05, 0x84, 0x1D, 0x81, 0x7A, 0x50, 0x00, // Image Data 2 + 0x3B // Trailer + ]; + + let actual_out = GifBuilder::new(Version::Gif87a, 4, 4) + .global_color_table(gct.into()) + .image(ImageBuilder::new(4, 4) + .color_table(colortable.into()) + .indicies(indicies.clone()) + ).image(ImageBuilder::new(4, 4) + .indicies(indicies) + ).build().to_vec(); + + assert_eq!(actual_out, expected_out); + } +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 6eb07d6..5ef22af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,10 @@ -mod components; +mod color; +mod gif; mod lzw; + +pub mod block; pub mod writer; -pub use components::*; +pub use color::Color; +pub use gif::Gif; pub use lzw::LZW; \ No newline at end of file diff --git a/src/writer/gifbuilder.rs b/src/writer/gifbuilder.rs index 6ae55d5..415ebf6 100644 --- a/src/writer/gifbuilder.rs +++ b/src/writer/gifbuilder.rs @@ -1,5 +1,6 @@ -use crate::components::{ColorTable, Gif, LogicalScreenDescriptor, Version}; -use super::ImageBuilder; +use crate::block::{ColorTable, ScreenDescriptor, Version}; +use crate::writer::ImageBuilder; +use crate::Gif; pub struct GifBuilder { version: Version, @@ -44,7 +45,7 @@ impl GifBuilder { } pub fn build(self) -> Gif { - let mut lsd = LogicalScreenDescriptor { + let mut lsd = ScreenDescriptor { width: self.width, height: self.height, packed: 0, // Set later @@ -64,7 +65,7 @@ impl GifBuilder { Gif { header: self.version, - logical_screen_descriptor: lsd, + screen_descriptor: lsd, global_color_table: self.global_color_table, images } diff --git a/src/writer/imagebuilder.rs b/src/writer/imagebuilder.rs index 0636bb3..d8b9900 100644 --- a/src/writer/imagebuilder.rs +++ b/src/writer/imagebuilder.rs @@ -1,4 +1,4 @@ -use crate::components::{ColorTable, Image, ImageDescriptor}; +use crate::block::{ColorTable, Image, ImageDescriptor}; pub struct ImageBuilder { left_offset: u16, -- cgit 1.4.1-3-g733a5