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