Consider document's output intents in color transformation

This commit is contained in:
Jakub Melka
2021-03-04 19:39:14 +01:00
parent 08815d1b8b
commit d73fbe4dff
11 changed files with 320 additions and 98 deletions

View File

@ -283,6 +283,7 @@ void PDFToolAbstractApplication::initializeCommandLineParser(QCommandLineParser*
parser->addOption(QCommandLineOption("cms-intent", "Rendering intent. Valid values are auto|perceptual|abs|rel|saturation.", "intent", "auto"));
parser->addOption(QCommandLineOption("cms-black-compensated", "Black point compensation.", "bool", "1"));
parser->addOption(QCommandLineOption("cms-white-paper-trans", "Transform also color of paper using cms.", "bool", "0"));
parser->addOption(QCommandLineOption("cms-consider-output-intents", "Consider output rendering intents in the document.", "bool", "1"));
parser->addOption(QCommandLineOption("cms-profile-output", "Output color profile.", "profile"));
parser->addOption(QCommandLineOption("cms-profile-gray", "Gray color profile for gray device.", "profile"));
parser->addOption(QCommandLineOption("cms-profile-rgb", "RGB color profile for RGB device.", "profile"));
@ -763,6 +764,11 @@ PDFToolOptions PDFToolAbstractApplication::getOptions(QCommandLineParser* parser
options.cmsSettings.isWhitePaperColorTransformed = parser->value("cms-white-paper-trans").toInt();
}
if (parser->isSet("cms-consider-output-intents"))
{
options.cmsSettings.isConsiderOutputIntent = parser->value("cms-consider-output-intents").toInt();
}
auto setProfile = [&parser, &options](QString settings, QString& profile)
{
if (parser->isSet(settings))