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