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