r22357 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 22 19:35:38 UTC 2018


Author: jghali
Date: Mon Jan 22 19:35:38 2018
New Revision: 22357

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22357
Log:
allow to retrieve represented wavelengths in CIE observers and illuminants datasets

Modified:
    trunk/Scribus/scribus/colormgmt/sccieilluminants.cpp
    trunk/Scribus/scribus/colormgmt/sccieilluminants.h
    trunk/Scribus/scribus/colormgmt/sccieobservers.cpp
    trunk/Scribus/scribus/colormgmt/sccieobservers.h

Modified: trunk/Scribus/scribus/colormgmt/sccieilluminants.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22357&path=/trunk/Scribus/scribus/colormgmt/sccieilluminants.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieilluminants.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccieilluminants.cpp	Mon Jan 22 19:35:38 2018
@@ -6,6 +6,18 @@
 */
 
 #include "sccieilluminants.h"
+
+QVector<int> ScCIEIlluminant::wavelengths() const
+{
+	QVector<int> wls;
+	wls.reserve(m_pow.count());
+
+	QMap<int, double>::const_iterator iter;
+	for (iter = m_pow.begin(); iter != m_pow.end(); ++iter)
+		wls.append(iter.key());
+
+	return wls;
+}
 
 ScD50Illuminant::ScD50Illuminant()
 {

Modified: trunk/Scribus/scribus/colormgmt/sccieilluminants.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22357&path=/trunk/Scribus/scribus/colormgmt/sccieilluminants.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieilluminants.h	(original)
+++ trunk/Scribus/scribus/colormgmt/sccieilluminants.h	Mon Jan 22 19:35:38 2018
@@ -9,13 +9,18 @@
 #define SCCIEILLUMINANTS_H
 
 #include <QMap>
+#include <QVector>
 
 class ScCIEIlluminant
 {
 public:
 	virtual ~ScCIEIlluminant() {}
 	
+	// Relative illuminant power for specified wavelength
 	double power(int waveLen) const { return m_pow.value(waveLen, 0.0); }
+
+	// Wavelengths represented in the data set
+	QVector<int> wavelengths() const;
 	
 protected:
 	// Relative spectral power distribution

Modified: trunk/Scribus/scribus/colormgmt/sccieobservers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22357&path=/trunk/Scribus/scribus/colormgmt/sccieobservers.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieobservers.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccieobservers.cpp	Mon Jan 22 19:35:38 2018
@@ -6,6 +6,18 @@
 */
 
 #include "sccieobservers.h"
+
+QVector<int> ScCIEObserver::wavelengths() const
+{
+	QVector<int> wls;
+	wls.reserve(m_y.count());
+
+	QMap<int, double>::const_iterator iter;
+	for (iter = m_y.begin(); iter!= m_y.end(); ++iter)
+		wls.append(iter.key());
+
+	return wls;
+}
 
 ScCIE1931Observer::ScCIE1931Observer()
 {
@@ -207,4 +219,4 @@
 	m_x[775] = 0.0000, m_y[775] = 0.0000, m_z[775] = 0.0000;
 
 	m_x[780] = 0.0000, m_y[780] = 0.0000, m_z[780] = 0.0000;
-}
+}

Modified: trunk/Scribus/scribus/colormgmt/sccieobservers.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22357&path=/trunk/Scribus/scribus/colormgmt/sccieobservers.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieobservers.h	(original)
+++ trunk/Scribus/scribus/colormgmt/sccieobservers.h	Mon Jan 22 19:35:38 2018
@@ -9,11 +9,15 @@
 #define SCCIEOBSERVERS_H
 
 #include <QMap>
+#include <QVector>
 
 class ScCIEObserver
 {
 public:
 	virtual ~ScCIEObserver() {}
+
+	// Wavelengths represented in the data set
+	QVector<int> wavelengths() const;
 
 	double xVal(int waveLen) const { return m_x.value(waveLen, 0.0); }
 	double yVal(int waveLen) const { return m_y.value(waveLen, 0.0); }




More information about the scribus-commit mailing list