528{
529
532
534 chromaOptions << "420" << "422" << "444";
535 cmbChroma->addItems(chromaOptions);
536 cmbChroma->setItemData(0, i18nc("@tooltip", "The brightness of the image will be at full resolution, while the colorfulness will be halved in both dimensions."), Qt::ToolTipRole);
537 cmbChroma->setItemData(1, i18nc("@tooltip", "The brightness of the image will be at full resolution, while the colorfulness will be halved horizontally."), Qt::ToolTipRole);
538 cmbChroma->setItemData(2, i18nc("@tooltip", "Both brightness and colorfulness of the image will be at full resolution."), Qt::ToolTipRole);
539 chkLossless->setChecked(cfg->getBool("lossless", true));
540 sliderQuality->setValue(qreal(cfg->getInt("quality", 50)));
541 cmbChroma->setCurrentIndex(chromaOptions.indexOf(cfg->getString("chroma", "444")));
543
546
547
549
551
552 QStringList conversionOptionsList = { i18nc(
"Color space name",
"Rec 2100 PQ"), i18nc(
"Color space name",
"Rec 2100 HLG")};
553 QStringList toolTipList = {i18nc(
"@tooltip",
"The image will be converted to Rec 2020 linear first, and then encoded with a perceptual quantizer curve"
554 " (also known as SMPTE 2048 curve). Recommended for HDR images where the absolute brightness is important."),
555 i18nc("@tooltip", "The image will be converted to Rec 2020 linear first, and then encoded with a Hybrid Log Gamma curve."
556 " Recommended for HDR images where the display may not understand HDR.")};
557 QStringList conversionOptionName = {
"Rec2100PQ",
"Rec2100HLG"};
558
561 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode PQ");
562 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a perceptual quantizer curve"
563 " (also known as the SMPTE 2048 curve). Recommended for images where the absolute brightness is important.");
564 conversionOptionName << "ApplyPQ";
565
566 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode HLG");
567 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a Hybrid Log Gamma curve."
568 " Recommended for images intended for screens which cannot understand PQ");
569 conversionOptionName << "ApplyHLG";
570
571 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode SMPTE ST 428");
572 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with SMPTE ST 428."
573 " Krita always opens images like these as linear floating point, this option is there to reverse that");
574 conversionOptionName << "ApplySMPTE428";
575 }
576
577 conversionOptionsList << i18nc("Color space option", "No changes, clip");
578 toolTipList << i18nc("@tooltip", "The image will be converted plainly to 12bit integer, and values that are out of bounds are clipped, the icc profile will be embedded.");
579 conversionOptionName << "KeepSame";
580 }
581 cmbConversionPolicy->addItems(conversionOptionsList);
582 for (int i=0; i< toolTipList.size(); i++) {
583 cmbConversionPolicy->setItemData(i, toolTipList.at(i), Qt::ToolTipRole);
584 cmbConversionPolicy->setItemData(i, conversionOptionName.at(i), Qt::UserRole+1);
585 }
586 QString optionName =
587 cfg->getString("floatingPointConversionOption", "KeepSame");
588 if (conversionOptionName.contains(optionName)) {
589 cmbConversionPolicy->setCurrentIndex(
590 conversionOptionName.indexOf(optionName));
591 }
592
593 lossySettings->setEnabled(!chkLossless->isChecked());
594}
static const QString ColorModelIDTag
static const QString CICPPrimariesTag
static const QString HDRTag
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)