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:
parent
503720b574
commit
226b214142
4 changed files with 981 additions and 0 deletions
22
Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.h
Normal file
22
Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue