anitty 0.1.0

Anime character animation rendering for terminals
Documentation
//! Character animations rendered as RGBA frames and displayed in a terminal.
//!
//! [`SpriteAnimation`] supports frame sequences and regular RGBA sprite sheets.
//! [`Iterm2`] preserves transparency in Konsole; [`Sixel`] provides solid-background
//! output for SIXEL-capable terminals. [`Kitty`] sends RGBA to terminals supporting
//! the Kitty graphics protocol.
//! Applications own the clock, playback loop and terminal layout.
//! [`TerminalProbe`] optionally queries capabilities when explicitly driven by
//! the host; animation and backend APIs never start a probe themselves.
//!
//! ```no_run
//! use std::{io, time::Duration};
//! use anitty::{Animation, Backend, Sixel, SpriteAnimation};
//!
//! let image = image::open("character.webp")?.into_rgba8();
//! let sheet = anitty::RgbaFrame::new(image.width(), image.height(), image.into_raw())?;
//! let mut animation = SpriteAnimation::from_sheet(
//!     sheet, 64, 64, Duration::from_millis(100),
//! )?;
//! // A solid background paints over old frames. Use Iterm2 to preserve alpha;
//! // Konsole replaces same-sized images at the same position without clearing.
//! let mut backend = Sixel::new([0, 0, 0]);
//! let mut output = io::stdout().lock();
//! backend.draw(animation.render(Duration::ZERO, 64, 64)?, &mut output)?;
//! // Advance time and draw at the same position to replace the previous frame.
//! backend.draw(animation.render(Duration::from_millis(100), 64, 64)?, &mut output)?;
//! # Ok::<(), anitty::Error>(())
//! ```

pub mod animation;
mod error;
mod frame;

pub mod backend;
pub mod terminal;

pub use animation::{
    Animation, Bounds, PlaybackMode, RenderMapping, RenderOptions, SpriteAnimation, SpriteClip,
    Transform,
};
#[cfg(feature = "spine-38")]
pub use animation::{SpineAnimation, SpineOptions};
pub use backend::{Backend, Iterm2, Kitty, Sixel};
pub use error::Error;
pub use frame::RgbaFrame;
pub use terminal::{Support, TerminalCapabilities, TerminalProbe};