anime: gif-image

This commit is contained in:
Luke D Jones
2021-04-06 21:03:05 +12:00
parent fa16864a3e
commit 47c1ca9fe4
5 changed files with 92 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ pub enum AniMeSequence {
impl AniMeSequence {
pub fn gif(file: &Path, brightness: f32) -> Result<Self, AnimeError> {
let frames = AniMeGif::new(file, brightness)?;
let frames = AniMeGif::create_diagonal_gif(file, brightness)?;
Ok(Self::Animation(frames))
}
@@ -55,6 +55,15 @@ impl AniMeSequence {
Ok(Self::Image(Box::new(data)))
}
pub fn png_gif(file: &Path,
// scale: Vec2,
// angle: f32,
// translation: Vec2,
brightness: f32,) -> Result<Self, AnimeError> {
let frames = AniMeGif::create_png_gif(file, brightness)?;
Ok(Self::Animation(frames))
}
pub fn get_animation(&self) -> Option<&AniMeGif> {
match self {
AniMeSequence::Animation(anim) => Some(anim),