Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 652405d3 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Add adaptation state slider.

This allows you to set whether or not to adapt the white point, that is,
to set the white point to the screen white(full slider) or to convert all whiteson screen to the white point of the profile when using absolute colorimetric
as intent.

This is useful to simulate paper-colour.

Ref T2337
parent aea525ca
...@@ -18,13 +18,15 @@ struct KisProofingConfiguration { ...@@ -18,13 +18,15 @@ struct KisProofingConfiguration {
warningColor(KoColor()), warningColor(KoColor()),
proofingProfile("Chemical proof"), proofingProfile("Chemical proof"),
proofingModel("CMYKA"), proofingModel("CMYKA"),
proofingDepth("U8"){} proofingDepth("U8"),
adaptationState(1.0){}
KoColorConversionTransformation::Intent intent; KoColorConversionTransformation::Intent intent;
KoColorConversionTransformation::ConversionFlags conversionFlags; KoColorConversionTransformation::ConversionFlags conversionFlags;
KoColor warningColor; KoColor warningColor;
QString proofingProfile; QString proofingProfile;
QString proofingModel; QString proofingModel;
QString proofingDepth; QString proofingDepth;
double adaptationState;
}; };
......
...@@ -403,7 +403,7 @@ KisProofingConfiguration *KisImageConfig::defaultProofingconfiguration() ...@@ -403,7 +403,7 @@ KisProofingConfiguration *KisImageConfig::defaultProofingconfiguration()
proofingConfig->proofingProfile = m_config.readEntry("defaultProofingProfileName", "Chemical proof"); proofingConfig->proofingProfile = m_config.readEntry("defaultProofingProfileName", "Chemical proof");
proofingConfig->proofingModel = m_config.readEntry("defaultProofingProfileModel", "CMYKA"); proofingConfig->proofingModel = m_config.readEntry("defaultProofingProfileModel", "CMYKA");
proofingConfig->proofingDepth = m_config.readEntry("defaultProofingProfileDepth", "U8"); proofingConfig->proofingDepth = m_config.readEntry("defaultProofingProfileDepth", "U8");
proofingConfig->intent = (KoColorConversionTransformation::Intent)m_config.readEntry("defaultProofingProfileIntent", 4); proofingConfig->intent = (KoColorConversionTransformation::Intent)m_config.readEntry("defaultProofingProfileIntent", 3);
if (m_config.readEntry("defaultProofingBlackpointCompensation", true)) { if (m_config.readEntry("defaultProofingBlackpointCompensation", true)) {
proofingConfig->conversionFlags |= KoColorConversionTransformation::ConversionFlag::BlackpointCompensation; proofingConfig->conversionFlags |= KoColorConversionTransformation::ConversionFlag::BlackpointCompensation;
} else { } else {
...@@ -414,10 +414,11 @@ KisProofingConfiguration *KisImageConfig::defaultProofingconfiguration() ...@@ -414,10 +414,11 @@ KisProofingConfiguration *KisImageConfig::defaultProofingconfiguration()
KoColor col; KoColor col;
col.fromQColor(def); col.fromQColor(def);
proofingConfig->warningColor = col; proofingConfig->warningColor = col;
proofingConfig->adaptationState = (double)m_config.readEntry("defaultProofingAdaptationState", 1.0);
return proofingConfig; return proofingConfig;
} }
void KisImageConfig::setDefaultProofingConfig(const KoColorSpace *proofingSpace, int proofingIntent, bool blackPointCompensation, KoColor warningColor) void KisImageConfig::setDefaultProofingConfig(const KoColorSpace *proofingSpace, int proofingIntent, bool blackPointCompensation, KoColor warningColor, double adaptationState)
{ {
m_config.writeEntry("defaultProofingProfileName", proofingSpace->profile()->name()); m_config.writeEntry("defaultProofingProfileName", proofingSpace->profile()->name());
m_config.writeEntry("defaultProofingProfileModel", proofingSpace->colorModelId().id()); m_config.writeEntry("defaultProofingProfileModel", proofingSpace->colorModelId().id());
...@@ -427,4 +428,5 @@ void KisImageConfig::setDefaultProofingConfig(const KoColorSpace *proofingSpace, ...@@ -427,4 +428,5 @@ void KisImageConfig::setDefaultProofingConfig(const KoColorSpace *proofingSpace,
QColor c; QColor c;
warningColor.toQColor(&c); warningColor.toQColor(&c);
m_config.writeEntry("defaultProofingGamutwarning", c); m_config.writeEntry("defaultProofingGamutwarning", c);
m_config.writeEntry("defaultProofingAdaptationState",adaptationState);
} }
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
void setShowAdditionalOnionSkinsSettings(bool value); void setShowAdditionalOnionSkinsSettings(bool value);
KisProofingConfiguration *defaultProofingconfiguration(); KisProofingConfiguration *defaultProofingconfiguration();
void setDefaultProofingConfig(const KoColorSpace *proofingSpace, int proofingIntent, bool blackPointCompensation, KoColor warningColor); void setDefaultProofingConfig(const KoColorSpace *proofingSpace, int proofingIntent, bool blackPointCompensation, KoColor warningColor, double adaptationState);
private: private:
......
...@@ -49,7 +49,8 @@ public: ...@@ -49,7 +49,8 @@ public:
KoColorProofingConversionTransformation::Intent renderingIntent, KoColorProofingConversionTransformation::Intent renderingIntent,
KoColorProofingConversionTransformation::Intent proofingIntent, KoColorProofingConversionTransformation::Intent proofingIntent,
KoColorProofingConversionTransformation::ConversionFlags conversionFlags, KoColorProofingConversionTransformation::ConversionFlags conversionFlags,
quint8 *gamutWarning) const quint8 *gamutWarning,
double adaptationState) const
{ {
Q_UNUSED(srcColorSpace); Q_UNUSED(srcColorSpace);
Q_UNUSED(dstColorSpace); Q_UNUSED(dstColorSpace);
...@@ -58,6 +59,7 @@ public: ...@@ -58,6 +59,7 @@ public:
Q_UNUSED(proofingIntent); Q_UNUSED(proofingIntent);
Q_UNUSED(conversionFlags); Q_UNUSED(conversionFlags);
Q_UNUSED(gamutWarning); Q_UNUSED(gamutWarning);
Q_UNUSED(adaptationState);
qFatal("createColorProofinTransform undefined."); qFatal("createColorProofinTransform undefined.");
return 0; return 0;
} }
......
...@@ -28,12 +28,14 @@ KoColorProofingConversionTransformation::KoColorProofingConversionTransformation ...@@ -28,12 +28,14 @@ KoColorProofingConversionTransformation::KoColorProofingConversionTransformation
Intent renderingIntent, Intent renderingIntent,
Intent proofingIntent, Intent proofingIntent,
ConversionFlags conversionFlags, ConversionFlags conversionFlags,
quint8 *gamutWarning) quint8 *gamutWarning,
double adaptationState)
: KoColorConversionTransformation(srcCs, dstCs, renderingIntent, conversionFlags) : KoColorConversionTransformation(srcCs, dstCs, renderingIntent, conversionFlags)
{ {
Q_ASSERT(proofingSpace); Q_ASSERT(proofingSpace);
m_proofingIntent = proofingIntent; m_proofingIntent = proofingIntent;
m_gamutWarning = gamutWarning; m_gamutWarning = gamutWarning;
m_adaptationState = adaptationState;
m_proofingSpace = proofingSpace; m_proofingSpace = proofingSpace;
} }
......
...@@ -40,7 +40,8 @@ public: ...@@ -40,7 +40,8 @@ public:
Intent renderingIntent, Intent renderingIntent,
Intent proofingIntent, Intent proofingIntent,
ConversionFlags conversionFlags, ConversionFlags conversionFlags,
quint8 *gamutWarning); quint8 *gamutWarning,
double adaptationState);
virtual ~KoColorProofingConversionTransformation(); virtual ~KoColorProofingConversionTransformation();
public: public:
...@@ -55,6 +56,7 @@ private: ...@@ -55,6 +56,7 @@ private:
Intent m_proofingIntent; Intent m_proofingIntent;
quint8 *m_gamutWarning; quint8 *m_gamutWarning;
double m_adaptationState;
const KoColorSpace *m_proofingSpace; const KoColorSpace *m_proofingSpace;
}; };
......
...@@ -437,14 +437,14 @@ bool KoColorSpace::convertPixelsTo(const quint8 * src, ...@@ -437,14 +437,14 @@ bool KoColorSpace::convertPixelsTo(const quint8 * src,
return true; return true;
} }
KoColorConversionTransformation * KoColorSpace::createProofingTransform(const KoColorSpace *dstColorSpace, const KoColorSpace *proofingSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent proofingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags, quint8 *gamutWarning) const KoColorConversionTransformation * KoColorSpace::createProofingTransform(const KoColorSpace *dstColorSpace, const KoColorSpace *proofingSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent proofingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags, quint8 *gamutWarning, double adaptationState) const
{ {
if (!d->iccEngine) { if (!d->iccEngine) {
d->iccEngine = KoColorSpaceEngineRegistry::instance()->get("icc"); d->iccEngine = KoColorSpaceEngineRegistry::instance()->get("icc");
} }
if (!d->iccEngine) return 0; if (!d->iccEngine) return 0;
return d->iccEngine->createColorProofingTransformation(this, dstColorSpace, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning); return d->iccEngine->createColorProofingTransformation(this, dstColorSpace, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning, adaptationState);
} }
bool KoColorSpace::proofPixelsTo(const quint8 *src, bool KoColorSpace::proofPixelsTo(const quint8 *src,
......
...@@ -377,7 +377,7 @@ public: ...@@ -377,7 +377,7 @@ public:
KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::Intent proofingIntent, KoColorConversionTransformation::Intent proofingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags, KoColorConversionTransformation::ConversionFlags conversionFlags,
quint8 *gamutWarning) const; quint8 *gamutWarning, double adaptationState) const;
/** /**
* @brief proofPixelsTo * @brief proofPixelsTo
* @param src * @param src
...@@ -389,6 +389,7 @@ public: ...@@ -389,6 +389,7 @@ public:
* @param proofingIntent the intent used for proofing. * @param proofingIntent the intent used for proofing.
* @param conversionFlags the conversion flags. * @param conversionFlags the conversion flags.
* @param gamutWarning the data() of a KoColor. * @param gamutWarning the data() of a KoColor.
* @param adaptationState the state of adaptation, only affects absolute colorimetric.
* @return * @return
*/ */
virtual bool proofPixelsTo(const quint8 * src, virtual bool proofPixelsTo(const quint8 * src,
......
...@@ -95,6 +95,9 @@ KisDlgImageProperties::KisDlgImageProperties(KisImageWSP image, QWidget *parent, ...@@ -95,6 +95,9 @@ KisDlgImageProperties::KisDlgImageProperties(KisImageWSP image, QWidget *parent,
m_gamutWarning->setCurrentColor(m_proofingConfig->warningColor); m_gamutWarning->setCurrentColor(m_proofingConfig->warningColor);
m_gamutWarning->setToolTip(i18n("Set color used for warning")); m_gamutWarning->setToolTip(i18n("Set color used for warning"));
m_page->gamutAlarm->setDefaultAction(m_gamutWarning); m_page->gamutAlarm->setDefaultAction(m_gamutWarning);
m_page->sldAdaptationState->setMaximum(20);
m_page->sldAdaptationState->setMinimum(0);
m_page->sldAdaptationState->setValue((int)m_proofingConfig->adaptationState*20);
KisSignalCompressor *softProofConfigCompressor = new KisSignalCompressor(500, KisSignalCompressor::POSTPONE,this); KisSignalCompressor *softProofConfigCompressor = new KisSignalCompressor(500, KisSignalCompressor::POSTPONE,this);
...@@ -102,6 +105,7 @@ KisDlgImageProperties::KisDlgImageProperties(KisImageWSP image, QWidget *parent, ...@@ -102,6 +105,7 @@ KisDlgImageProperties::KisDlgImageProperties(KisImageWSP image, QWidget *parent,
connect(m_page->proofSpaceSelector, SIGNAL(colorSpaceChanged(const KoColorSpace*)), softProofConfigCompressor, SLOT(start())); connect(m_page->proofSpaceSelector, SIGNAL(colorSpaceChanged(const KoColorSpace*)), softProofConfigCompressor, SLOT(start()));
connect(m_page->cmbIntent, SIGNAL(currentIndexChanged(int)), softProofConfigCompressor, SLOT(start())); connect(m_page->cmbIntent, SIGNAL(currentIndexChanged(int)), softProofConfigCompressor, SLOT(start()));
connect(m_page->ckbBlackPointComp, SIGNAL(stateChanged(int)), softProofConfigCompressor, SLOT(start())); connect(m_page->ckbBlackPointComp, SIGNAL(stateChanged(int)), softProofConfigCompressor, SLOT(start()));
connect(m_page->sldAdaptationState, SIGNAL(valueChanged(int)), softProofConfigCompressor, SLOT(start()));
connect(softProofConfigCompressor, SIGNAL(timeout()), this, SLOT(setProofingConfig())); connect(softProofConfigCompressor, SIGNAL(timeout()), this, SLOT(setProofingConfig()));
...@@ -150,7 +154,7 @@ void KisDlgImageProperties::setProofingConfig() ...@@ -150,7 +154,7 @@ void KisDlgImageProperties::setProofingConfig()
m_proofingConfig->proofingModel = m_page->proofSpaceSelector->currentColorSpace()->colorModelId().id(); m_proofingConfig->proofingModel = m_page->proofSpaceSelector->currentColorSpace()->colorModelId().id();
m_proofingConfig->proofingDepth = "U8";//default to this m_proofingConfig->proofingDepth = "U8";//default to this
m_proofingConfig->warningColor = m_gamutWarning->currentKoColor(); m_proofingConfig->warningColor = m_gamutWarning->currentKoColor();
m_proofingConfig->adaptationState = (double)m_page->sldAdaptationState->value()/20.0;
qDebug()<<"set proofing config in properties: "<<m_proofingConfig->proofingProfile; qDebug()<<"set proofing config in properties: "<<m_proofingConfig->proofingProfile;
m_image->setProofingConfiguration(m_proofingConfig); m_image->setProofingConfiguration(m_proofingConfig);
} }
......
...@@ -344,6 +344,9 @@ ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name) ...@@ -344,6 +344,9 @@ ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name)
m_gamutWarning->setToolTip(i18n("Set default color used for out of Gamut Warning")); m_gamutWarning->setToolTip(i18n("Set default color used for out of Gamut Warning"));
m_gamutWarning->setCurrentColor(proofingConfig->warningColor); m_gamutWarning->setCurrentColor(proofingConfig->warningColor);
m_page->gamutAlarm->setDefaultAction(m_gamutWarning); m_page->gamutAlarm->setDefaultAction(m_gamutWarning);
m_page->sldAdaptationState->setMaximum(20);
m_page->sldAdaptationState->setMinimum(0);
m_page->sldAdaptationState->setValue((int)proofingConfig->adaptationState*20);
const KoColorSpace *proofingSpace = KoColorSpaceRegistry::instance()->colorSpace(proofingConfig->proofingModel,proofingConfig->proofingDepth,proofingConfig->proofingProfile); const KoColorSpace *proofingSpace = KoColorSpaceRegistry::instance()->colorSpace(proofingConfig->proofingModel,proofingConfig->proofingDepth,proofingConfig->proofingProfile);
m_page->proofingSpaceSelector->setCurrentColorSpace(proofingSpace); m_page->proofingSpaceSelector->setCurrentColorSpace(proofingSpace);
...@@ -446,6 +449,7 @@ void ColorSettingsTab::setDefault() ...@@ -446,6 +449,7 @@ void ColorSettingsTab::setDefault()
m_page->proofingSpaceSelector->setCurrentColorSpace(proofingSpace); m_page->proofingSpaceSelector->setCurrentColorSpace(proofingSpace);
m_page->cmbProofingIntent->setCurrentIndex((int)proofingConfig->intent); m_page->cmbProofingIntent->setCurrentIndex((int)proofingConfig->intent);
m_page->ckbProofBlackPoint->setChecked(proofingConfig->conversionFlags.testFlag(KoColorConversionTransformation::BlackpointCompensation)); m_page->ckbProofBlackPoint->setChecked(proofingConfig->conversionFlags.testFlag(KoColorConversionTransformation::BlackpointCompensation));
m_page->sldAdaptationState->setValue(0);
m_gamutWarning->setCurrentColor(proofingConfig->warningColor); m_gamutWarning->setCurrentColor(proofingConfig->warningColor);
...@@ -987,7 +991,7 @@ bool KisDlgPreferences::editPreferences() ...@@ -987,7 +991,7 @@ bool KisDlgPreferences::editPreferences()
cfg.setWorkingColorSpace(dialog->m_colorSettings->m_page->cmbWorkingColorSpace->currentItem().id()); cfg.setWorkingColorSpace(dialog->m_colorSettings->m_page->cmbWorkingColorSpace->currentItem().id());
KisImageConfig cfgImage; KisImageConfig cfgImage;
cfgImage.setDefaultProofingConfig(dialog->m_colorSettings->m_page->proofingSpaceSelector->currentColorSpace(), dialog->m_colorSettings->m_page->cmbProofingIntent->currentIndex(), dialog->m_colorSettings->m_page->ckbProofBlackPoint->isChecked(), dialog->m_colorSettings->m_gamutWarning->currentKoColor()); cfgImage.setDefaultProofingConfig(dialog->m_colorSettings->m_page->proofingSpaceSelector->currentColorSpace(), dialog->m_colorSettings->m_page->cmbProofingIntent->currentIndex(), dialog->m_colorSettings->m_page->ckbProofBlackPoint->isChecked(), dialog->m_colorSettings->m_gamutWarning->currentKoColor(), (double)dialog->m_colorSettings->m_page->sldAdaptationState->value()/20);
cfg.setUseBlackPointCompensation(dialog->m_colorSettings->m_page->chkBlackpoint->isChecked()); cfg.setUseBlackPointCompensation(dialog->m_colorSettings->m_page->chkBlackpoint->isChecked());
cfg.setAllowLCMSOptimization(dialog->m_colorSettings->m_page->chkAllowLCMSOptimization->isChecked()); cfg.setAllowLCMSOptimization(dialog->m_colorSettings->m_page->chkAllowLCMSOptimization->isChecked());
cfg.setPasteBehaviour(dialog->m_colorSettings->m_pasteBehaviourGroup.checkedId()); cfg.setPasteBehaviour(dialog->m_colorSettings->m_pasteBehaviourGroup.checkedId());
......
...@@ -189,14 +189,41 @@ ...@@ -189,14 +189,41 @@
<string>Soft Proof Options</string> <string>Soft Proof Options</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="4" column="2"> <item row="5" column="1">
<widget class="QToolButton" name="gamutAlarm"> <widget class="QToolButton" name="gamutAlarm">
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="0">
<widget class="QLabel" name="lblProofingIntent">
<property name="text">
<string>Proofing Rendering Intent:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="KisColorSpaceSelector" name="proofingSpaceSelector" native="true"/>
</item>
<item row="5" column="2" colspan="2">
<widget class="QCheckBox" name="ckbProofBlackPoint">
<property name="text">
<string>Back Point Compensation</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblGamutWarning">
<property name="text">
<string>Gamut Warning:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QComboBox" name="cmbProofingIntent"> <widget class="QComboBox" name="cmbProofingIntent">
<item> <item>
<property name="text"> <property name="text">
...@@ -220,27 +247,20 @@ ...@@ -220,27 +247,20 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1" colspan="3">
<widget class="QLabel" name="label"> <widget class="QSlider" name="sldAdaptationState">
<property name="text"> <property name="orientation">
<string>Gamut Warning</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="3">
<widget class="KisColorSpaceSelector" name="proofingSpaceSelector" native="true"/>
</item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="ckbProofBlackPoint"> <widget class="QLabel" name="lblAdaptationState">
<property name="text"> <property name="text">
<string>Back Point Compensation</string> <string>Adaptation State:</string>
</property> </property>
</widget> <property name="alignment">
</item> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Proofing Rendering Intent:</string>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -227,34 +227,63 @@ ...@@ -227,34 +227,63 @@
<string>Softproofing</string> <string>Softproofing</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="2" column="2"> <item row="3" column="1">
<widget class="QToolButton" name="gamutAlarm"> <widget class="QToolButton" name="gamutAlarm">
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="lblGamutWarning">
<property name="text"> <property name="text">
<string>Gamut Warning:</string> <string>Gamut Warning:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="lblAdaptationState">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Adaptation State:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QSlider" name="sldAdaptationState">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set how much you wish to correct the adaptation state. This will affect how &lt;span style=&quot; font-style:italic;&quot;&gt;Absolute Colorimetric&lt;/span&gt; changes the whites of your image. In Layman's terms: how much do you wish to have the color management correct the paper-color to screen white while using &lt;span style=&quot; font-style:italic;&quot;&gt;Absolute Colorimetric&lt;/span&gt;?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QCheckBox" name="ckbBlackPointComp"> <widget class="QCheckBox" name="ckbBlackPointComp">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Black Point compensation matches the darkest color of the source device to the darkest color of the destination device. Relative Colorimetric without Black Point Compensation will show the difference between the darkest values. With blackpoint compensation, black is black.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text"> <property name="text">
<string>Black Point Compenstation</string> <string>Black Point Compensation</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="3"> <item row="0" column="0" colspan="4">
<widget class="KisColorSpaceSelector" name="proofSpaceSelector" native="true"/>
</item>
<item row="1" column="0" colspan="4">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Rendering Intent</string> <string>Rendering Intent</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<item row="1" column="1"> <item row="0" column="0" colspan="2">
<widget class="QComboBox" name="cmbIntent"> <widget class="QComboBox" name="cmbIntent">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
...@@ -284,9 +313,6 @@ ...@@ -284,9 +313,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="3">
<widget class="KisColorSpaceSelector" name="proofSpaceSelector" native="true"/>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
......
...@@ -281,6 +281,10 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element) ...@@ -281,6 +281,10 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
proofingConfig->intent = (KoColorConversionTransformation::Intent) KisDomUtils::toInt(attr); proofingConfig->intent = (KoColorConversionTransformation::Intent) KisDomUtils::toInt(attr);
} }
if (!(attr = element.attribute(PROOFINGADAPTATIONSTATE)).isNull()) {
proofingConfig->adaptationState = KisDomUtils::toDouble(attr);
}
if (m_d->document) { if (m_d->document) {
image = new KisImage(m_d->document->createUndoStore(), width, height, cs, name); image = new KisImage(m_d->document->createUndoStore(), width, height, cs, name);
} }
......
...@@ -108,6 +108,7 @@ QDomElement KisKraSaver::saveXML(QDomDocument& doc, KisImageWSP image) ...@@ -108,6 +108,7 @@ QDomElement KisKraSaver::saveXML(QDomDocument& doc, KisImageWSP image)
imageElement.setAttribute(PROOFINGMODEL, KisDomUtils::toString(image->proofingConfiguration()->proofingModel)); imageElement.setAttribute(PROOFINGMODEL, KisDomUtils::toString(image->proofingConfiguration()->proofingModel));
imageElement.setAttribute(PROOFINGDEPTH, KisDomUtils::toString(image->proofingConfiguration()->proofingDepth)); imageElement.setAttribute(PROOFINGDEPTH, KisDomUtils::toString(image->proofingConfiguration()->proofingDepth));
imageElement.setAttribute(PROOFINGINTENT, KisDomUtils::toString(image->proofingConfiguration()->intent)); imageElement.setAttribute(PROOFINGINTENT, KisDomUtils::toString(image->proofingConfiguration()->intent));
imageElement.setAttribute(PROOFINGADAPTATIONSTATE, KisDomUtils::toString(image->proofingConfiguration()->adaptationState));
quint32 count = 1; // We don't save the root layer, but it does count quint32 count = 1; // We don't save the root layer, but it does count
KisSaveXmlVisitor visitor(doc, imageElement, count, m_d->doc->url().toLocalFile(), true); KisSaveXmlVisitor visitor(doc, imageElement, count, m_d->doc->url().toLocalFile(), true);
......
...@@ -115,6 +115,7 @@ const QString PROOFINGMODEL = "proofing-model"; ...@@ -115,6 +115,7 @@ const QString PROOFINGMODEL = "proofing-model";
const QString PROOFINGDEPTH = "proofing-depth"; const QString PROOFINGDEPTH = "proofing-depth";
const QString PROOFINGINTENT = "proofing-intent"; const QString PROOFINGINTENT = "proofing-intent";
const QString PROOFINGWARNINGCOLOR ="ProofingWarningColor"; const QString PROOFINGWARNINGCOLOR ="ProofingWarningColor";
const QString PROOFINGADAPTATIONSTATE = "proofing-adaptation-state";
const QString ICCPROOFINGPROFILE ="icc-proofing-profile"; const QString ICCPROOFINGPROFILE ="icc-proofing-profile";
const QString CANVASPROJECTIONCOLOR = "ProjectionBackgroundColor"; const QString CANVASPROJECTIONCOLOR = "ProjectionBackgroundColor";
const QString COLORBYTEDATA = "ColorData"; const QString COLORBYTEDATA = "ColorData";
......
...@@ -332,7 +332,7 @@ KisOpenGLUpdateInfoSP KisOpenGLImageTextures::updateCacheImpl(const QRect& rect, ...@@ -332,7 +332,7 @@ KisOpenGLUpdateInfoSP KisOpenGLImageTextures::updateCacheImpl(const QRect& rect,
//create transform //create transform
if (m_createNewProofingTransform) { if (m_createNewProofingTransform) {
const KoColorSpace *proofingSpace = KoColorSpaceRegistry::instance()->colorSpace(m_proofingConfig->proofingModel,m_proofingConfig->proofingDepth,m_proofingConfig->proofingProfile); const KoColorSpace *proofingSpace = KoColorSpaceRegistry::instance()->colorSpace(m_proofingConfig->proofingModel,m_proofingConfig->proofingDepth,m_proofingConfig->proofingProfile);
m_proofingTransform = tileInfo->generateProofingTransform(dstCS, proofingSpace, m_renderingIntent, m_proofingConfig->intent, m_proofingConfig->conversionFlags, m_proofingConfig->warningColor); m_proofingTransform = tileInfo->generateProofingTransform(dstCS, proofingSpace, m_renderingIntent, m_proofingConfig->intent, m_proofingConfig->conversionFlags, m_proofingConfig->warningColor, m_proofingConfig->adaptationState);
m_createNewProofingTransform = false; m_createNewProofingTransform = false;
} }
......
...@@ -232,9 +232,10 @@ public: ...@@ -232,9 +232,10 @@ public:
KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::Intent proofingIntent, KoColorConversionTransformation::Intent proofingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags, KoColorConversionTransformation::ConversionFlags conversionFlags,
KoColor gamutWarning) KoColor gamutWarning,
double adaptationState)
{ {
return m_patchColorSpace->createProofingTransform(dstCS, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning.data()); return m_patchColorSpace->createProofingTransform(dstCS, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning.data(), adaptationState);
} }
inline quint8* data() const { inline quint8* data() const {
......
...@@ -103,9 +103,10 @@ public: ...@@ -103,9 +103,10 @@ public:
Intent renderingIntent, Intent renderingIntent,
Intent proofingIntent, Intent proofingIntent,
ConversionFlags conversionFlags, ConversionFlags conversionFlags,
quint8 *gamutWarning quint8 *gamutWarning,
double adaptationState
) )
: KoColorProofingConversionTransformation(srcCs, dstCs, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning) : KoColorProofingConversionTransformation(srcCs, dstCs, proofingSpace, renderingIntent, proofingIntent, conversionFlags, gamutWarning, adaptationState)
, m_transform(0) , m_transform(0)
{ {
Q_ASSERT(srcCs); Q_ASSERT(srcCs);
...@@ -127,6 +128,7 @@ public: ...@@ -127,6 +128,7 @@ public:
alarm[1] = (cmsUInt16Number)gamutWarning[1]*256; alarm[1] = (cmsUInt16Number)gamutWarning[1]*256;
alarm[2] = (cmsUInt16Number)gamutWarning[0]*256; alarm[2] = (cmsUInt16Number)gamutWarning[0]*256;
cmsSetAlarmCodes(alarm); cmsSetAlarmCodes(alarm);
cmsSetAdaptationState(adaptationState);
m_transform = cmsCreateProofingTransform(srcProfile->lcmsProfile(), m_transform = cmsCreateProofingTransform(srcProfile->lcmsProfile(),
srcColorSpaceType, srcColorSpaceType,
...@@ -136,6 +138,7 @@ public: ...@@ -136,6 +138,7 @@ public:
renderingIntent, renderingIntent,
proofingIntent, proofingIntent,
conversionFlags); conversionFlags);
cmsSetAdaptationState(1);
Q_ASSERT(m_transform); Q_ASSERT(m_transform);
} }
...@@ -153,6 +156,7 @@ public: ...@@ -153,6 +156,7 @@ public:
qint32 srcPixelSize = srcColorSpace()->pixelSize(); qint32 srcPixelSize = srcColorSpace()->pixelSize();
qint32 dstPixelSize = dstColorSpace()->pixelSize(); qint32 dstPixelSize = dstColorSpace()->pixelSize();
//cmsSetAdaptationState(0);
cmsDoTransform(m_transform, const_cast<quint8 *>(src), dst, numPixels); cmsDoTransform(m_transform, const_cast<quint8 *>(src), dst, numPixels);
// Lcms does nothing to the destination alpha channel so we must convert that manually. // Lcms does nothing to the destination alpha channel so we must convert that manually.
...@@ -164,6 +168,7 @@ public: ...@@ -164,6 +168,7 @@ public:
dst += dstPixelSize; dst += dstPixelSize;
numPixels--; numPixels--;
} }
//cmsSetAdaptationState(1);