Skip to content

feat: gif example - #40

Open
BenjaminHalko wants to merge 1 commit into
thorvg:mainfrom
BenjaminHalko:feat/gif-loader
Open

feat: gif example#40
BenjaminHalko wants to merge 1 commit into
thorvg:mainfrom
BenjaminHalko:feat/gif-loader

Conversation

@BenjaminHalko

@BenjaminHalko BenjaminHalko commented Jun 19, 2026

Copy link
Copy Markdown

Added an example for gifs

depends on: thorvg/thorvg#3975

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ThorVG example executable that demonstrates loading and playing an animated GIF, integrating it into the Meson-based examples build.

Changes:

  • Introduces a new GifAnimation example that loads res/image/test.gif and advances frames over time.
  • Registers GifAnimation.cpp in src/meson.build so it gets built as an example executable.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/meson.build Adds GifAnimation.cpp to the example source list so it is built.
src/GifAnimation.cpp New example implementation for loading and animating a GIF.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/GifAnimation.cpp Outdated
Comment on lines +44 to +46
picture->scale(scale);
picture->translate(float(w) * 0.5f, float(h) * 0.5f);
canvas->push(picture);
Comment thread src/GifAnimation.cpp
Comment on lines +52 to +57
auto progress = tvgexam::progress(elapsed, animation->duration());
animation->frame(animation->totalFrame() * progress);

canvas->update();
return true;
}
@hermet
hermet force-pushed the main branch 3 times, most recently from 524743a to 6a6d1c1 Compare June 20, 2026 10:13
@hermet hermet added the addition Adding a new example label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition Adding a new example

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants