From 96878711b03ee026f57d69648953d603ed503f34 Mon Sep 17 00:00:00 2001 From: gennyble Date: Tue, 2 Jan 2024 18:32:06 -0600 Subject: Frame can now From Vec --- gifed/src/videogif.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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> for Frame { + fn from(flat: Vec) -> Self { + flat.as_slice().into() + } +} + impl From<&[Color]> for Frame { fn from(flat: &[Color]) -> Self { let flat_rgba = flat.as_rgba(); -- cgit 1.4.1-3-g733a5