r22473 by jghali - #15267: Colour model switch in the "Colours & Fills" dialogue doesn't work as expected

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 23 11:25:46 UTC 2018


Author: jghali
Date: Mon Apr 23 11:25:46 2018
New Revision: 22473

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22473
Log:
#15267: Colour model switch in the "Colours & Fills" dialogue doesn't work as expected

Modified:
    trunk/Scribus/scribus/sccolorengine.cpp
    trunk/Scribus/scribus/scribuscore.cpp
    trunk/Scribus/scribus/scribuscore.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/sccolorengine.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22473&path=/trunk/Scribus/scribus/sccolorengine.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolorengine.cpp	(original)
+++ trunk/Scribus/scribus/sccolorengine.cpp	Mon Apr 23 11:25:46 2018
@@ -632,7 +632,7 @@
 	else if (color.getColorModel() == colorModelLab)
 	{
 		bool cmsUse = doc ? doc->HasCMS : false;
-		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
+		ScColorTransform trans  = doc ? doc->stdLabToScreenTrans : ScCore->defaultLabToRGBTrans;
 		if (cmsUse && trans)
 		{
 			double inC[3];
@@ -715,7 +715,7 @@
 	}
 	else if (color.getColorModel() == colorModelLab)
 	{
-		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
+		ScColorTransform trans  = doc ? doc->stdLabToScreenTrans : ScCore->defaultLabToRGBTrans;
 		double inC[3];
 		inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
 		inC[1] = color.m_a_val * (level / 100.0);
@@ -826,7 +826,7 @@
 		inC[1] = color.m_a_val * (level / 100.0);
 		inC[2] = color.m_b_val * (level / 100.0);
 		quint16 outC[3];
-		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
+		ScColorTransform trans  = doc ? doc->stdLabToScreenTrans : ScCore->defaultLabToRGBTrans;
 		ScColorTransform transProof   = doc ? doc->stdProofLab   : ScCore->defaultLabToRGBTrans;
 		ScColorTransform transProofGC = doc ? doc->stdProofLabGC : ScCore->defaultLabToRGBTrans;
 		if (cmsUse && doc && doc->SoftProofing)

Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22473&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp	(original)
+++ trunk/Scribus/scribus/scribuscore.cpp	Mon Apr 23 11:25:46 2018
@@ -468,8 +468,9 @@
 	defaultCMYKToScreenImageTrans = defaultEngine.createTransform(defaultCMYKProfile, Format_CMYK_8, defaultRGBProfile, Format_RGBA_8, intent, dcmsFlags);
 	defaultRGBToCMYKTrans         = defaultEngine.createTransform(defaultRGBProfile, Format_RGB_16, defaultCMYKProfile, Format_CMYK_16, intent, dcmsFlags);
 	defaultCMYKToRGBTrans         = defaultEngine.createTransform(defaultCMYKProfile, Format_CMYK_16, defaultRGBProfile, Format_RGB_16, intent, dcmsFlags);
-	defaultLabToRGBTrans           = defaultEngine.createTransform(defaultLabProfile, Format_Lab_Dbl, defaultRGBProfile, Format_RGB_16, Intent_Absolute_Colorimetric, dcmsFlags);
+	defaultLabToRGBTrans          = defaultEngine.createTransform(defaultLabProfile, Format_Lab_Dbl, defaultRGBProfile, Format_RGB_16, Intent_Absolute_Colorimetric, dcmsFlags);
 	defaultLabToCMYKTrans         = defaultEngine.createTransform(defaultLabProfile, Format_Lab_Dbl, defaultCMYKProfile, Format_CMYK_16, Intent_Absolute_Colorimetric, dcmsFlags);
+	defaultLabToScreenTrans       = defaultLabToRGBTrans;
 	if (!defaultRGBToScreenSolidTrans  || !defaultRGBToScreenImageTrans || 
 		!defaultCMYKToScreenImageTrans || !defaultRGBToCMYKTrans || 
 		!defaultCMYKToRGBTrans || !defaultLabToRGBTrans|| !defaultLabToCMYKTrans)
@@ -489,6 +490,7 @@
 	defaultCMYKToRGBTrans = ScColorTransform();
 	defaultLabToRGBTrans = ScColorTransform();
 	defaultLabToCMYKTrans = ScColorTransform();
+	defaultLabToScreenTrans = ScColorTransform();
 }
 
 void ScribusCore::initCMS()

Modified: trunk/Scribus/scribus/scribuscore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22473&path=/trunk/Scribus/scribus/scribuscore.h
==============================================================================
--- trunk/Scribus/scribus/scribuscore.h	(original)
+++ trunk/Scribus/scribus/scribuscore.h	Mon Apr 23 11:25:46 2018
@@ -123,6 +123,7 @@
 	ScColorTransform defaultCMYKToRGBTrans;
 	ScColorTransform defaultLabToRGBTrans;
 	ScColorTransform defaultLabToCMYKTrans;
+	ScColorTransform defaultLabToScreenTrans;
 	
 protected:
 	void initCMS();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22473&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Mon Apr 23 11:25:46 2018
@@ -983,6 +983,7 @@
 	stdProofImgCMYK       = ScCore->defaultCMYKToScreenImageTrans;
 	stdLabToRGBTrans      = ScCore->defaultLabToRGBTrans;
 	stdLabToCMYKTrans     = ScCore->defaultLabToCMYKTrans;
+	stdLabToScreenTrans   = ScCore->defaultLabToScreenTrans;
 	stdProofLab           = ScCore->defaultLabToRGBTrans;
 	stdProofLabGC         = ScCore->defaultLabToRGBTrans;
 }
@@ -1090,13 +1091,15 @@
 			m_docPrefsData.colorPrefs.DCMSset.ComponentsInput2 = 4;
 	if (DocInputRGBProf.colorSpace() == ColorSpace_Cmy)
 			m_docPrefsData.colorPrefs.DCMSset.ComponentsInput2 = 3;
-	stdLabToRGBTrans   = colorEngine.createTransform(ScCore->defaultLabProfile, Format_Lab_Dbl, DocDisplayProf, Format_RGB_16, Intent_Absolute_Colorimetric, dcmsFlags);
-	stdLabToCMYKTrans = colorEngine.createTransform(ScCore->defaultLabProfile, Format_Lab_Dbl, DocPrinterProf, Format_CMYK_16, Intent_Absolute_Colorimetric, dcmsFlags);
+
+	stdLabToRGBTrans  = colorEngine.createTransform(ScCore->defaultLabProfile, Format_Lab_Dbl, DocInputRGBProf, Format_RGB_16, Intent_Absolute_Colorimetric, dcmsFlags);
+	stdLabToCMYKTrans = colorEngine.createTransform(ScCore->defaultLabProfile, Format_Lab_Dbl, DocInputCMYKProf, Format_CMYK_16, Intent_Absolute_Colorimetric, dcmsFlags);
+	stdLabToScreenTrans = colorEngine.createTransform(ScCore->defaultLabProfile, Format_Lab_Dbl, DocDisplayProf, Format_RGB_16, Intent_Absolute_Colorimetric, dcmsFlags);
 
 	bool success = (stdTransRGBMon   && stdTransCMYKMon   && stdProofImg    && stdProofImgCMYK &&
 					stdTransImg      && stdTransRGB       && stdTransCMYK   && stdProof        &&
 					stdProofGC       && stdProofCMYK      && stdProofCMYKGC &&
-					stdLabToRGBTrans && stdLabToCMYKTrans && stdProofLab    && stdProofLabGC);
+					stdLabToRGBTrans && stdLabToCMYKTrans && stdLabToScreenTrans && stdProofLab && stdProofLabGC);
 	if (!success)
 	{
 		CloseCMSProfiles();

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22473&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Mon Apr 23 11:25:46 2018
@@ -1324,6 +1324,7 @@
 	ScColorTransform stdProofCMYKGC;
 	ScColorTransform stdLabToRGBTrans;
 	ScColorTransform stdLabToCMYKTrans;
+	ScColorTransform stdLabToScreenTrans;
 	ScColorTransform stdProofLab;
 	ScColorTransform stdProofLabGC;
 	bool BlackPoint;




More information about the scribus-commit mailing list