1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

LibGfx/JPEG: Add a JPEG encoder :^)

This encoder is very naive as it only output SOF0 images and uses
pre-defined Huffman tables.

There is also a small bug with quantization which make using it
over-degrade the quality.
This commit is contained in:
Lucas CHOLLET 2023-06-20 16:32:17 -04:00 committed by Jelle Raaijmakers
parent 503720b574
commit 226b214142
4 changed files with 981 additions and 0 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2023, Lucas Chollet <lucas.chollet@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <LibGfx/Forward.h>
namespace Gfx {
class JPEGWriter {
public:
static ErrorOr<void> encode(Stream&, Bitmap const&);
private:
JPEGWriter() = delete;
};
}