Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add GUI option for selecting the default color space for EXR files

Dmitry Kazakov99ec66c1d6e4
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index c801791208..9e17bfeafc 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -1073,6 +1073,27 @@ ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name)
m_page->bnAddColorProfile->setIcon(koIcon("document-import-16"));
connect(m_page->bnAddColorProfile, SIGNAL(clicked()), SLOT(installProfile()));
+ {
+ QStringList profiles;
+ QMap<QString, const KoColorProfile *> profileList;
+ Q_FOREACH(const KoColorProfile *profile, KoColorSpaceRegistry::instance()->profilesFor(RGBAColorModelID.id())) {
+ profileList[profile->name()] = profile;
+ profiles.append(profile->name());
+ }
+
+ std::sort(profiles.begin(), profiles.end());
+ Q_FOREACH (const QString profile, profiles) {
+ m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
+ }
+
+ const QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID.id(), Float16BitsColorDepthID.id());
+ const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
+ const QString userProfile = cfg.readEntry("ExrDefaultColorProfile", defaultProfile);
+
+ m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
+ }
+
+
QFormLayout *monitorProfileGrid = new QFormLayout(m_page->monitorprofileholder);
monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
for(int i = 0; i < QGuiApplication::screens().count(); ++i) {
@@ -1214,6 +1235,10 @@ void ColorSettingsTab::setDefault()
{
m_page->cmbWorkingColorSpace->setCurrent("RGBA");
+ const QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID.id(), Float16BitsColorDepthID.id());
+ const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
+ m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
+
refillMonitorProfiles(KoID("RGBA"));
KisConfig cfg(true);
@@ -1271,7 +1296,6 @@ void ColorSettingsTab::refillMonitorProfiles(const KoID & colorSpaceId)
}
}
-
//---------------------------------------------------------------------------------------------------
void TabletSettingsTab::setDefault()
@@ -2444,6 +2468,8 @@ bool KisDlgPreferences::editPreferences()
cfg.setDefaultColorDepth(KoColorSpaceRegistry::instance()->colorSpaceColorDepthId(currentWorkingColorSpace.id()).id());
}
+ cfg.writeEntry("ExrDefaultColorProfile", m_colorSettings->m_page->cmbColorProfileForEXR->currentText());
+
cfgImage.setDefaultProofingConfig(m_colorSettings->m_page->proofingSpaceSelector->currentColorSpace(),
m_colorSettings->m_page->cmbProofingIntent->currentIndex(),
m_colorSettings->m_page->ckbProofBlackPoint->isChecked(),
diff --git a/libs/ui/forms/wdgcolorsettings.ui b/libs/ui/forms/wdgcolorsettings.ui
index 9fc9c25fe8..95c872be75 100644
--- a/libs/ui/forms/wdgcolorsettings.ui
+++ b/libs/ui/forms/wdgcolorsettings.ui
@@ -10,7 +10,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>460</width>
+ <width>523</width>
<height>424</height>
</rect>
</property>
@@ -108,7 +108,7 @@
</layout>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QCheckBox" name="chkBlackpoint">
<property name="text">
<string>Use Blackpoint Compensation</string>
@@ -118,7 +118,7 @@
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QCheckBox" name="chkAllowLCMSOptimization">
<property name="text">
<string>Allow Little CMS optimizations (uncheck when using linear light RGB or XYZ)</string>
@@ -128,14 +128,14 @@
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QCheckBox" name="chkForcePaletteColor">
<property name="text">
<string>Enforce palette colors: always select the nearest color from the active palette.</string>
</property>
</widget>
</item>
- <item row="5" column="0" colspan="2">
+ <item row="6" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -148,6 +148,23 @@
</property>
</spacer>
</item>
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="lblEXRImportColorSpace">
+ <property name="text">
+ <string>Color profile for imported EXR files:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KisSqueezedComboBox" name="cmbColorProfileForEXR"/>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
@@ -375,6 +392,11 @@
<extends>QComboBox</extends>
<header>widgets/kis_cmb_idlist.h</header>
</customwidget>
+ <customwidget>
+ <class>KisSqueezedComboBox</class>
+ <extends>QComboBox</extends>
+ <header>KisSqueezedComboBox.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>