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