PBMLoader.h 706 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2020, Hüseyin ASLITÜRK <asliturk@hotmail.com>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/StringView.h>
  9. #include <LibGfx/ImageFormats/ImageDecoder.h>
  10. #include <LibGfx/ImageFormats/PortableImageMapLoader.h>
  11. namespace Gfx {
  12. struct PBM {
  13. static constexpr auto ascii_magic_number = '1';
  14. static constexpr auto binary_magic_number = '4';
  15. static constexpr StringView image_type = "PBM"sv;
  16. };
  17. using PBMLoadingContext = PortableImageMapLoadingContext<PBM>;
  18. using PBMImageDecoderPlugin = PortableImageDecoderPlugin<PBMLoadingContext>;
  19. ErrorOr<void> read_image_data(PBMLoadingContext& context);
  20. }