mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
ea441fea95
It will be used by the JPEG2000 decoder as well. Pure code move, no behavior change.
37 lines
819 B
C++
37 lines
819 B
C++
/*
|
|
* Copyright (c) 2024, Nico Weber <thakis@chromium.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/MemoryStream.h>
|
|
#include <AK/OwnPtr.h>
|
|
#include <LibGfx/ImageFormats/ImageDecoder.h>
|
|
|
|
namespace Gfx {
|
|
|
|
struct JBIG2LoadingContext;
|
|
|
|
class JBIG2ImageDecoderPlugin : public ImageDecoderPlugin {
|
|
public:
|
|
static bool sniff(ReadonlyBytes);
|
|
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
|
|
|
|
virtual ~JBIG2ImageDecoderPlugin() override = default;
|
|
|
|
virtual IntSize size() override;
|
|
|
|
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
|
|
|
|
static ErrorOr<ByteBuffer> decode_embedded(Vector<ReadonlyBytes>);
|
|
|
|
private:
|
|
JBIG2ImageDecoderPlugin();
|
|
|
|
OwnPtr<JBIG2LoadingContext> m_context;
|
|
};
|
|
|
|
}
|