1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:28:11 +00:00

LibWeb+LibWebView+WebContent: Add Web::Platform::ImageCodecPlugin

This replaces the previous Web::ImageDecoding::Decoder interface.
While we're doing this, also move the SerenityOS implementation of this
interface from LibWebView to WebContent. That means we no longer have to
link with LibImageDecoderClient in applications that use a web view.
This commit is contained in:
Andreas Kling 2022-09-16 15:01:47 +02:00
parent 412b2313f3
commit cd7262ee56
14 changed files with 95 additions and 113 deletions

View file

@ -1,40 +0,0 @@
/*
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, Dex <dexes.ttp@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefPtr.h>
#include <AK/Vector.h>
#include <LibGfx/Bitmap.h>
namespace Web::ImageDecoding {
struct Frame {
RefPtr<Gfx::Bitmap> bitmap;
size_t duration { 0 };
};
struct DecodedImage {
bool is_animated { false };
u32 loop_count { 0 };
Vector<Frame> frames;
};
class Decoder : public RefCounted<Decoder> {
public:
virtual ~Decoder();
static void initialize(RefPtr<Decoder>&&);
static Decoder& the();
virtual Optional<DecodedImage> decode_image(ReadonlyBytes) = 0;
protected:
explicit Decoder();
};
}