160{
161
165
166
167 QStringList conversionOptionsList = { i18nc(
"Color space name",
"Rec 2100 PQ"), i18nc(
"Color space name",
"Rec 2100 HLG")};
168 QStringList toolTipList = {i18nc(
"@tooltip",
"The image will be converted to Rec 2020 linear first, and then encoded with a perceptual quantizer curve"
169 " (also known as SMPTE 2048 curve). Recommended for HDR images where the absolute brightness is important."),
170 i18nc("@tooltip", "The image will be converted to Rec 2020 linear first, and then encoded with a Hybrid Log Gamma curve."
171 " Recommended for HDR images where the display may not understand HDR.")};
172 QStringList conversionOptionName = {
"Rec2100PQ",
"Rec2100HLG"};
176 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode PQ");
177 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a perceptual quantizer curve"
178 " (also known as the SMPTE 2048 curve). Recommended for images where the absolute brightness is important.");
179 conversionOptionName << "ApplyPQ";
180
181 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode HLG");
182 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a Hybrid Log Gamma curve."
183 " Recommended for images intended for screens which cannot understand PQ");
184 conversionOptionName << "ApplyHLG";
185
186 conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode SMPTE ST 428");
187 toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with SMPTE ST 428."
188 " Krita always opens images like these as linear floating point, this option is there to reverse that");
189 conversionOptionName << "ApplySMPTE428";
190 }
191
192 conversionOptionsList << i18nc("Color space option", "No changes, clip");
193 toolTipList << i18nc("@tooltip", "The image will be converted plainly to 16bit integer, and values that are out of bounds are clipped, the icc profile will be embedded.");
194 conversionOptionName << "KeepSame";
195
196
197 cmbFloatingConversion->clear();
198 cmbFloatingConversion->addItems(conversionOptionsList);
199 for (int i=0; i< toolTipList.size(); i++) {
200 cmbFloatingConversion->setItemData(i, toolTipList.at(i), Qt::ToolTipRole);
201 cmbFloatingConversion->setItemData(i, conversionOptionName.at(i), Qt::UserRole+1);
202 }
203 QString optionName =
204 cfg->getString("floatingPointConversionOption", "KeepSame");
205 if (conversionOptionName.contains(optionName)) {
206 cmbFloatingConversion->setCurrentIndex(
207 conversionOptionName.indexOf(optionName));
208 }
209 const QString colorDepthId =
216 } else {
218 }
219
220 gbSaveColorInfo->setChecked(cfg->getBool("storeColorSpaceInfo", true));
221 chkCICP->setChecked(cfg->getBool("writeCicpIfPossible", true));
222 chkExtraColorChunks->setChecked(cfg->getBool("storeExtraColorChunks", true));
223
224
226
227 alpha->setChecked(cfg->getBool("alpha", isThereAlpha));
228
229 bnTransparencyFillColor->setEnabled(!alpha->isChecked());
230
232 tryToSaveAsIndexed->setVisible(true);
233 if (alpha->isChecked()) {
234 tryToSaveAsIndexed->setChecked(false);
235 }
236 else {
237 tryToSaveAsIndexed->setChecked(cfg->getBool("indexed", false));
238 }
239 }
240 else {
241 tryToSaveAsIndexed->setVisible(false);
242 }
243 interlacing->setChecked(cfg->getBool("interlaced", false));
244 compressionLevel->setValue(cfg->getInt("compression", 3));
245 compressionLevel->setRange(1, 9, 0);
246
247 tryToSaveAsIndexed->setVisible(!isThereAlpha);
248
249 chkForceSRGB->setChecked(cfg->getBool("forceSRGB", false));
250
251 chkAuthor->setChecked(cfg->getBool("storeAuthor", false));
252 chkMetaData->setChecked(cfg->getBool("storeMetaData", false));
253
255 background.fromQColor(Qt::white);
256 bnTransparencyFillColor->setDefaultColor(background);
257 bnTransparencyFillColor->setColor(cfg->getColor("transparencyFillcolor", background));
258
259 chkDownsample->setChecked(cfg->getBool("downsample", false));
260
262}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID Float64BitsColorDepthID("F64", ki18n("64-bit float/channel"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
static const QString ColorDepthIDTag
static const QString ColorModelIDTag
static const QString CICPPrimariesTag
static const QString ImageContainsTransparencyTag
static const QString sRGBTag
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
static KoColorSpaceRegistry * instance()