2020-06-21 06:00:22 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Hüseyin ASLITÜRK <asliturk@hotmail.com>
|
2022-03-12 15:16:30 -03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-06-21 06:00:22 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-21 06:00:22 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-03-12 15:16:30 -03:00
|
|
|
#include <AK/StringView.h>
|
2023-03-21 15:58:06 -03:00
|
|
|
#include <LibGfx/ImageFormats/ImageDecoder.h>
|
|
|
|
|
#include <LibGfx/ImageFormats/PortableImageMapLoader.h>
|
2020-06-21 06:00:22 -03:00
|
|
|
|
|
|
|
|
namespace Gfx {
|
|
|
|
|
|
2022-03-12 15:16:30 -03:00
|
|
|
struct PBM {
|
|
|
|
|
static constexpr auto ascii_magic_number = '1';
|
|
|
|
|
static constexpr auto binary_magic_number = '4';
|
2022-07-11 14:32:29 -03:00
|
|
|
static constexpr StringView image_type = "PBM"sv;
|
2022-03-12 15:16:30 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using PBMLoadingContext = PortableImageMapLoadingContext<PBM>;
|
2022-03-13 14:58:58 -03:00
|
|
|
using PBMImageDecoderPlugin = PortableImageDecoderPlugin<PBMLoadingContext>;
|
2020-06-21 06:00:22 -03:00
|
|
|
|
2023-03-12 23:55:47 -03:00
|
|
|
ErrorOr<void> read_image_data(PBMLoadingContext& context);
|
2020-06-21 06:00:22 -03:00
|
|
|
}
|