2022-12-26 13:21:54 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Nico Weber <thakis@chromium.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <AK/StringView.h>
|
|
|
|
#include <LibCore/ArgsParser.h>
|
2022-12-27 18:38:08 +00:00
|
|
|
#include <LibCore/DateTime.h>
|
2022-12-26 13:21:54 +00:00
|
|
|
#include <LibCore/MappedFile.h>
|
|
|
|
#include <LibGfx/ICCProfile.h>
|
|
|
|
|
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
|
|
{
|
|
|
|
Core::ArgsParser args_parser;
|
|
|
|
|
|
|
|
static StringView icc_path;
|
|
|
|
args_parser.add_positional_argument(icc_path, "Path to ICC profile", "FILE");
|
|
|
|
args_parser.parse(arguments);
|
|
|
|
|
|
|
|
auto icc_file = TRY(Core::MappedFile::map(icc_path));
|
|
|
|
auto profile = TRY(Gfx::ICC::Profile::try_load_from_externally_owned_memory(icc_file->bytes()));
|
|
|
|
|
|
|
|
outln("version: {}", profile->version());
|
|
|
|
outln("device class: {}", Gfx::ICC::device_class_name(profile->device_class()));
|
2022-12-30 12:55:18 +00:00
|
|
|
outln("data color space: {}", Gfx::ICC::color_space_name(profile->data_color_space()));
|
2022-12-27 18:38:08 +00:00
|
|
|
outln("creation date and time: {}", Core::DateTime::from_timestamp(profile->creation_timestamp()).to_deprecated_string());
|
2022-12-30 13:15:59 +00:00
|
|
|
outln("rendering intent: {}", Gfx::ICC::rendering_intent_name(profile->rendering_intent()));
|
2022-12-26 13:21:54 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|