1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibGfx: Add first_animated_frame_index method to ImageDecoder

Some image formats such as APNG may not use the first frame for
animations.
This commit is contained in:
Tom 2023-04-07 20:41:22 -06:00 committed by Sam Atkins
parent 5a4c61838f
commit e7921cfe14
20 changed files with 64 additions and 4 deletions

View file

@ -39,6 +39,7 @@ public:
virtual bool is_animated() = 0;
virtual size_t loop_count() = 0;
virtual size_t frame_count() = 0;
virtual size_t first_animated_frame_index() = 0;
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index) = 0;
virtual ErrorOr<Optional<ReadonlyBytes>> icc_data() = 0;
@ -59,6 +60,7 @@ public:
bool is_animated() const { return m_plugin->is_animated(); }
size_t loop_count() const { return m_plugin->loop_count(); }
size_t frame_count() const { return m_plugin->frame_count(); }
size_t first_animated_frame_index() const { return m_plugin->first_animated_frame_index(); }
ErrorOr<ImageFrameDescriptor> frame(size_t index) const { return m_plugin->frame(index); }
ErrorOr<Optional<ReadonlyBytes>> icc_data() const { return m_plugin->icc_data(); }