/* * Copyright (c) 2021, Pierre Hoffmeister * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Gfx { class PNGChunk; class PNGWriter { public: static ErrorOr encode(Gfx::Bitmap const&); private: PNGWriter() = default; Vector m_data; ErrorOr add_chunk(PNGChunk&); ErrorOr add_png_header(); ErrorOr add_IHDR_chunk(u32 width, u32 height, u8 bit_depth, PNG::ColorType color_type, u8 compression_method, u8 filter_method, u8 interlace_method); ErrorOr add_IDAT_chunk(Gfx::Bitmap const&); ErrorOr add_IEND_chunk(); }; }