summaryrefslogtreecommitdiff
path: root/Libraries/LibDraw/PNGLoader.h
blob: c72dafe350a0a99c2bf7b06e3ec7c0d51a7430e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <LibDraw/GraphicsBitmap.h>
#include <LibDraw/ImageDecoder.h>

RefPtr<GraphicsBitmap> load_png(const StringView& path);
RefPtr<GraphicsBitmap> load_png_from_memory(const u8*, size_t);

struct PNGLoadingContext;

class PNGImageDecoderPlugin final : public ImageDecoderPlugin {
public:
    virtual ~PNGImageDecoderPlugin() override;
    PNGImageDecoderPlugin(const u8*, size_t);

    virtual Size size() override;
    virtual RefPtr<GraphicsBitmap> bitmap() override;

private:
    OwnPtr<PNGLoadingContext> m_context;
};