mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:25:08 +00:00
LibGfx: Add support for animated images to ImageDecoder{Plugin}
Adds methods to determine whether an image is animated, how many times the animation loops, the number of frames, and to get individual frames. Implements stubs of these methods for PNGImageDecoderPlugin and GIFImageDecoderPlugin.
This commit is contained in:
parent
eec99b23a0
commit
d22bb92764
5 changed files with 71 additions and 2 deletions
|
@ -834,4 +834,27 @@ bool PNGImageDecoderPlugin::sniff()
|
|||
return decode_png_header(*m_context);
|
||||
}
|
||||
|
||||
bool PNGImageDecoderPlugin::is_animated()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t PNGImageDecoderPlugin::loop_count()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t PNGImageDecoderPlugin::frame_count()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
ImageFrameDescriptor PNGImageDecoderPlugin::frame(size_t i)
|
||||
{
|
||||
if (i > 0) {
|
||||
return { bitmap(), 0 };
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue