mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	 bc207fd0a0
			
		
	
	
		bc207fd0a0
		
	
	
	
	
		
			
			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.
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			721 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			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);
 | |
| 
 | |
| }
 |