about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-01-02 18:32:06 -0600
committergennyble <gen@nyble.dev>2024-01-02 18:32:06 -0600
commit96878711b03ee026f57d69648953d603ed503f34 (patch)
treee38b336d2f282c90e1909e8f2a02e434aca00cbb
parent865bbc58ff2d8589d74bef709afc4a1908624b2c (diff)
downloadgifed-96878711b03ee026f57d69648953d603ed503f34.tar.gz
gifed-96878711b03ee026f57d69648953d603ed503f34.zip
Frame can now From Vec<Color>
-rw-r--r--gifed/src/videogif.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/gifed/src/videogif.rs b/gifed/src/videogif.rs
index 27ec798..a5475cc 100644
--- a/gifed/src/videogif.rs
+++ b/gifed/src/videogif.rs
@@ -82,6 +82,12 @@ pub struct Frame {
 	palette: Palette,
 }
 
+impl From<Vec<Color>> for Frame {
+	fn from(flat: Vec<Color>) -> Self {
+		flat.as_slice().into()
+	}
+}
+
 impl From<&[Color]> for Frame {
 	fn from(flat: &[Color]) -> Self {
 		let flat_rgba = flat.as_rgba();