diff options
author | gennyble <gen@nyble.dev> | 2025-01-29 21:57:38 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-01-29 21:57:38 -0600 |
commit | a49b9ab5ca5ee6c0a92195beacf96f468f0756ea (patch) | |
tree | 1e8f96aa787f05af656cbaf83bf7191188e0b633 | |
parent | 3d9bfb74b5364f0dc1d89e201c728e5c3291622f (diff) | |
download | gifed-a49b9ab5ca5ee6c0a92195beacf96f468f0756ea.tar.gz gifed-a49b9ab5ca5ee6c0a92195beacf96f468f0756ea.zip |
rename videogif to standardgif
-rw-r--r-- | gifed/Cargo.toml | 5 | ||||
-rw-r--r-- | gifed/src/lib.rs | 6 | ||||
-rw-r--r-- | gifed/src/standard.rs (renamed from gifed/src/videogif.rs) | 12 |
3 files changed, 11 insertions, 12 deletions
diff --git a/gifed/Cargo.toml b/gifed/Cargo.toml index b4d6322..aded3e2 100644 --- a/gifed/Cargo.toml +++ b/gifed/Cargo.toml @@ -9,14 +9,13 @@ repository = "https://github.com/genuinebyte/gifed" [dependencies] bitvec = "1.0.1" -weezl = "0.1.5" +weezl = "0.1.8" color_quant = { version = "1.1.0", optional = true } rgb = { version = "0.8", optional = true } [features] -weezl-encode = [] -videoish = ["color_quant", "rgb"] +standard = ["color_quant", "rgb"] default = [] [dev-dependencies] diff --git a/gifed/src/lib.rs b/gifed/src/lib.rs index 2ed3b9b..96ffb1b 100644 --- a/gifed/src/lib.rs +++ b/gifed/src/lib.rs @@ -1,10 +1,10 @@ mod gif; -mod lzw; +pub mod lzw; pub mod block; pub mod reader; -#[cfg(feature = "videoish")] -pub mod videogif; +#[cfg(feature = "standard")] +pub mod standard; pub mod writer; pub use reader::DecodeError; diff --git a/gifed/src/videogif.rs b/gifed/src/standard.rs index d066019..bc296cb 100644 --- a/gifed/src/videogif.rs +++ b/gifed/src/standard.rs @@ -9,10 +9,9 @@ use rgb::{ComponentBytes, FromSlice}; use std::convert::TryFrom; -/// A Video-like GIF. -/// -/// All images must have the same dimensions. -pub struct VideoGif { +/// A constant framerate gif animation. Every frame must be the same size +/// and entirely fill the gif. +pub struct StandardGif { width: u16, height: u16, framerate: Option<u16>, @@ -20,7 +19,7 @@ pub struct VideoGif { looping: LoopCount, } -impl VideoGif { +impl StandardGif { pub fn new(width: u16, height: u16) -> Self { Self { width, @@ -137,7 +136,8 @@ impl From<(&[Color], u16)> for Frame { } impl Frame { - pub fn set_interval(&mut self, interval_hundredths: u16) { + pub fn set_interval(mut self, interval_hundredths: u16) -> Self { self.interval = Some(interval_hundredths); + self } } |