mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
icc: Extract out_optional() function
This commit is contained in:
parent
f0395a2042
commit
516d800b01
1 changed files with 11 additions and 6 deletions
|
@ -10,6 +10,16 @@
|
||||||
#include <LibCore/MappedFile.h>
|
#include <LibCore/MappedFile.h>
|
||||||
#include <LibGfx/ICCProfile.h>
|
#include <LibGfx/ICCProfile.h>
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
static void out_optional(char const* label, Optional<T> optional)
|
||||||
|
{
|
||||||
|
out("{}: ", label);
|
||||||
|
if (optional.has_value())
|
||||||
|
outln("{}", *optional);
|
||||||
|
else
|
||||||
|
outln("(not set)");
|
||||||
|
}
|
||||||
|
|
||||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
|
@ -49,12 +59,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
outln("rendering intent: {}", Gfx::ICC::rendering_intent_name(profile->rendering_intent()));
|
outln("rendering intent: {}", Gfx::ICC::rendering_intent_name(profile->rendering_intent()));
|
||||||
outln("pcs illuminant: {}", profile->pcs_illuminant());
|
outln("pcs illuminant: {}", profile->pcs_illuminant());
|
||||||
|
out_optional("id", profile->id());
|
||||||
out("id: ");
|
|
||||||
if (auto id = profile->id(); id.has_value())
|
|
||||||
outln("{}", *id);
|
|
||||||
else
|
|
||||||
outln("(not set)");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue