[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/krita-testing-wolthera] /: Add basis new widget for profile selection
From: Wolthera van Hovell <griffinvalley () gmail ! com>
Date: 2015-08-18 17:13:52
Message-ID: E1ZRkSO-0005WA-9x () scm ! kde ! org
[Download RAW message or body]
Git commit 4ef754e3abffe11db451f985bb297de1e55ba5bf by Wolthera van Hovell.
Committed on 18/08/2015 at 17:07.
Pushed by woltherav into branch 'krita-testing-wolthera'.
Add basis new widget for profile selection
This is the basis for a new widget for profile selection
that allows the user to examine the many profiles Krita ships.
Central CIETongue widget is based on DigiKam's, as mentioned in the
credits.
Todo:
*Make OK/Cancel actually do things.
*Figure out how to unadapt from D50.
*Figure out how to understand if a profile uses L* trc.
*Figure out how to give nicer feedback for CMYK/XYZ/LAB/YCbCr/Gray.
*Make widget prettier.
*Clean-up, don't be shy to nag me about this.
M +3 -0 krita/ui/CMakeLists.txt
M +7 -0 krita/ui/forms/wdgcolorspaceselector.ui
A +213 -0 krita/ui/forms/wdgcolorspaceselectoradvanced.ui
A +341 -0 krita/ui/widgets/kis_advanced_color_space_selector.cc [License: GPL (v2+)]
C +16 -13 krita/ui/widgets/kis_advanced_color_space_selector.h [from: \
krita/ui/widgets/kis_color_space_selector.h - 069% similarity] A +577 -0 \
krita/ui/widgets/kis_cie_tongue_widget.cpp [License: GPL (v2+)] A +94 -0 \
krita/ui/widgets/kis_cie_tongue_widget.h [License: GPL (v2+)] M +22 -18 \
krita/ui/widgets/kis_color_space_selector.cc M +4 -0 \
krita/ui/widgets/kis_color_space_selector.h M +5 -1 libs/pigment/KoColorProfile.h
M +7 -0 libs/pigment/colorprofiles/KoDummyColorProfile.cpp
M +1 -0 libs/pigment/colorprofiles/KoDummyColorProfile.h
M +8 -0 plugins/colorengines/lcms2/colorprofiles/IccColorProfile.cpp
M +2 -0 plugins/colorengines/lcms2/colorprofiles/IccColorProfile.h
M +53 -3 plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.cpp
M +1 -0 plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.h
http://commits.kde.org/calligra/4ef754e3abffe11db451f985bb297de1e55ba5bf
diff --git a/krita/ui/CMakeLists.txt b/krita/ui/CMakeLists.txt
index 8f76575..1fedbd8 100644
--- a/krita/ui/CMakeLists.txt
+++ b/krita/ui/CMakeLists.txt
@@ -194,6 +194,8 @@ set(kritaui_LIB_SRCS
widgets/kis_paintop_list_widget.cpp
widgets/kis_cmb_idlist.cc
widgets/kis_color_space_selector.cc
+ widgets/kis_advanced_color_space_selector.cc
+ widgets/kis_cie_tongue_widget.cpp
widgets/kis_curve_widget.cpp
widgets/kis_custom_image_widget.cc
widgets/kis_image_from_clipboard_widget.cpp
@@ -388,6 +390,7 @@ kde4_add_ui_files(kritaui_LIB_SRCS
forms/wdgcolorsettings.ui
forms/wdgtabletsettings.ui
forms/wdgcolorspaceselector.ui
+ forms/wdgcolorspaceselectoradvanced.ui
forms/wdgdisplaysettings.ui
forms/kis_previewwidgetbase.ui
forms/kis_matrix_widget.ui
diff --git a/krita/ui/forms/wdgcolorspaceselector.ui b/krita/ui/forms/wdgcolorspaceselector.ui
index b37ed4f..5155bc1 100644
--- a/krita/ui/forms/wdgcolorspaceselector.ui
+++ b/krita/ui/forms/wdgcolorspaceselector.ui
@@ -139,6 +139,13 @@
</property>
</widget>
</item>
+ <item row="4" column="1">
+ <widget class="QPushButton" name="bnAdvanced">
+ <property name="text">
+ <string>Choose Color Space</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<customwidgets>
diff --git a/krita/ui/forms/wdgcolorspaceselectoradvanced.ui \
b/krita/ui/forms/wdgcolorspaceselectoradvanced.ui new file mode 100644
index 0000000..3009ac9
--- /dev/null
+++ b/krita/ui/forms/wdgcolorspaceselectoradvanced.ui
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WdgColorSpaceSelectorAdvanced</class>
+ <widget class="QWidget" name="WdgColorSpaceSelectorAdvanced">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>632</width>
+ <height>403</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item row="5" column="2">
+ <widget class="QDialogButtonBox" name="bnOK">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="2">
+ <widget class="QPlainTextEdit" name="textProfileDescription"/>
+ </item>
+ <item row="0" column="1" rowspan="2" colspan="2">
+ <widget class="QLabel" name="lbl_descriptionwidget">
+ <property name="text">
+ <string>Color Spaces determine how colors are encoded and thus what the result of \
Krita's color maths(like blending and filters) should look like. All spaces have advantages and \
disadvantages, so this widget will help you choose the right space for the right job.</string> \
+ </property> + <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" rowspan="2">
+ <widget class="KisCIETongueWidget" name="TongueWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>400</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" rowspan="2">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Profile Properties</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="lbltrc">
+ <property name="text">
+ <string>TRC</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lblWhitepoint">
+ <property name="text">
+ <string>White Point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="lblRed">
+ <property name="text">
+ <string>Red</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="lblXYZ_W">
+ <property name="text">
+ <string>xyz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="lblXYZ_R">
+ <property name="text">
+ <string>xyz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="lblGreen">
+ <property name="text">
+ <string>Green</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="lblBlue">
+ <property name="text">
+ <string>Blue</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="lblXYZ_G">
+ <property name="text">
+ <string>xyz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="lblXYZ_B">
+ <property name="text">
+ <string>xyz</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="0" column="0" rowspan="6">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Profile Picker</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Model</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Depth</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Profile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QListWidget" name="lstProfile">
+ <property name="showDropIndicator" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KisCmbIDList" name="cmbColorModels"/>
+ </item>
+ <item row="1" column="1">
+ <widget class="KisCmbIDList" name="cmbColorDepth"/>
+ </item>
+ <item row="4" column="1">
+ <widget class="QPushButton" name="bnInstallProfile">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KisCmbIDList</class>
+ <extends>QComboBox</extends>
+ <header>widgets/kis_cmb_idlist.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KisCIETongueWidget</class>
+ <extends>QWidget</extends>
+ <header>widgets/kis_cie_tongue_widget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/krita/ui/widgets/kis_advanced_color_space_selector.cc \
b/krita/ui/widgets/kis_advanced_color_space_selector.cc new file mode 100644
index 0000000..2addf59
--- /dev/null
+++ b/krita/ui/widgets/kis_advanced_color_space_selector.cc
@@ -0,0 +1,341 @@
+/*
+ * Copyright (C) 2007 Cyrille Berger <cberger@cberger.net>
+ * Copyright (C) 2011 Boudewijn Rempt <boud@valdyas.org>
+ * Copyright (C) 2011 Srikanth Tiyyagura <srikanth.tulasiram@gmail.com>
+ * Copyright (C) 2015 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "kis_advanced_color_space_selector.h"
+
+#include <KoFileDialog.h>
+#include <KoColorProfile.h>
+#include <KoColorSpace.h>
+#include <KoColorSpaceRegistry.h>
+#include <KoColorSpaceEngine.h>
+#include <KoID.h>
+
+#include <KoConfig.h>
+#include <KoIcon.h>
+
+#ifdef GHNS
+#include <knewstuff3/downloaddialog.h>
+#include <knewstuff3/uploaddialog.h>
+#endif
+
+#include <QDesktopServices>
+
+#include <kcomponentdata.h>
+#include <kstandarddirs.h>
+#include <kglobal.h>
+
+#include "kis_factory2.h"
+
+#include "ui_wdgcolorspaceselectoradvanced.h"
+
+struct KisAdvancedColorSpaceSelector::Private {
+ Ui_WdgColorSpaceSelectorAdvanced* colorSpaceSelector;
+ QString knsrcFile;
+};
+
+KisAdvancedColorSpaceSelector::KisAdvancedColorSpaceSelector(QWidget* parent, const QString \
&caption) : QDialog(parent), d(new Private) +{
+
+ setObjectName("KisAdvancedColorSpaceSelector");
+ setWindowTitle(caption);
+ d->colorSpaceSelector = new Ui_WdgColorSpaceSelectorAdvanced;
+ d->colorSpaceSelector->setupUi(this);
+ d->colorSpaceSelector->cmbColorModels->setIDList(KoColorSpaceRegistry::instance()->colorModelsList(KoColorSpaceRegistry::OnlyUserVisible));
+ fillCmbDepths(d->colorSpaceSelector->cmbColorModels->currentItem());
+
+ d->colorSpaceSelector->bnInstallProfile->setIcon(themedIcon("document-open"));
+ d->colorSpaceSelector->bnInstallProfile->setToolTip( i18n("Open Color Profile") );
+ connect(d->colorSpaceSelector->cmbColorModels, SIGNAL(activated(const KoID &)),
+ this, SLOT(fillCmbDepths(const KoID &)));
+ connect(d->colorSpaceSelector->cmbColorDepth, SIGNAL(activated(const KoID &)),
+ this, SLOT(fillLstProfiles()));
+ connect(d->colorSpaceSelector->cmbColorModels, SIGNAL(activated(const KoID &)),
+ this, SLOT(fillLstProfiles()));
+ connect(d->colorSpaceSelector->lstProfile, SIGNAL(currentItemChanged(QListWidgetItem*, \
QListWidgetItem*)), + this, SLOT(colorSpaceChanged()));
+ //connect(d->colorSpaceSelector->lstProfile, SIGNAL(currentItemChanged(int)),
+ // this, SLOT(buttonUpdate()));
+ connect(this, SIGNAL(selectionChanged(bool)),
+ this, SLOT(fillDescription()));
+ connect(this, SIGNAL(selectionChanged(bool)), d->colorSpaceSelector->TongueWidget, \
SLOT(repaint())); +
+
+ connect(d->colorSpaceSelector->bnInstallProfile, SIGNAL(clicked()), this, \
SLOT(installProfile())); +
+ //connect(d->colorSpaceSelector->bnOK, SIGNAL(accepted()), this, (accept()));
+ //connect(d->colorSpaceSelector->bnOK, SIGNAL(rejected()), this, (reject()));
+
+ d->knsrcFile = "kritaiccprofiles.knsrc";
+ fillLstProfiles();
+}
+
+KisAdvancedColorSpaceSelector::~KisAdvancedColorSpaceSelector()
+{
+ delete d->colorSpaceSelector;
+ delete d;
+}
+
+void KisAdvancedColorSpaceSelector::fillLstProfiles()
+{
+ QString s = KoColorSpaceRegistry::instance()->colorSpaceId(d->colorSpaceSelector->cmbColorModels->currentItem(), \
d->colorSpaceSelector->cmbColorDepth->currentItem()); + \
d->colorSpaceSelector->lstProfile->clear(); +
+ const KoColorSpaceFactory * csf = KoColorSpaceRegistry::instance()->colorSpaceFactory(s);
+ if (csf == 0) return;//TODO: make this give better feedback.
+
+ QList<const KoColorProfile *> profileList = \
KoColorSpaceRegistry::instance()->profilesFor(csf); + QListWidgetItem *defaultProfile = new \
QListWidgetItem; + defaultProfile->setText(csf->defaultProfile()+" "+i18n("(Default)"));
+ foreach(const KoColorProfile *profile, profileList) {
+ if (profile->name()==csf->defaultProfile()) {
+ d->colorSpaceSelector->lstProfile->addItem(defaultProfile);
+ } else {
+ d->colorSpaceSelector->lstProfile->addItem(profile->name());
+ }
+ }
+ d->colorSpaceSelector->lstProfile->setCurrentItem(defaultProfile);
+ colorSpaceChanged();
+}
+
+void KisAdvancedColorSpaceSelector::fillCmbDepths(const KoID& id)
+{
+ KoID activeDepth = d->colorSpaceSelector->cmbColorDepth->currentItem();
+ d->colorSpaceSelector->cmbColorDepth->clear();
+ QList<KoID> depths = KoColorSpaceRegistry::instance()->colorDepthList(id, \
KoColorSpaceRegistry::OnlyUserVisible); + \
d->colorSpaceSelector->cmbColorDepth->setIDList(depths); + if (depths.contains(activeDepth)) \
{ + d->colorSpaceSelector->cmbColorDepth->setCurrent(activeDepth);
+ }
+}
+
+void KisAdvancedColorSpaceSelector::fillDescription()
+{
+ QString notApplicable = i18n("N/A");
+ QString notApplicableTooltip = i18n("This profile has no colorants.");
+ QString profileName = "No Profile Found";
+ //set colorants
+ QString s = KoColorSpaceRegistry::instance()->colorSpaceId(d->colorSpaceSelector->cmbColorModels->currentItem(), \
d->colorSpaceSelector->cmbColorDepth->currentItem()); + const KoColorSpaceFactory * csf = \
KoColorSpaceRegistry::instance()->colorSpaceFactory(s); + if (csf == 0) return;
+ QList<const KoColorProfile *> profileList = \
KoColorSpaceRegistry::instance()->profilesFor(csf); + if (profileList.isEmpty()==false) {
+ profileName = currentColorSpace()->profile()->name();
+ if (currentColorSpace()->profile()->hasColorants()){
+ QVector <double> colorants = currentColorSpace()->profile()->getColorantsxyY();
+ QVector <double> whitepoint = currentColorSpace()->profile()->getWhitePointxyY();
+ //QString text = currentColorSpace()->profile()->info()+" ="+
+ d->colorSpaceSelector->TongueWidget->setEnabled(true);
+ d->colorSpaceSelector->TongueWidget->setProfileData(colorants, whitepoint, true);
+ d->colorSpaceSelector->lblXYZ_W->setText(QString::number(whitepoint[0])+", \
"+QString::number(whitepoint[1])+", "+QString::number(whitepoint[2])); + \
d->colorSpaceSelector->lblXYZ_R->setText(QString::number(colorants[0])+", \
"+QString::number(colorants[1])+", "+QString::number(colorants[2])); + \
d->colorSpaceSelector->lblXYZ_G->setText(QString::number(colorants[3])+", \
"+QString::number(colorants[4])+", "+QString::number(colorants[5])); + \
d->colorSpaceSelector->lblXYZ_B->setText(QString::number(colorants[6])+", \
"+QString::number(colorants[7])+", "+QString::number(colorants[8])); + \
d->colorSpaceSelector->lblXYZ_R->setToolTip("Colorant in d50-adapted xyY."); + \
d->colorSpaceSelector->lblXYZ_G->setToolTip("Colorant in d50-adapted xyY."); + \
d->colorSpaceSelector->lblXYZ_B->setToolTip("Colorant in d50-adapted xyY."); + } else {
+ QVector <double> whitepoint2 = currentColorSpace()->profile()->getWhitePointxyY();
+ d->colorSpaceSelector->TongueWidget->setEnabled(false);
+ d->colorSpaceSelector->lblXYZ_W->setText(QString::number(whitepoint2[0])+", \
"+QString::number(whitepoint2[1])+", "+QString::number(whitepoint2[2])); +
+ d->colorSpaceSelector->lblXYZ_R->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_R->setToolTip(notApplicableTooltip);
+ d->colorSpaceSelector->lblXYZ_G->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_G->setToolTip(notApplicableTooltip);
+ d->colorSpaceSelector->lblXYZ_B->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_B->setToolTip(notApplicableTooltip);
+ }
+ } else {
+ d->colorSpaceSelector->TongueWidget->setEnabled(false);
+ d->colorSpaceSelector->lblXYZ_W->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_W->setToolTip(notApplicableTooltip);
+ d->colorSpaceSelector->lblXYZ_R->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_R->setToolTip(notApplicableTooltip);
+ d->colorSpaceSelector->lblXYZ_G->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_G->setToolTip(notApplicableTooltip);
+ d->colorSpaceSelector->lblXYZ_B->setText(notApplicable);
+ d->colorSpaceSelector->lblXYZ_B->setToolTip(notApplicableTooltip);
+ }
+
+ //set TRC
+ QVector <double> estimatedTRC(3);
+ QString currentModelStr = d->colorSpaceSelector->cmbColorModels->currentItem().id();
+ if (currentModelStr == "RGBA") {
+ estimatedTRC = currentColorSpace()->profile()->getEstimatedTRC();
+ if (estimatedTRC[0] == -1) {
+ d->colorSpaceSelector->lbltrc->setToolTip("The Tone Response curve of this color \
space is the sRGB trc, which is approcimate 2.2"); + \
d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: sRGB trc"); + } else {
+ d->colorSpaceSelector->lbltrc->setToolTip("Estimated Gamma: \
"+QString::number(estimatedTRC[0])+","+QString::number(estimatedTRC[1])+","+QString::number(estimatedTRC[2]));
+ d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: \
"+QString::number((estimatedTRC[0]+estimatedTRC[1]+estimatedTRC[2])/3)); + }
+ } else if (currentModelStr == "GRAYA") {
+ estimatedTRC = currentColorSpace()->profile()->getEstimatedTRC();
+ if (estimatedTRC[0] == -1) {
+ d->colorSpaceSelector->lbltrc->setToolTip("The Tone Response curve of this color \
space is the sRGB trc, which is approcimate 2.2"); + \
d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: sRGB trc"); + } else {
+ d->colorSpaceSelector->lbltrc->setToolTip("Estimated Gamma: \
"+QString::number(estimatedTRC[0])); + \
d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: "+QString::number(estimatedTRC[0])); + \
} + } else if (currentModelStr == "CMYKA") {
+ d->colorSpaceSelector->lbltrc->setToolTip("Estimated Gamma can't be retrieved for \
CMYK"); + d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: N/A");
+ } else if (currentModelStr == "XYZA") {
+ d->colorSpaceSelector->lbltrc->setToolTip("We asume that XYZ is linear");
+ d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: 1.0");
+ } else if (currentModelStr == "LABA") {
+ d->colorSpaceSelector->lbltrc->setToolTip("We asume this is the L *star TRC");
+ d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: L*");
+ } else if (currentModelStr == "YCbCrA") {
+ d->colorSpaceSelector->lbltrc->setToolTip("Estimated Gamma can't be retrieved for \
YCRCB"); + d->colorSpaceSelector->lbltrc->setText("Estimated Gamma: N/A");
+ }
+
+ d->colorSpaceSelector->textProfileDescription->clear();
+ d->colorSpaceSelector->textProfileDescription->setPlainText(profileName);
+ d->colorSpaceSelector->textProfileDescription->appendHtml("<br/>");
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("The following \
information about this colorprofile and depth is availeble:")); + \
d->colorSpaceSelector->textProfileDescription->appendHtml("<br/>"); +
+ if (currentModelStr == "RGBA") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("RGB, standing for \
Red, Green, Blue, is the colour model used by screens and other light-based media. It is an \
additive colour model, meaning that adding colours together makes them brighter. This colour \
model is the most extensive of all colour models, and is recommended as a model for working \
files, that you can later convert to other spaces. RGB is also the recommended space for HDR \
editing.")); + } else if (currentModelStr == "CMYKA") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("CMYK, \
standing for Cyan, Magenta, Yellow, Key, is the model used by printers and other ink-based \
media. It is a subtractive model, meaning that adding colors together will turn them darker. \
Because of CMYK profiles being very specific per printer, it is recommended to work in RGB \
space, and then later convert to a CMYK profile, preferably one delivered by you printer. \
Unfortunatly, Krita can't retrieve colorants or the TRC for this space.")); + } else if \
(currentModelStr == "XYZA") { + \
d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("XYZ is the space \
determined by the CIE as the space that encompasses all other colors, and used to convert \
colors between profiles. It is an additive colour model, meaning that adding colours together \
makes them brighter. It isn't recommended for editing, but can be useful to encode in. TRC is \
assumed to be linear.")); + } else if (currentModelStr == "GRAYA") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("Grayscale, as \
it states, allows only for gray values and transparent values. The benefit of this is that it \
will take up twice as little RAM and harddrive space as any given RGB image of the same \
bit-depth. Useful for inking and greyscale images.")); + } else if (currentModelStr == \
"LABA") { + \
d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("LAB, standing for \
Lightness, A component, B component, is a special model for color correction. It is based on \
human perception, meaning that it tries to encode the difference in lightness, red-green \
balance and yellow-blue balance. This makes it useful for color correction, but the vast \
majority of color maths in the blending modes don't work as expected here. Similarly, we do not \
support HDR in LAB, meaning that HDR images converted to LAB lose color information. This space \
is not recommended for painting, nor for export, but best as a space to do post-processing in. \
TRC is assumed to be the L* TRC.")); + } else if (currentModelStr == "YCbCrA") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("YCrCb, \
standing for Luma, Red Chroma, Blue Chroma, is a model designed for video encoding. It is based \
on human perception, meaning that it tries to encode the difference in lightness, red-green \
balance and yellow-blue balance. It is there to open up certain images correctly, but Krita \
does not currently ship a profile for this due to lack of open source ICC profiles for \
YCrCb.")); + }
+ /*
+ if (currentColorSpace()->colorDepthId().id()=="U8" && //profile larger than sRGB//){
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("This space is larger \
than generic screen RGB(sRGB), which means that it can show visible banding in 8bit. We \
recommend using a higher bit-depth for this image to ensure smoothness of values.")); + }*/
+ QString currentDepthStr = d->colorSpaceSelector->cmbColorDepth->currentItem().id();
+ d->colorSpaceSelector->textProfileDescription->appendHtml("<br/>");
+ if (currentDepthStr == "U8") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("8bit: The \
default amount of colours per channel. Each channel will have 256 values available, leading to \
a total amount of 256*amount of channels. Recommended to use for images intended for the web, \
or otherwise simple images.")); + } else if (currentDepthStr == "U16") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("16bit: Also \
known as 'deep colour'. 16bit is ideal for editing images with a linear TRC, large colour \
space, or just when you need more precise colour blending. This does take twice as much space \
on the RAM and hard-drive than any given 8bit image of the same properties, and for some \
devices it takes much more processing power. We recommend watching the RAM usage of the file \
carefully, or otherwise use 8bit if your computer slows down.")); + } else if \
(currentDepthStr == "F16") { + \
d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("16bit float: Also known as \
'Half Floating Point', and the standard in VFX industry images. 16bit float is ideal for \
editing images with a linear TRC, large colour space, or just when you need more precise colour \
blending. It being floating point is an absolute requirement for Scene Reffered (HDR) images. \
This does take twice as much space on the RAM and hard-drive than any given 8bit image of the \
same properties, and for some devices it takes much more processing power. We recommend \
watching the RAM usage of the file carefully, or otherwise use 8bit if your computer slows \
down.")); + } else if (currentDepthStr == "F32") {
+ d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("32bit float: \
Also known as 'Full Floating Point'. 32bit float is ideal for editing images with a linear TRC, \
large colour space, or just when you need more precise colour blending. It being floating point \
is an absolute requirement for Scene Reffered (HDR) images. This does take four times as much \
space on the RAM and hard-drive than any given 8bit image of the same properties, and for some \
devices it takes much more processing power. We recommend watching the RAM usage of the file \
carefully, or otherwise use 8bit if your computer slows down.")); + } else if \
(currentDepthStr == "F64") { + \
d->colorSpaceSelector->textProfileDescription->appendPlainText(i18n("64bit float: 64bit float \
is as precise as it gets in current technology, and this depth is used most of the time for \
images that are generated or used as an input for software. It being floating point is an \
absolute requirement for Scene Reffered (HDR) images. This does take eight times as much space \
on the RAM and hard-drive than any given 8bit image of the same properties, and for some \
devices it takes much more processing power. We recommend watching the RAM usage of the file \
carefully, or otherwise use 8bit if your computer slows down.")); + }
+
+}
+
+const KoColorSpace* KisAdvancedColorSpaceSelector::currentColorSpace()
+{
+ QString check = "";
+ if (d->colorSpaceSelector->lstProfile->currentItem()) {
+ check = d->colorSpaceSelector->lstProfile->currentItem()->text();
+ } else {
+ check = d->colorSpaceSelector->lstProfile->item(0)->text();
+ }
+ //qDebug()<<check;
+ return KoColorSpaceRegistry::instance()->colorSpace(
+ d->colorSpaceSelector->cmbColorModels->currentItem().id(), \
d->colorSpaceSelector->cmbColorDepth->currentItem().id() + , check);
+}
+
+void KisAdvancedColorSpaceSelector::setCurrentColorModel(const KoID& id)
+{
+ d->colorSpaceSelector->cmbColorModels->setCurrent(id);
+ fillCmbDepths(id);
+}
+
+void KisAdvancedColorSpaceSelector::setCurrentColorDepth(const KoID& id)
+{
+ d->colorSpaceSelector->cmbColorDepth->setCurrent(id);
+ fillLstProfiles();
+}
+
+void KisAdvancedColorSpaceSelector::setCurrentProfile(const QString& name)
+{
+ QList<QListWidgetItem *> Items= d->colorSpaceSelector->lstProfile->findItems(name, \
Qt::MatchStartsWith); + d->colorSpaceSelector->lstProfile->setCurrentItem(Items.at(0));
+}
+
+void KisAdvancedColorSpaceSelector::setCurrentColorSpace(const KoColorSpace* colorSpace)
+{
+ setCurrentColorModel(colorSpace->colorModelId());
+ setCurrentColorDepth(colorSpace->colorDepthId());
+ setCurrentProfile(colorSpace->profile()->name());
+}
+
+void KisAdvancedColorSpaceSelector::colorSpaceChanged()
+{
+ bool valid = d->colorSpaceSelector->lstProfile->count() != 0;
+ emit(selectionChanged(valid));
+ if(valid) {
+ emit colorSpaceChanged(currentColorSpace());
+ }
+}
+
+void KisAdvancedColorSpaceSelector::installProfile()
+{
+ QStringList mime;
+ mime << "*.icm" << "*.icc";
+ KoFileDialog dialog(this, KoFileDialog::OpenFiles, "OpenDocumentICC");
+ dialog.setCaption(i18n("Install Color Profiles"));
+ dialog.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
+ dialog.setNameFilters(mime);
+ QStringList profileNames = dialog.urls();
+
+ KoColorSpaceEngine *iccEngine = KoColorSpaceEngineRegistry::instance()->get("icc");
+ Q_ASSERT(iccEngine);
+
+ QString saveLocation = KGlobal::mainComponent().dirs()->saveLocation("icc_profiles");
+
+ foreach (const QString &profileName, profileNames) {
+ KUrl file(profileName);
+ if (!QFile::copy(profileName, saveLocation + file.fileName())) {
+ kWarning() << "Could not install profile!";
+ return;
+ }
+ iccEngine->addProfile(saveLocation + file.fileName());
+
+ }
+
+ fillLstProfiles();
+}
+
+void KisAdvancedColorSpaceSelector::buttonUpdate()
+{
+ const KoColorProfile * profile = \
KoColorSpaceRegistry::instance()->profileByName(d->colorSpaceSelector->lstProfile->currentItem()->text());
+ if(!profile) return;
+
+ QFileInfo fileInfo(profile->fileName());
+ /*if(fileInfo.isWritable()) {
+ d->colorSpaceSelector->bnUploadProfile->setEnabled( true );
+ return;
+ }
+ d->colorSpaceSelector->bnUploadProfile->setEnabled( false );*/
+}
+
+#include "kis_advanced_color_space_selector.moc"
diff --git a/krita/ui/widgets/kis_color_space_selector.h \
b/krita/ui/widgets/kis_advanced_color_space_selector.h similarity index 69%
copy from krita/ui/widgets/kis_color_space_selector.h
copy to krita/ui/widgets/kis_advanced_color_space_selector.h
index e5d924c..1870d99 100644
--- a/krita/ui/widgets/kis_color_space_selector.h
+++ b/krita/ui/widgets/kis_advanced_color_space_selector.h
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007 Cyrille Berger <cberger@cberger.net>
+ * Copyright (C) 2011 Boudewijn Rempt <boud@valdyas.org>
* Copyright (C) 2011 Srikanth Tiyyagura <srikanth.tulasiram@gmail.com>
+ * Copyright (C) 2015 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,41 +19,42 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#ifndef _KIS_COLOR_SPACE_SELECTOR_H_
-#define _KIS_COLOR_SPACE_SELECTOR_H_
+#ifndef _KIS_ADVANCED_COLOR_SPACE_SELECTOR_H_
+#define _KIS_ADVANCED_COLOR_SPACE_SELECTOR_H_
#include <QWidget>
+#include <QDialog>
#include <krita_export.h>
+#include "ui_wdgcolorspaceselectoradvanced.h"
+
class KoID;
class KoColorSpace;
-class KRITAUI_EXPORT KisColorSpaceSelector : public QWidget
+/* Use KisColorSpaceSelector instead of directly using this one*/
+
+class KRITAUI_EXPORT KisAdvancedColorSpaceSelector : public QDialog
{
Q_OBJECT
public:
- KisColorSpaceSelector(QWidget* parent);
- ~KisColorSpaceSelector();
+ KisAdvancedColorSpaceSelector(QWidget* parent, const QString &caption);
+ ~KisAdvancedColorSpaceSelector();
const KoColorSpace* currentColorSpace();
void setCurrentColorModel(const KoID& id);
void setCurrentColorDepth(const KoID& id);
void setCurrentProfile(const QString& name);
void setCurrentColorSpace(const KoColorSpace* colorSpace);
Q_SIGNALS:
- /**
- * This signal is emitted when a new color space is selected.
- * @param valid indicates if the color space can be used
- */
void selectionChanged(bool valid);
- /// This signal is emitted, when a new color space is selected, that can be used (eg is \
valid) void colorSpaceChanged(const KoColorSpace*);
private Q_SLOTS:
void fillCmbDepths(const KoID& idd);
- void fillCmbProfiles();
+ void fillLstProfiles();
+ void fillDescription();
void colorSpaceChanged();
void installProfile();
- void uploadProfile();
- void downloadProfile();
+ //void uploadProfile();
+ //void downloadProfile();
void buttonUpdate();
private:
struct Private;
diff --git a/krita/ui/widgets/kis_cie_tongue_widget.cpp \
b/krita/ui/widgets/kis_cie_tongue_widget.cpp new file mode 100644
index 0000000..3d064fa
--- /dev/null
+++ b/krita/ui/widgets/kis_cie_tongue_widget.cpp
@@ -0,0 +1,577 @@
+/*
+ * Copyright (C) 2015 by Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
+ *
+ * Based on the Digikam CIE Tongue widget
+ * Copyright (C) 2006-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ *
+ * Any source code are inspired from lprof project and
+ * Copyright (C) 1998-2001 Marti Maria
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ **/
+
+/**
+The following table gives the CIE color matching functions
+\f$\bar{x}(\lambda)\f$, \f$\bar{y}(\lambda)\f$, and
+\f$\bar{z}(\lambda)\f$, for wavelengths \f$\lambda\f$ at 5 nanometer
+increments from 380 nm through 780 nm. This table is used in conjunction
+with Planck's law for the energy spectrum of a black body at a given
+temperature to plot the black body curve on the CIE chart.
+
+The following table gives the spectral chromaticity co-ordinates
+\f$x(\lambda)\f$ and \f$y(\lambda)\f$ for wavelengths in 5 nanometer
+increments from 380 nm through 780 nm. These coordinates represent the
+position in the CIE x-y space of pure spectral colors of the given
+wavelength, and thus define the outline of the CIE "tongue" diagram.
+*/
+
+#include <QPointF>
+#include <QPainter>
+#include <QFile>
+#include <QTimer>
+#include <QPaintEvent>
+#include <QImage>
+#include <cmath>
+
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kpixmapsequence.h>
+
+#include <KoColorSpaceRegistry.h>
+
+#include "kis_cie_tongue_widget.h"
+
+static const double spectral_chromaticity[81][3] =
+{
+ { 0.1741, 0.0050 }, // 380 nm
+ { 0.1740, 0.0050 },
+ { 0.1738, 0.0049 },
+ { 0.1736, 0.0049 },
+ { 0.1733, 0.0048 },
+ { 0.1730, 0.0048 },
+ { 0.1726, 0.0048 },
+ { 0.1721, 0.0048 },
+ { 0.1714, 0.0051 },
+ { 0.1703, 0.0058 },
+ { 0.1689, 0.0069 },
+ { 0.1669, 0.0086 },
+ { 0.1644, 0.0109 },
+ { 0.1611, 0.0138 },
+ { 0.1566, 0.0177 },
+ { 0.1510, 0.0227 },
+ { 0.1440, 0.0297 },
+ { 0.1355, 0.0399 },
+ { 0.1241, 0.0578 },
+ { 0.1096, 0.0868 },
+ { 0.0913, 0.1327 },
+ { 0.0687, 0.2007 },
+ { 0.0454, 0.2950 },
+ { 0.0235, 0.4127 },
+ { 0.0082, 0.5384 },
+ { 0.0039, 0.6548 },
+ { 0.0139, 0.7502 },
+ { 0.0389, 0.8120 },
+ { 0.0743, 0.8338 },
+ { 0.1142, 0.8262 },
+ { 0.1547, 0.8059 },
+ { 0.1929, 0.7816 },
+ { 0.2296, 0.7543 },
+ { 0.2658, 0.7243 },
+ { 0.3016, 0.6923 },
+ { 0.3373, 0.6589 },
+ { 0.3731, 0.6245 },
+ { 0.4087, 0.5896 },
+ { 0.4441, 0.5547 },
+ { 0.4788, 0.5202 },
+ { 0.5125, 0.4866 },
+ { 0.5448, 0.4544 },
+ { 0.5752, 0.4242 },
+ { 0.6029, 0.3965 },
+ { 0.6270, 0.3725 },
+ { 0.6482, 0.3514 },
+ { 0.6658, 0.3340 },
+ { 0.6801, 0.3197 },
+ { 0.6915, 0.3083 },
+ { 0.7006, 0.2993 },
+ { 0.7079, 0.2920 },
+ { 0.7140, 0.2859 },
+ { 0.7190, 0.2809 },
+ { 0.7230, 0.2770 },
+ { 0.7260, 0.2740 },
+ { 0.7283, 0.2717 },
+ { 0.7300, 0.2700 },
+ { 0.7311, 0.2689 },
+ { 0.7320, 0.2680 },
+ { 0.7327, 0.2673 },
+ { 0.7334, 0.2666 },
+ { 0.7340, 0.2660 },
+ { 0.7344, 0.2656 },
+ { 0.7346, 0.2654 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 },
+ { 0.7347, 0.2653 } // 780 nm
+};
+
+class KisCIETongueWidget::Private
+{
+public:
+
+ Private() :
+ profileDataAvailable(false),
+ needUpdatePixmap(false),
+ uncalibratedColor(false),
+ xBias(0),
+ yBias(0),
+ pxcols(0),
+ pxrows(0),
+ progressCount(0),
+ gridside(0),
+ progressTimer(0),
+ Primaries(9),
+ whitePoint(3)
+
+ {
+ progressPix = KPixmapSequence("process-working", KIconLoader::SizeSmallMedium);
+ }
+
+ bool profileDataAvailable;
+ bool needUpdatePixmap;
+ bool uncalibratedColor;
+
+ int xBias;
+ int yBias;
+ int pxcols;
+ int pxrows;
+ int progressCount; // Position of animation during \
loading/calculation. +
+ double gridside;
+
+ QPainter painter;
+
+ QTimer* progressTimer;
+
+ QPixmap pixmap;
+ KPixmapSequence progressPix;
+
+ QVector <double> Primaries;
+ QVector <double> whitePoint;
+};
+
+KisCIETongueWidget::KisCIETongueWidget(QWidget *parent) :
+ QWidget(parent), d(new Private)
+{
+ d->progressTimer = new QTimer(this);
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ d->Primaries.resize(9);
+ d->Primaries.fill(0.0);
+ d->whitePoint.resize(3);
+ d->whitePoint<<0.34773<<0.35952<<1.0;
+
+ connect(d->progressTimer, SIGNAL(timeout()),
+ this, SLOT(slotProgressTimerDone()));
+}
+
+KisCIETongueWidget::~KisCIETongueWidget()
+{
+ delete d;
+}
+
+int KisCIETongueWidget::grids(double val) const
+{
+ return (int) floor(val * d->gridside + 0.5);
+}
+
+void KisCIETongueWidget::setProfileData(QVector <double> p, QVector <double> w, bool \
profileData) +{
+ d->profileDataAvailable = profileData;
+ if (profileData){
+ d->Primaries= p;
+
+ d->whitePoint = w;
+ d->needUpdatePixmap = true;
+ } else {
+ return;
+ }
+}
+
+
+void KisCIETongueWidget::mapPoint(int& icx, int& icy, QPointF xy)
+{
+ icx = (int) floor((xy.x() * (d->pxcols - 1)) + .5);
+ icy = (int) floor(((d->pxrows - 1) - xy.y() * (d->pxrows - 1)) + .5);
+}
+
+void KisCIETongueWidget::biasedLine(int x1, int y1, int x2, int y2)
+{
+ d->painter.drawLine(x1 + d->xBias, y1, x2 + d->xBias, y2);
+}
+
+void KisCIETongueWidget::biasedText(int x, int y, const QString& txt)
+{
+ d->painter.drawText(QPoint(d->xBias + x, y), txt);
+}
+
+QRgb KisCIETongueWidget::colorByCoord(double x, double y)
+{
+ // Get xyz components scaled from coordinates
+
+ double cx = ((double) x) / (d->pxcols - 1);
+ double cy = 1.0 - ((double) y) / (d->pxrows - 1);
+ double cz = 1.0 - cx - cy;
+
+ // Project xyz to XYZ space. Note that in this
+ // particular case we are substituting XYZ with xyz
+
+ //Need to use KoColor here.
+ QString space = KoColorSpaceRegistry::instance()->colorSpaceId("XYZA", "U8");
+ QString profile = \
KoColorSpaceRegistry::instance()->colorSpaceFactory(space)->defaultProfile(); + const \
KoColorSpace* xyzColorSpace = KoColorSpaceRegistry::instance()->colorSpace("XYZA", "U8", \
profile); + quint8 data[4];
+ data[0]= cx*255;
+ data[1]= cy*255;
+ data[2]= cz*255;
+ data[3]= 1.0*255;
+ KoColor colXYZ(data, xyzColorSpace);
+ QColor colRGB = colXYZ.toQColor();
+
+ return qRgb(colRGB.red(), colRGB.green(), colRGB.blue());
+}
+
+void KisCIETongueWidget::outlineTongue()
+{
+ int lx=0, ly=0;
+ int fx=0, fy=0;
+
+ for (int x = 380; x <= 700; x += 5)
+ {
+ int ix = (x - 380) / 5;
+
+ QPointF * p = new QPointF(spectral_chromaticity[ix][0], spectral_chromaticity[ix][1]);
+ int icx, icy;
+ mapPoint(icx, icy, * p);
+
+ if (x > 380)
+ {
+ biasedLine(lx, ly, icx, icy);
+ }
+ else
+ {
+ fx = icx;
+ fy = icy;
+ }
+
+ lx = icx;
+ ly = icy;
+ }
+
+ biasedLine(lx, ly, fx, fy);
+}
+
+void KisCIETongueWidget::fillTongue()
+{
+ QImage Img = d->pixmap.toImage();
+
+ int x;
+
+ for (int y = 0; y < d->pxrows; ++y)
+ {
+ int xe = 0;
+
+ // Find horizontal extents of tongue on this line.
+
+ for (x = 0; x < d->pxcols; ++x)
+ {
+ if (QColor(Img.pixel(x + d->xBias, y)) != QColor(Qt::black))
+ {
+ for (xe = d->pxcols - 1; xe >= x; --xe)
+ {
+ if (QColor(Img.pixel(xe + d->xBias, y)) != QColor(Qt::black))
+ {
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+
+ if (x < d->pxcols)
+ {
+ for ( ; x <= xe; ++x)
+ {
+ QRgb Color = colorByCoord(x, y);
+ Img.setPixel(x + d->xBias, y, Color);
+ }
+ }
+ }
+
+ d->pixmap = QPixmap::fromImage(Img, Qt::AvoidDither);
+}
+
+void KisCIETongueWidget::drawTongueAxis()
+{
+ QFont font;
+ font.setPointSize(6);
+ d->painter.setFont(font);
+
+ d->painter.setPen(qRgb(255, 255, 255));
+
+ biasedLine(0, 0, 0, d->pxrows - 1);
+ biasedLine(0, d->pxrows-1, d->pxcols-1, d->pxrows - 1);
+
+ for (int y = 1; y <= 9; y += 1)
+ {
+ QString s;
+ int xstart = (y * (d->pxcols - 1)) / 10;
+ int ystart = (y * (d->pxrows - 1)) / 10;
+
+ s.sprintf("0.%d", y);
+ biasedLine(xstart, d->pxrows - grids(1), xstart, d->pxrows - grids(4));
+ biasedText(xstart - grids(11), d->pxrows + grids(15), s);
+
+ s.sprintf("0.%d", 10 - y);
+ biasedLine(0, ystart, grids(3), ystart);
+ biasedText(grids(-25), ystart + grids(5), s);
+ }
+}
+
+void KisCIETongueWidget::drawTongueGrid()
+{
+ d->painter.setPen(qRgb(80, 80, 80));
+
+ for (int y = 1; y <= 9; y += 1)
+ {
+ int xstart = (y * (d->pxcols - 1)) / 10;
+ int ystart = (y * (d->pxrows - 1)) / 10;
+
+ biasedLine(xstart, grids(4), xstart, d->pxrows - grids(4) - 1);
+ biasedLine(grids(7), ystart, d->pxcols-1-grids(7), ystart);
+ }
+}
+
+void KisCIETongueWidget::drawLabels()
+{
+ QFont font;
+ font.setPointSize(5);
+ d->painter.setFont(font);
+
+ for (int x = 450; x <= 650; x += (x > 470 && x < 600) ? 5 : 10)
+ {
+ QString wl;
+ int bx = 0, by = 0, tx, ty;
+
+ if (x < 520)
+ {
+ bx = grids(-22);
+ by = grids(2);
+ }
+ else if (x < 535)
+ {
+ bx = grids(-8);
+ by = grids(-6);
+ }
+ else
+ {
+ bx = grids(4);
+ }
+
+ int ix = (x - 380) / 5;
+
+ QPointF * p = new QPointF(spectral_chromaticity[ix][0],
+ spectral_chromaticity[ix][1]);
+
+ int icx, icy;
+ mapPoint(icx, icy, * p);
+
+ tx = icx + ((x < 520) ? grids(-2) : ((x >= 535) ? grids(2) : 0));
+ ty = icy + ((x < 520) ? 0 : ((x >= 535) ? grids(-1) : grids(-2)));
+
+ d->painter.setPen(qRgb(255, 255, 255));
+ biasedLine(icx, icy, tx, ty);
+
+ QRgb Color = colorByCoord(icx, icy);
+ d->painter.setPen(Color);
+
+ wl.sprintf("%d", x);
+ biasedText(icx+bx, icy+by, wl);
+ }
+}
+
+void KisCIETongueWidget::drawSmallElipse(QPointF xy, int r, int g, int b, int sz)
+{
+ int icx, icy;
+
+ mapPoint(icx, icy, xy);
+ d->painter.setPen(qRgb(r, g, b));
+ d->painter.drawEllipse(icx + d->xBias- sz/2, icy-sz/2, sz, sz);
+}
+
+void KisCIETongueWidget::drawColorantTriangle()
+{
+ drawSmallElipse((QPointF(d->Primaries[0],d->Primaries[1])), 255, 128, 128, 6);
+ drawSmallElipse((QPointF(d->Primaries[3],d->Primaries[4])), 128, 255, 128, 6);
+ drawSmallElipse((QPointF(d->Primaries[6],d->Primaries[7])), 128, 128, 255, 6);
+
+ int x1, y1, x2, y2, x3, y3;
+
+ mapPoint(x1, y1, (QPointF(d->Primaries[0],d->Primaries[1])) );
+ mapPoint(x2, y2, (QPointF(d->Primaries[3],d->Primaries[4])) );
+ mapPoint(x3, y3, (QPointF(d->Primaries[6],d->Primaries[7])) );
+
+ d->painter.setPen(qRgb(255, 255, 255));
+
+ biasedLine(x1, y1, x2, y2);
+ biasedLine(x2, y2, x3, y3);
+ biasedLine(x3, y3, x1, y1);
+}
+
+void KisCIETongueWidget::drawWhitePoint()
+{
+ drawSmallElipse(QPointF (d->whitePoint[0],d->whitePoint[1]), 255, 255, 255, 8);
+}
+
+void KisCIETongueWidget::updatePixmap()
+{
+ d->needUpdatePixmap = false;
+ d->pixmap = QPixmap(size());
+
+ // Draw the CIE tongue curve.
+
+ d->pixmap.fill(Qt::black);
+ d->painter.begin(&d->pixmap);
+
+ int pixcols = d->pixmap.width();
+ int pixrows = d->pixmap.height();
+
+ d->gridside = (qMin(pixcols, pixrows)) / 512.0;
+ d->xBias = grids(32);
+ d->yBias = grids(20);
+ d->pxcols = pixcols - d->xBias;
+ d->pxrows = pixrows - d->yBias;
+
+ d->painter.setBackground(QBrush(qRgb(0, 0, 0)));
+ d->painter.setPen(qRgb(255, 255, 255));
+
+ outlineTongue();
+ d->painter.end();
+
+ fillTongue();
+
+ d->painter.begin(&d->pixmap);
+ drawTongueAxis();
+ drawLabels();
+ drawTongueGrid();
+
+ if (d->whitePoint[2] > 0.0)
+ {
+ drawWhitePoint();
+ }
+
+ if (d->Primaries[2] != 0.0)
+ {
+ drawColorantTriangle();
+ }
+
+ d->painter.end();
+}
+
+void KisCIETongueWidget::paintEvent(QPaintEvent*)
+{
+ QPainter p(this);
+
+ // Widget is disable : drawing grayed frame.
+
+ if ( !isEnabled() )
+ {
+ p.fillRect(0, 0, width(), height(),
+ palette().color(QPalette::Disabled, QPalette::Background));
+
+ QPen pen(palette().color(QPalette::Disabled, QPalette::Foreground));
+ pen.setStyle(Qt::SolidLine);
+ pen.setWidth(1);
+
+ p.setPen(pen);
+ p.drawRect(0, 0, width(), height());
+
+ return;
+ }
+
+
+ // No profile data to show, or RAW file
+
+ if (!d->profileDataAvailable)
+ {
+ p.fillRect(0, 0, width(), height(), palette().color(QPalette::Active, \
QPalette::Background)); + QPen pen(palette().color(QPalette::Active, QPalette::Text));
+ pen.setStyle(Qt::SolidLine);
+ pen.setWidth(1);
+
+ p.setPen(pen);
+ p.drawRect(0, 0, width(), height());
+
+ if (d->uncalibratedColor)
+ {
+ p.drawText(0, 0, width(), height(), Qt::AlignCenter,
+ i18n("Uncalibrated color space"));
+ }
+ else
+ {
+ p.setPen(Qt::red);
+ p.drawText(0, 0, width(), height(), Qt::AlignCenter,
+ i18n("No profile available..."));
+ }
+
+ return;
+ }
+
+ // Create CIE tongue if needed
+ if (d->needUpdatePixmap)
+ {
+ updatePixmap();
+ }
+
+ // draw prerendered tongue
+ p.drawPixmap(0, 0, d->pixmap);
+}
+
+void KisCIETongueWidget::resizeEvent(QResizeEvent* event)
+{
+ Q_UNUSED(event);
+ setMinimumHeight(width());
+ setMaximumHeight(width());
+ d->needUpdatePixmap = true;
+}
+
+void KisCIETongueWidget::slotProgressTimerDone()
+{
+ update();
+ d->progressTimer->start(200);
+}
diff --git a/krita/ui/widgets/kis_cie_tongue_widget.h \
b/krita/ui/widgets/kis_cie_tongue_widget.h new file mode 100644
index 0000000..5173a31
--- /dev/null
+++ b/krita/ui/widgets/kis_cie_tongue_widget.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2015 by Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
+ *
+ * Based on the Digikam CIE Tongue widget
+ * Copyright (C) 2006-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ *
+ * Any source code are inspired from lprof project and
+ * Copyright (C) 1998-2001 Marti Maria
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef KIS_CIETONGUEWIDGET_H
+#define KIS_CIETONGUEWIDGET_H
+
+// Qt includes
+
+#include <QtGui/QWidget>
+#include <QtGui/QColor>
+#include <QtGui/QPaintEvent>
+
+// KDE includes
+
+#include <KoColor.h>
+#include <KoColorSpace.h>
+
+#include <krita_export.h>
+
+class KRITAUI_EXPORT KisCIETongueWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ KisCIETongueWidget(QWidget *parent=0);
+ ~KisCIETongueWidget();
+
+ void setProfileData(QVector <double> p, QVector <double> w, bool profileData = false);
+
+ void loadingStarted();
+ void loadingFailed();
+ void uncalibratedColor();
+
+protected:
+
+ int grids(double val) const;
+
+ void outlineTongue();
+ void fillTongue();
+ void drawTongueAxis();
+ void drawTongueGrid();
+ void drawLabels();
+
+ QRgb colorByCoord(double x, double y);
+ void drawSmallElipse(QPointF xy, int r, int g, int b, int sz);
+
+ void resizeEvent(QResizeEvent* event);
+ void paintEvent(QPaintEvent*);
+
+private:
+
+ void drawColorantTriangle();
+ void drawWhitePoint();
+ void drawPatches();
+ void updatePixmap();
+
+ void mapPoint(int& icx, int& icy, QPointF xy);
+ void biasedLine(int x1, int y1, int x2, int y2);
+ void biasedText(int x, int y, const QString& txt);
+
+private Q_SLOTS:
+
+ void slotProgressTimerDone();
+
+private :
+
+ class Private;
+ Private* const d;
+};
+
+#endif /* KISCIETONGUEWIDGET_H */
diff --git a/krita/ui/widgets/kis_color_space_selector.cc \
b/krita/ui/widgets/kis_color_space_selector.cc index 1dd6cdd..b9c614e 100644
--- a/krita/ui/widgets/kis_color_space_selector.cc
+++ b/krita/ui/widgets/kis_color_space_selector.cc
@@ -50,7 +50,7 @@ struct KisColorSpaceSelector::Private {
QString knsrcFile;
};
-KisColorSpaceSelector::KisColorSpaceSelector(QWidget* parent) : QWidget(parent), d(new \
Private) +KisColorSpaceSelector::KisColorSpaceSelector(QWidget* parent) : QWidget(parent), \
m_advancedSelector(0), d(new Private) {
setObjectName("KisColorSpaceSelector");
d->colorSpaceSelector = new Ui_WdgColorSpaceSelector;
@@ -93,6 +93,8 @@ KisColorSpaceSelector::KisColorSpaceSelector(QWidget* parent) : \
QWidget(parent),
connect(d->colorSpaceSelector->bnUploadProfile, SIGNAL(clicked()), this, \
SLOT(uploadProfile()));
d->knsrcFile = "kritaiccprofiles.knsrc";
+
+ connect(d->colorSpaceSelector->bnAdvanced, SIGNAL(clicked()), this, \
SLOT(slotOpenAdvancedSelector()));
fillCmbProfiles();
}
@@ -169,23 +171,8 @@ void KisColorSpaceSelector::colorSpaceChanged()
emit(selectionChanged(valid));
if(valid) {
emit colorSpaceChanged(currentColorSpace());
- if (currentColorSpace()->profile()->hasColorants()){
- QVector <double> colorants = currentColorSpace()->profile()->getColorantsXYZ();
- QVector <double> whitepoint = currentColorSpace()->profile()->getWhitePointXYZ();
- QString text = currentColorSpace()->profile()->info()+" ="+
- " White: "+QString::number(whitepoint[0])+", \
"+QString::number(whitepoint[1])+", "+QString::number(whitepoint[2])+
- " Red: " +QString::number(colorants[0])+", \
"+QString::number(colorants[1])+", "+QString::number(colorants[2])+
- " Green: "+QString::number(colorants[3])+", \
"+QString::number(colorants[4])+", "+QString::number(colorants[5])+
- " Blue: " +QString::number(colorants[6])+", \
"+QString::number(colorants[7])+", "+QString::number(colorants[8]);
- d->colorSpaceSelector->lblColorantInfo->setText(text);
- //qDebug()<<text;
- } else {QVector <double> whitepoint = \
currentColorSpace()->profile()->getWhitePointXYZ();
- QString text = currentColorSpace()->profile()->info()+" ="+
- " White:"+QString::number(whitepoint[0])+", \
"+QString::number(whitepoint[1])+", "+QString::number(whitepoint[2])+
- " This Profile has no colorants";
- d->colorSpaceSelector->lblColorantInfo->setText(text);
- //qDebug()<<text;
- }
+ QString text = currentColorSpace()->profile()->name();
+ d->colorSpaceSelector->lblColorantInfo->setText(text);
}
}
@@ -263,4 +250,21 @@ void KisColorSpaceSelector::buttonUpdate()
d->colorSpaceSelector->bnUploadProfile->setEnabled( false );
}
+void KisColorSpaceSelector::slotOpenAdvancedSelector()
+{
+ if(!m_advancedSelector) {
+ m_advancedSelector = new KisAdvancedColorSpaceSelector(this, "Select a Colorspace");
+ m_advancedSelector->setModal(true);
+ //m_advancedSelector->setCurrentColorSpace(currentColorSpace());
+ }
+
+ m_advancedSelector->exec();
+ /*
+ QDialog::DialogCode result = (QDialog::DialogCode)m_advancedSelector->exec();
+
+ if(result) {
+ //setCurrentColorSpace(m_advancedSelector->currentColorSpace());
+ }*/
+}
+
#include "kis_color_space_selector.moc"
diff --git a/krita/ui/widgets/kis_color_space_selector.h \
b/krita/ui/widgets/kis_color_space_selector.h index e5d924c..4e66222 100644
--- a/krita/ui/widgets/kis_color_space_selector.h
+++ b/krita/ui/widgets/kis_color_space_selector.h
@@ -22,9 +22,11 @@
#include <QWidget>
#include <krita_export.h>
+#include "kis_advanced_color_space_selector.h"
class KoID;
class KoColorSpace;
+class KisAdvancedColorSpaceSelector;
class KRITAUI_EXPORT KisColorSpaceSelector : public QWidget
{
@@ -53,8 +55,10 @@ private Q_SLOTS:
void uploadProfile();
void downloadProfile();
void buttonUpdate();
+ void slotOpenAdvancedSelector();
private:
struct Private;
+ KisAdvancedColorSpaceSelector* m_advancedSelector;
Private * const d;
};
diff --git a/libs/pigment/KoColorProfile.h b/libs/pigment/KoColorProfile.h
index c09eff3..d0cc39a 100644
--- a/libs/pigment/KoColorProfile.h
+++ b/libs/pigment/KoColorProfile.h
@@ -116,7 +116,11 @@ public:
virtual QVector <double> getColorantsxyY() const = 0;
virtual QVector <double> getWhitePointXYZ() const = 0;
virtual QVector <double> getWhitePointxyY() const = 0;
-
+
+ /**
+ * @return estimated gamma for RGB and Grayscale profiles
+ */
+ virtual QVector <double> getEstimatedTRC() const = 0;
virtual bool operator==(const KoColorProfile&) const = 0;
/**
diff --git a/libs/pigment/colorprofiles/KoDummyColorProfile.cpp \
b/libs/pigment/colorprofiles/KoDummyColorProfile.cpp index 30bd93d..2f648fe 100644
--- a/libs/pigment/colorprofiles/KoDummyColorProfile.cpp
+++ b/libs/pigment/colorprofiles/KoDummyColorProfile.cpp
@@ -85,6 +85,13 @@ QVector<double> KoDummyColorProfile::getWhitePointxyY() const
return d50Dummy;
}
+QVector <double> KoDummyColorProfile::getEstimatedTRC() const
+{
+ QVector<double> Dummy(3);
+ Dummy.fill(2.2);
+ return Dummy;
+}
+
bool KoDummyColorProfile::operator==(const KoColorProfile& rhs) const
{
return dynamic_cast<const KoDummyColorProfile*>(&rhs);
diff --git a/libs/pigment/colorprofiles/KoDummyColorProfile.h \
b/libs/pigment/colorprofiles/KoDummyColorProfile.h index 4fda76f..6bcbdee 100644
--- a/libs/pigment/colorprofiles/KoDummyColorProfile.h
+++ b/libs/pigment/colorprofiles/KoDummyColorProfile.h
@@ -37,6 +37,7 @@ public:
virtual QVector <double> getColorantsxyY() const;
virtual QVector <double> getWhitePointXYZ() const;
virtual QVector <double> getWhitePointxyY() const;
+ virtual QVector <double> getEstimatedTRC() const;
virtual bool operator==(const KoColorProfile&) const;
};
diff --git a/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.cpp \
b/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.cpp index 4d8b6c2..2e11014 100644
--- a/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.cpp
+++ b/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.cpp
@@ -182,6 +182,14 @@ QVector <double> IccColorProfile::getWhitePointxyY() const
return d->shared->lcmsProfile->getWhitePointxyY();
return d50Dummy;
}
+QVector <double> IccColorProfile::getEstimatedTRC() const
+{
+ QVector <double> dummy(3);
+ dummy.fill(2.2);//estimated sRGB trc.
+ if (d->shared->lcmsProfile)
+ return d->shared->lcmsProfile->getEstimatedTRC();
+ return dummy;
+}
bool IccColorProfile::load()
{
QFile file(fileName());
diff --git a/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.h \
b/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.h index 288a669..82879e3 100644
--- a/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.h
+++ b/plugins/colorengines/lcms2/colorprofiles/IccColorProfile.h
@@ -71,6 +71,7 @@ public:
virtual QVector <double> getColorantsxyY() const = 0;
virtual QVector <double> getWhitePointXYZ() const = 0;
virtual QVector <double> getWhitePointxyY() const = 0;
+ virtual QVector <double> getEstimatedTRC() const = 0;
};
public:
@@ -97,6 +98,7 @@ public:
virtual QVector <double> getColorantsxyY() const;
virtual QVector <double> getWhitePointXYZ() const;
virtual QVector <double> getWhitePointxyY() const;
+ virtual QVector <double> getEstimatedTRC() const;
virtual bool operator==(const KoColorProfile&) const;
virtual QString type() const { return "icc"; }
diff --git a/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.cpp \
b/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.cpp index f5612c0..68f3683 \
100644
--- a/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.cpp
+++ b/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.cpp
@@ -46,9 +46,14 @@ public:
bool valid;
bool suitableForOutput;
bool hasColorants;
+ bool adaptedFromD50;
cmsCIEXYZ mediaWhitePoint;
cmsCIExyY whitePoint;
cmsCIEXYZTRIPLE colorants;
+ cmsToneCurve *redTRC;
+ cmsToneCurve *greenTRC;
+ cmsToneCurve *blueTRC;
+ cmsToneCurve *grayTRC;
};
LcmsColorProfileContainer::LcmsColorProfileContainer()
@@ -130,11 +135,15 @@ bool LcmsColorProfileContainer::init()
cmsXYZ2xyY(&d->whitePoint, &d->mediaWhitePoint);
//qDebug()<<d->name<<" Whitepoint: \
"<<WhitePoint.x<<","<<WhitePoint.y<<","<<WhitePoint.Y; }
+
+
if (cmsIsTag(d->profile, cmsSigRedColorantTag)) {
cmsCIEXYZTRIPLE tempColorants = { -1 };
+ //can't adapt from d50
tempColorants.Red = *((cmsCIEXYZ *)cmsReadTag (d->profile, cmsSigRedColorantTag));
tempColorants.Green = *((cmsCIEXYZ *)cmsReadTag (d->profile, \
cmsSigGreenColorantTag));
tempColorants.Blue = *((cmsCIEXYZ *)cmsReadTag (d->profile, \
cmsSigBlueColorantTag)); +
d->colorants = tempColorants;
d->hasColorants = true;
//TODO: convert to d65, this is useless.
@@ -145,7 +154,16 @@ bool LcmsColorProfileContainer::init()
//qDebug()<<d->name<<": has no colorants";
d->hasColorants = false;
}
+ //retrieve TRC.
+ if (cmsIsTag(d->profile, cmsSigRedTRCTag) && cmsIsTag(d->profile, cmsSigBlueTRCTag) && \
cmsIsTag(d->profile, cmsSigGreenTRCTag)) { +
+ d->redTRC = ((cmsToneCurve *)cmsReadTag (d->profile, cmsSigRedTRCTag));
+ d->greenTRC = ((cmsToneCurve *)cmsReadTag (d->profile, cmsSigGreenTRCTag));
+ d->blueTRC = ((cmsToneCurve *)cmsReadTag (d->profile, cmsSigBlueTRCTag));
+ } else if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) {
+ d->grayTRC = ((cmsToneCurve *)cmsReadTag (d->profile, cmsSigGrayTRCTag));
+ }
// Check if the profile can convert (something->this)
@@ -231,7 +249,7 @@ QVector <double> LcmsColorProfileContainer::getColorantsxyY() const
{
cmsCIEXYZ temp1;
cmsCIExyY temp2;
- QVector <double> colorants;
+ QVector <double> colorants(9);
temp1.X = d->colorants.Red.X;
temp1.Y = d->colorants.Red.Y;
@@ -274,14 +292,46 @@ QVector <double> LcmsColorProfileContainer::getWhitePointXYZ() const
QVector <double> LcmsColorProfileContainer::getWhitePointxyY() const
{
QVector <double> tempWhitePoint(3);
-
tempWhitePoint[0] = d->whitePoint.x;
tempWhitePoint[1] = d->whitePoint.y;
tempWhitePoint[2] = d->whitePoint.Y;
-
return tempWhitePoint;
}
+QVector <double> LcmsColorProfileContainer::getEstimatedTRC() const
+{
+ QVector <double> TRCtriplet(3);
+ if (d->hasColorants) {
+ if (cmsIsToneCurveLinear(d->redTRC)) {
+ TRCtriplet[0] = 1.0;
+ } else {
+ TRCtriplet[0] = cmsEstimateGamma(d->redTRC, 0.01);
+ }
+ if (cmsIsToneCurveLinear(d->greenTRC)) {
+ TRCtriplet[1] = 1.0;
+ } else {
+ TRCtriplet[1] = cmsEstimateGamma(d->greenTRC, 0.01);
+ }
+ if (cmsIsToneCurveLinear(d->blueTRC)) {
+ TRCtriplet[2] = 1.0;
+ } else {
+ TRCtriplet[2] = cmsEstimateGamma(d->blueTRC, 0.01);
+ }
+
+ } else {
+ if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) {
+ if (cmsIsToneCurveLinear(d->grayTRC)) {
+ TRCtriplet.fill(1.0);
+ } else {
+ TRCtriplet.fill(cmsEstimateGamma(d->grayTRC, 0.01));
+ }
+ } else {
+ TRCtriplet.fill(1.0);
+ }
+ }
+ return TRCtriplet;
+}
+
QString LcmsColorProfileContainer::name() const
{
return d->name;
diff --git a/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.h \
b/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.h index 0443762..edfd3f8 \
100644
--- a/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.h
+++ b/plugins/colorengines/lcms2/colorprofiles/LcmsColorProfileContainer.h
@@ -86,6 +86,7 @@ public:
virtual QVector <double> getColorantsxyY() const;
virtual QVector <double> getWhitePointXYZ() const;
virtual QVector <double> getWhitePointxyY() const;
+ virtual QVector <double> getEstimatedTRC() const;
virtual QString name() const;
virtual QString info() const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic