mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	 1682f0b760
			
		
	
	
		1682f0b760
		
	
	
	
	
		
			
			SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			665 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			665 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Pierre Hoffmeister
 | |
|  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Vector.h>
 | |
| #include <LibGfx/Forward.h>
 | |
| 
 | |
| namespace Gfx {
 | |
| 
 | |
| class PNGChunk;
 | |
| 
 | |
| class PNGWriter {
 | |
| public:
 | |
|     static ByteBuffer encode(Gfx::Bitmap const&);
 | |
| 
 | |
| private:
 | |
|     PNGWriter() { }
 | |
| 
 | |
|     Vector<u8> m_data;
 | |
|     void add_chunk(PNGChunk const&);
 | |
|     void add_png_header();
 | |
|     void add_IHDR_chunk(u32 width, u32 height, u8 bit_depth, u8 color_type, u8 compression_method, u8 filter_method, u8 interlace_method);
 | |
|     void add_IDAT_chunk(Gfx::Bitmap const&);
 | |
|     void add_IEND_chunk();
 | |
| };
 | |
| 
 | |
| }
 |