mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
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.
This commit is contained in:
parent
83da7ad875
commit
bc207fd0a0
4 changed files with 120 additions and 81 deletions
31
Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossy.h
Normal file
31
Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossy.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue