mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
LibDraw: Start work on a GIF decoder (not yet functional!)
Here comes the first part of a GIF decoder. It decodes up to the point of gathering all the LZW-compressed data. The next step is to implement decompression, and then turn the decompressed data into a bitmap using the color maps, etc.
This commit is contained in:
parent
630d5b3ffd
commit
00ab9488ad
3 changed files with 257 additions and 0 deletions
21
Libraries/LibDraw/GIFLoader.h
Normal file
21
Libraries/LibDraw/GIFLoader.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibDraw/GraphicsBitmap.h>
|
||||
#include <LibDraw/ImageDecoder.h>
|
||||
|
||||
RefPtr<GraphicsBitmap> load_gif(const StringView& path);
|
||||
RefPtr<GraphicsBitmap> load_gif_from_memory(const u8*, size_t);
|
||||
|
||||
struct GIFLoadingContext;
|
||||
|
||||
class GIFImageDecoderPlugin final : public ImageDecoderPlugin {
|
||||
public:
|
||||
virtual ~GIFImageDecoderPlugin() override;
|
||||
GIFImageDecoderPlugin(const u8*, size_t);
|
||||
|
||||
virtual Size size() override;
|
||||
virtual RefPtr<GraphicsBitmap> bitmap() override;
|
||||
|
||||
private:
|
||||
OwnPtr<GIFLoadingContext> m_context;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue