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

LibGfx/JPEG: Take the quality as an argument instead of hardcoding it

This commit is contained in:
Lucas CHOLLET 2023-07-02 00:00:40 -04:00 committed by Jelle Raaijmakers
parent 05c8ad4e91
commit a58c7fe322
2 changed files with 10 additions and 6 deletions

View file

@ -11,9 +11,15 @@
namespace Gfx {
struct JPEGEncoderOptions {
u8 quality { 75 };
};
class JPEGWriter {
public:
static ErrorOr<void> encode(Stream&, Bitmap const&);
using Options = JPEGEncoderOptions;
static ErrorOr<void> encode(Stream&, Bitmap const&, Options const& = {});
private:
JPEGWriter() = delete;