ladybird/Libraries/LibDraw/PNGLoader.h
Andreas Kling 7cc4b90b16 LibDraw: Create purgeable GraphicsBitmap in the PNG decoder
Also add ImageDecoder APIs for controlling the volatile flag.
2019-12-18 20:50:58 +01:00

24 lines
643 B
C++

#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;
virtual void set_volatile() override;
[[nodiscard]] virtual bool set_nonvolatile() override;
private:
OwnPtr<PNGLoadingContext> m_context;
};