pardon_dance 69.0.96

High-quality integration for https://supermaker.ai/video/blog/unlocking-the-magic-of-pardon-dance-the-viral-video-effect-taking-over-social-media/
Documentation
  • Coverage
  • 91.67%
    11 out of 12 items documented0 out of 7 items with examples
  • Size
  • Source code size: 9.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.7 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • qy-upup

pardon-dance

A lightweight Rust crate for generating visually appealing "pardon dance" animations, perfect for social media content creation. Quickly add dynamic movement and engaging effects to your video projects.

Installation

Add the following to your Cargo.toml file under the [dependencies] section: toml pardon-dance = "0.1.0" # Replace with the actual version number

Usage

Here are a few examples demonstrating how to use the pardon-dance crate:

1. Basic Animation with Default Settings:

This example creates a simple pardon dance animation with default parameters. rust use pardon_dance::PardonDance;

fn main() -> Result<(), Box> { let dance = PardonDance::new("Hello, World!")?; dance.save_gif("basic_dance.gif")?; Ok(()) }

2. Customizing Animation Speed and Font Size:

This example demonstrates how to customize the animation speed and font size for a more personalized look. rust use pardon_dance::{PardonDance, Config};

fn main() -> Result<(), Box> { let config = Config { speed: 2.0, // Double the speed font_size: 48, // Larger font size ..Default::default() }; let dance = PardonDance::with_config("Custom Text!", config)?; dance.save_gif("custom_dance.gif")?; Ok(()) }

3. Changing Colors and Background:

This example shows how to modify the text and background colors to create a visually distinct animation. rust use pardon_dance::{PardonDance, Config, Color};

fn main() -> Result<(), Box> { let config = Config { text_color: Color::new(255, 0, 0), // Red text background_color: Color::new(0, 0, 255), // Blue background ..Default::default() }; let dance = PardonDance::with_config("Colorful Dance!", config)?; dance.save_gif("colorful_dance.gif")?; Ok(()) }

4. Using a Different Font:

This example demonstrates how to use a custom font for the animation. Make sure the font file is accessible to your application. rust use pardon_dance::{PardonDance, Config};

fn main() -> Result<(), Box> { let config = Config { font_path: Some("path/to/your/font.ttf".to_string()), ..Default::default() }; let dance = PardonDance::with_config("Custom Font!", config)?; dance.save_gif("font_dance.gif")?; Ok(()) }

5. Specifying Output Path:

This example shows how to specify a custom path for the generated GIF file. rust use pardon_dance::PardonDance;

fn main() -> Result<(), Box> { let dance = PardonDance::new("Specific Location!")?; dance.save_gif("/tmp/output_dance.gif")?; Ok(()) }

Features

  • Simple API: Easy-to-use functions for generating pardon dance animations.
  • Customizable: Control animation speed, font size, colors, and fonts.
  • Cross-Platform: Works on various operating systems supported by Rust.
  • GIF Output: Generates animations in the widely compatible GIF format.
  • Configuration Options: Flexible Config struct for fine-grained control.

License

MIT

This crate is part of the pardon-dance ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/blog/unlocking-the-magic-of-pardon-dance-the-viral-video-effect-taking-over-social-media/