Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve animation decoding API #39

Merged
merged 2 commits into from
Jan 1, 2024
Merged

Conversation

fintelia
Copy link
Contributor

This PR changes the animation API from:

impl WebPDecoder {
    fn has_animation() -> bool;
    fn next_frame(...) -> Result<Option<u32>, Error>;  // Automatically resets the decoder `loop_count` times.
}

To:

impl WebPDecoder {
    fn is_animated() -> bool;
    fn num_frames() -> u32;
    fn loop_count() -> u16;
    fn loop_duration() -> u64;
    fn next_frame(...) -> Result<Option<u32>, Error>;
    fn reset_animation(); // Decoder must be manually reset
}

src/decoder.rs Outdated Show resolved Hide resolved
src/decoder.rs Outdated Show resolved Hide resolved
@fintelia fintelia merged commit ce38503 into image-rs:main Jan 1, 2024
9 checks passed
@fintelia fintelia deleted the animation-api branch January 1, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants