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:
parent
6ed11f1d1c
commit
7be9cf8d36
Notes:
sideshowbarker
2024-07-19 05:54:23 +09:00
Author: https://github.com/awesomekling
Commit: 7be9cf8d36
1 changed files with 4 additions and 2 deletions
|
@ -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(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue