1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 01:05:08 +00:00
serenity/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossy.h
Nico Weber bc207fd0a0 LibGfx/WebP: Move lossy decoder to its own file
Pure code move (except of removing `static` on the two public functions
in the new header), not behavior change.

There isn't a lot of lossy decoder yet, but it'll make implementing it
more convenient.

No behavior change.
2023-05-09 06:35:56 +02:00

31 lines
721 B
C++

/*
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Span.h>
#include <AK/Types.h>
#include <LibGfx/Bitmap.h>
namespace Gfx {
struct VP8Header {
u8 version;
bool show_frame;
u32 size_of_first_partition;
u32 width;
u8 horizontal_scale;
u32 height;
u8 vertical_scale;
ReadonlyBytes lossy_data;
};
// Parses the header data in a VP8 chunk. Pass the payload of a `VP8 ` chunk, after the tag and after the tag's data size.
ErrorOr<VP8Header> decode_webp_chunk_VP8_header(ReadonlyBytes vp8_data);
ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8_contents(VP8Header const&, bool include_alpha_channel);
}