r22358 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Jan 22 19:40:42 UTC 2018
Author: jghali
Date: Mon Jan 22 19:40:41 2018
New Revision: 22358
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22358
Log:
more work on ScCIEData
Modified:
trunk/Scribus/scribus/colormgmt/scciedata.cpp
trunk/Scribus/scribus/colormgmt/scciedata.h
trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h
Modified: trunk/Scribus/scribus/colormgmt/scciedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22358&path=/trunk/Scribus/scribus/colormgmt/scciedata.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/scciedata.cpp (original)
+++ trunk/Scribus/scribus/colormgmt/scciedata.cpp Mon Jan 22 19:40:41 2018
@@ -26,4 +26,22 @@
delete ScCIEData::m_instance;
ScCIEData::m_instance = 0;
}
+}
+
+const ScCIEIlluminant& ScCIEData::cieIlluminant(eIlluminant illuminant) const
+{
+ if (illuminant == Illuminant_D50)
+ return m_d50Illuminant;
+ if (illuminant == Illuminant_D65)
+ return m_d65Illuminant;
+ return m_d50Illuminant;
+}
+
+const ScCIEObserver& ScCIEData::cieObserver(eObserver observer) const
+{
+ if (observer == Observer_2deg)
+ return m_cie1931Observer;
+ if (observer == Observer_10deg)
+ return m_cie1964Observer;
+ return m_cie1931Observer;
}
Modified: trunk/Scribus/scribus/colormgmt/scciedata.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22358&path=/trunk/Scribus/scribus/colormgmt/scciedata.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/scciedata.h (original)
+++ trunk/Scribus/scribus/colormgmt/scciedata.h Mon Jan 22 19:40:41 2018
@@ -9,9 +9,11 @@
#include "sccieilluminants.h"
#include "sccieobservers.h"
+#include "sccolormgmtstructs.h"
class ScCIEData
{
+public:
/**
* @brief Get a reference to the ScCIEData instance
* creating it if necessary.
@@ -24,6 +26,16 @@
* @sa ScCIEData::instance()
*/
static void destroy();
+
+ /**
+ * @brief Retrive specific CIE illuminant
+ */
+ const ScCIEIlluminant& cieIlluminant(eIlluminant illuminant) const;
+
+ /**
+ * @brief Retrive specific CIE illuminant
+ */
+ const ScCIEObserver& cieObserver(eObserver observer) const;
/**
* @brief Retrieve data for CIE 1931 2° observer.
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22358&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h Mon Jan 22 19:40:41 2018
@@ -12,7 +12,7 @@
// If you change that enum do not forget to update functions
// colorFormatType() and colorFormatHasAlpha()
-typedef enum
+enum eColorFormat
{
Format_Undefined,
Format_RGB_8,
@@ -33,35 +33,35 @@
Format_GRAY_16,
Format_LabA_8,
Format_Lab_Dbl
-} eColorFormat;
+};
-typedef enum
+enum eColorType
{
Color_Unknown,
Color_RGB,
Color_CMYK,
Color_Gray,
Color_Lab
-} eColorType;
+};
-typedef enum
+enum eColorTransformFlags
{
Ctf_BlackPointCompensation = 1,
Ctf_BlackPreservation = 2,
Ctf_Softproofing = 4,
Ctf_GamutCheck = 8
-} eColorTransformFlags;
+};
-typedef enum
+enum eRenderIntent
{
Intent_Perceptual = 0,
Intent_Relative_Colorimetric = 1,
Intent_Saturation = 2,
Intent_Absolute_Colorimetric = 3,
Intent_Max = 4
-} eRenderIntent;
+};
-typedef enum
+enum eColorSpaceType
{
ColorSpace_Unknown,
ColorSpace_XYZ,
@@ -75,9 +75,9 @@
ColorSpace_Hls,
ColorSpace_Cmyk,
ColorSpace_Cmy
-} eColorSpaceType;
+};
-typedef enum
+enum eProfileClass
{
Class_Unknown,
Class_Input,
@@ -87,7 +87,19 @@
Class_Abstract,
Class_ColorSpace,
Class_NamedColor
-} eProfileClass;
+};
+
+enum eIlluminant
+{
+ Illuminant_D50,
+ Illuminant_D65
+};
+
+enum eObserver
+{
+ Observer_2deg,
+ Observer_10deg
+};
class ScColorMgmtStrategy
{
@@ -102,16 +114,16 @@
}
};
-typedef struct
+struct ScColorProfileInfo
{
QString file;
QString description;
eColorSpaceType colorSpace;
eProfileClass deviceClass;
QString debug;
-} ScColorProfileInfo;
+};
-typedef struct
+struct ScColorTransformInfo
{
QString inputProfile;
QString outputProfile;
@@ -121,9 +133,16 @@
eRenderIntent renderIntent;
eRenderIntent proofingIntent;
long flags;
-} ScColorTransformInfo;
+};
bool operator==(const ScColorTransformInfo& v1, const ScColorTransformInfo& v2);
+
+struct ScXYZ
+{
+ double X;
+ double Y;
+ double Z;
+};
eColorType colorFormatType(eColorFormat format);
uint colorFormatNumChannels(eColorFormat format);
More information about the scribus-commit
mailing list