JPEGWriter.h 446 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2023, Lucas Chollet <lucas.chollet@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Error.h>
  8. #include <LibGfx/Forward.h>
  9. namespace Gfx {
  10. struct JPEGEncoderOptions {
  11. u8 quality { 75 };
  12. };
  13. class JPEGWriter {
  14. public:
  15. using Options = JPEGEncoderOptions;
  16. static ErrorOr<void> encode(Stream&, Bitmap const&, Options const& = {});
  17. private:
  18. JPEGWriter() = delete;
  19. };
  20. }