1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

LibGfx: Add ImageDecoder factory overload for ByteBuffers

This commit is contained in:
Andreas Kling 2020-06-01 21:32:54 +02:00
parent 6ed11f1d1c
commit 7be9cf8d36
Notes: sideshowbarker 2024-07-19 05:54:23 +09:00

View file

@ -26,6 +26,7 @@
#pragma once
#include <AK/ByteBuffer.h>
#include <AK/OwnPtr.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
@ -64,6 +65,7 @@ protected:
class ImageDecoder : public RefCounted<ImageDecoder> {
public:
static NonnullRefPtr<ImageDecoder> create(const u8* data, size_t size) { return adopt(*new ImageDecoder(data, size)); }
static NonnullRefPtr<ImageDecoder> create(const ByteBuffer& data) { return adopt(*new ImageDecoder(data.data(), data.size())); }
~ImageDecoder();
Size size() const { return m_plugin->size(); }