2022-09-16 13:15:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-09-08 10:30:50 +00:00
|
|
|
#include <LibImageDecoderClient/Client.h>
|
2022-09-16 13:15:14 +00:00
|
|
|
#include <LibWeb/Platform/ImageCodecPlugin.h>
|
|
|
|
|
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-08-02 18:01:17 +00:00
|
|
|
class ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin {
|
2022-09-16 13:15:14 +00:00
|
|
|
public:
|
2023-08-02 18:01:17 +00:00
|
|
|
ImageCodecPlugin() = default;
|
|
|
|
virtual ~ImageCodecPlugin() override;
|
2022-09-16 13:15:14 +00:00
|
|
|
|
2024-04-19 21:02:12 +00:00
|
|
|
virtual NonnullRefPtr<Core::Promise<Web::Platform::DecodedImage>> decode_image(ReadonlyBytes, Function<ErrorOr<void>(Web::Platform::DecodedImage&)> on_resolved, Function<void(Error&)> on_rejected) override;
|
2023-09-08 10:30:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
RefPtr<ImageDecoderClient::Client> m_client;
|
2022-09-16 13:15:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|