Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 14169 → Rev 14170

/trunk/Scribus/scribus/documentchecker.cpp
150,8 → 150,8
int currPrintProfCS = -1;
if (currDoc->HasCMS)
{
cmsHPROFILE printerProf = currDoc->DocPrinterProf;
currPrintProfCS = static_cast<int>(cmsGetColorSpace(printerProf));
ScColorProfile printerProf = currDoc->DocPrinterProf;
currPrintProfCS = static_cast<int>(printerProf.colorSpace());
}
if (checkerSettings.checkNotCMYKOrSpot)
{
363,8 → 363,8
int currPrintProfCS = -1;
if (currDoc->HasCMS)
{
cmsHPROFILE printerProf = currDoc->DocPrinterProf;
currPrintProfCS = static_cast<int>(cmsGetColorSpace(printerProf));
ScColorProfile printerProf = currDoc->DocPrinterProf;
currPrintProfCS = static_cast<int>(printerProf.colorSpace());
}
if (checkerSettings.checkNotCMYKOrSpot)
{
/trunk/Scribus/scribus/pdflib_core.cpp
25,6 → 25,9
 
#include "scconfig.h"
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include <cstdlib>
#include <string>
6484,7 → 6487,7
}
if (!ite->Pfile2.isEmpty())
{
CMSettings cms(ite->doc(), "", 0);
CMSettings cms(ite->doc(), "", Intent_Perceptual);
img.LoadPicture(ite->Pfile2, 1, cms, false, false, ScImage::RGBData, 72);
QByteArray im;
img3.getAlpha(ite->Pfile2, 1, im, true, false);
6495,7 → 6498,7
}
if (!ite->Pfile3.isEmpty())
{
CMSettings cms(ite->doc(), "", 0);
CMSettings cms(ite->doc(), "", Intent_Perceptual);
img2.LoadPicture(ite->Pfile3, 1, cms, false, false, ScImage::RGBData, 72);
QByteArray im;
img3.getAlpha(ite->Pfile3, 1, im, true, false);
7294,7 → 7297,7
#endif
 
 
bool PDFLibCore::PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, const QString& Profil, bool Embedded, int Intent, QString* output)
bool PDFLibCore::PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, const QString& Profil, bool Embedded, eRenderIntent Intent, QString* output)
{
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
/trunk/Scribus/scribus/scpainterex_ps2.cpp
38,8 → 38,9
using namespace std;
#include <cmath>
#include "colormngt/sccolormngtengine.h"
#include "sccolorengine.h"
#include "util.h"
#include "sccolorengine.h"
 
ScPs2OutputParams::ScPs2OutputParams(ScribusDoc* doc)
{
459,9 → 460,9
}
else if ( m_options.hProfile && m_options.rgbToOutputColorTransform && m_options.cmykToOutputColorTransform)
{
DWORD colorIn[4];
DWORD colorOut[4];
cmsHTRANSFORM cmsTranform = NULL;
unsigned long colorIn[4];
unsigned long colorOut[4];
ScColorTransform cmsTranform = NULL;
if( colorShade.color.getColorModel() == colorModelRGB )
{
RGBColor rgb;
483,8 → 484,8
colorMode = cmykMode;
cmsTranform = m_options.cmykToOutputColorTransform;
}
cmsDoTransform( cmsTranform, colorIn, colorOut, 1 );
if (static_cast<int>(cmsGetColorSpace(m_options.hProfile)) == icSigRgbData)
cmsTranform.apply(colorIn, colorOut, 1 );
if (static_cast<int>(m_options.hProfile.colorSpace()) == icSigRgbData)
{
r = colorOut[0] / 257;
g = colorOut[1] / 257;
491,7 → 492,7
b = colorOut[2] / 257;
colorMode = rgbMode;
}
else if (static_cast<int>(cmsGetColorSpace(m_options.hProfile)) == icSigCmykData)
else if (static_cast<int>(m_options.hProfile.colorSpace()) == icSigCmykData)
{
c = colorOut[0] / 257;
m = colorOut[1] / 257;
/trunk/Scribus/scribus/scimgdataloader_ps.cpp
11,6 → 11,8
#include <QFileInfo>
#include <QRegExp>
 
#include "cmsettings.h"
#include "colormngt/sccolormngtengine.h"
#include "scclocale.h"
#include "scpaths.h"
#include "scribuscore.h"
21,7 → 23,6
#include "util_formats.h"
#include "util_ghostscript.h"
#include "util_math.h"
#include "cmsettings.h"
#include "scimage.h"
 
extern "C"
81,20 → 82,18
}
if (tmp.startsWith("%%EndICCProfile"))
{
cmsHPROFILE prof = cmsOpenProfileFromMem(psdata.data(), psdata.size());
ScColorMngtEngine engine(ScCore->defaultEngine);
ScColorProfile prof = engine.openProfileFromMem(psdata);
if (prof)
{
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigRgbData)
if (static_cast<int>(prof.colorSpace()) == icSigRgbData)
m_profileComponents = 3;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigCmykData)
if (static_cast<int>(prof.colorSpace()) == icSigCmykData)
m_profileComponents = 4;
const char *Descriptor;
Descriptor = cmsTakeProductDesc(prof);
m_imageInfoRecord.profileName = QString(Descriptor);
m_imageInfoRecord.profileName = prof.productDescription();
m_imageInfoRecord.isEmbedded = true;
m_embeddedProfile = QByteArray((const char*)psdata.data(), psdata.size());
m_embeddedProfile = psdata;
}
cmsCloseProfile(prof);
break;
}
}
179,7 → 178,7
f2.close();
imgc.resize(0);
ScImage thum;
CMSettings cms(0, "", 0);
CMSettings cms(0, "", Intent_Perceptual);
bool mode = true;
if (thum.LoadPicture(tmpFile, 1, cms, false, false, ScImage::RGBData, 72, &mode))
{
421,20 → 420,18
}
if (tmp.startsWith("%%EndICCProfile"))
{
cmsHPROFILE prof = cmsOpenProfileFromMem(psdata.data(), psdata.size());
ScColorMngtEngine engine(ScCore->defaultEngine);
ScColorProfile prof = engine.openProfileFromMem(psdata);
if (prof)
{
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigRgbData)
if (static_cast<int>(prof.colorSpace()) == icSigRgbData)
m_profileComponents = 3;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigCmykData)
if (static_cast<int>(prof.colorSpace()) == icSigCmykData)
m_profileComponents = 4;
const char *Descriptor;
Descriptor = cmsTakeProductDesc(prof);
m_imageInfoRecord.profileName = QString(Descriptor);
m_imageInfoRecord.profileName = prof.productDescription();
m_imageInfoRecord.isEmbedded = true;
m_embeddedProfile = QByteArray((const char*)psdata.data(), psdata.size());
m_embeddedProfile = psdata;
}
cmsCloseProfile(prof);
break;
}
}
/trunk/Scribus/scribus/util_ghostscript.cpp
38,6 → 38,10
#include <unistd.h>
#endif
 
#if defined(_WIN32)
#include <windows.h>
#endif
 
#include "prefsfile.h"
#include "prefsmanager.h"
#include "scpaths.h"
/trunk/Scribus/scribus/util.cpp
39,6 → 39,9
#include <execinfo.h>
#include <cxxabi.h>
#endif
#if defined(_WIN32)
#include <windows.h>
#endif
 
using namespace std;
 
/trunk/Scribus/scribus/pslib.h
35,7 → 35,7
 
#include "scribusapi.h"
#include "scribusstructs.h"
#include CMS_INC
#include "colormngt/sccolormngtengine.h"
 
#ifdef NLS_PROTO
class ScText;
191,7 → 191,7
bool useSpotColors;
bool fillRule;
bool applyICC;
cmsHTRANSFORM solidTransform;
ScColorTransform solidTransform;
QString currentSpot;
ColorList colorsToUse;
QString colorDesc;
/trunk/Scribus/scribus/scribuscore.h
27,7 → 27,7
#include "scribus.h"
#include "scribusapi.h"
 
#include CMS_INC
#include "colormngt/sccolormngtengine.h"
 
class QWidget;
class FileWatcher;
97,9 → 97,7
void getCMSProfiles(bool showInfo);
void getCMSProfilesDir(QString pfad, bool showInfo, bool recursive);
void InitDefaultColorTransforms(void);
void TermDefaultColorTransforms(void);
bool IsDefaultProfile(cmsHPROFILE prof);
bool IsDefaultTransform(cmsHTRANSFORM trans);
void ResetDefaultColorTransforms(void);
bool fileWatcherActive() const;
void recheckGS();
115,13 → 113,14
ProfilesL PrinterProfiles;
ProfilesL PDFXProfiles;
 
cmsHPROFILE defaultRGBProfile;
cmsHPROFILE defaultCMYKProfile;
cmsHTRANSFORM defaultRGBToScreenSolidTrans;
cmsHTRANSFORM defaultRGBToScreenImageTrans;
cmsHTRANSFORM defaultCMYKToScreenImageTrans;
cmsHTRANSFORM defaultRGBToCMYKTrans;
cmsHTRANSFORM defaultCMYKToRGBTrans;
ScColorMngtEngine defaultEngine;
ScColorProfile defaultRGBProfile;
ScColorProfile defaultCMYKProfile;
ScColorTransform defaultRGBToScreenSolidTrans;
ScColorTransform defaultRGBToScreenImageTrans;
ScColorTransform defaultCMYKToScreenImageTrans;
ScColorTransform defaultRGBToCMYKTrans;
ScColorTransform defaultCMYKToRGBTrans;
//CB FIXME protect
// QWidget *m_PaletteParent;
/trunk/Scribus/scribus/scribuscore.cpp
39,6 → 39,7
#include "util_icon.h"
#include "util_cms.h"
#include "util_ghostscript.h"
#include "sccolormngtenginefactory.h"
 
 
extern ScribusQApp* ScQApp;
45,7 → 46,7
 
#include "cmserrorhandling.h"
 
ScribusCore::ScribusCore() : QObject()
ScribusCore::ScribusCore() : QObject(), defaultEngine(colorMngtEngineFactory.createDefaultEngine())
{
m_ScribusInitialized=false;
m_SplashScreen=0;
54,13 → 55,10
// m_PaletteParent=0;
m_currScMW=0;
 
defaultRGBProfile = NULL;
defaultCMYKProfile = NULL;
defaultRGBToScreenSolidTrans = NULL;
defaultRGBToScreenImageTrans = NULL;
defaultCMYKToScreenImageTrans = NULL;
defaultRGBToCMYKTrans = NULL;
defaultCMYKToRGBTrans = NULL;
ScColorMngtStrategy strategy;
strategy.useBlackPointCompensation = true;
strategy.useBlackPreservation = false;
defaultEngine.setStrategy(strategy);
}
 
 
67,7 → 65,6
 
ScribusCore::~ScribusCore()
{
TermDefaultColorTransforms();
// delete m_PaletteParent;
}
 
378,128 → 375,80
 
void ScribusCore::getCMSProfilesDir(QString pfad, bool showInfo, bool recursive)
{
QDir d(pfad, "*", QDir::Name, QDir::Files | QDir::Readable | QDir::Dirs | QDir::NoSymLinks);
if ((d.exists()) && (d.count() != 0))
QString profileName;
QList<ScColorProfileInfo> profileInfos = defaultEngine.getAvailableProfileInfo(pfad, recursive);
for (int i = 0; i < profileInfos.count(); ++i)
{
QString nam = "";
const char *Descriptor;
cmsHPROFILE hIn = NULL;
 
for (uint dc = 0; dc < d.count(); ++dc)
const ScColorProfileInfo& profInfo = profileInfos.at(i);
profileName = profInfo.description;
if (profileName.isEmpty())
{
if (d[dc] == "." || d[dc] == "..")
continue;
QFileInfo fi(pfad + "/" + d[dc]);
if (fi.isDir() && !recursive)
continue;
else if (fi.isDir() && d[dc][0] != '.')
if (showInfo)
sDebug(QString("Color profile %s is broken : no valid description").arg(profInfo.file));
continue;
}
if (!profInfo.debug.isEmpty())
{
if (showInfo)
sDebug(profInfo.debug);
continue;
}
switch (static_cast<int>(profInfo.deviceClass))
{
case icSigInputClass:
if (static_cast<int>(profInfo.colorSpace) == icSigRgbData)
{
getCMSProfilesDir(fi.filePath()+"/", showInfo, true);
continue;
if (!InputProfiles.contains(profileName))
InputProfiles.insert(profileName, profInfo.file);
}
 
QFile f(fi.filePath());
QByteArray bb(40, ' ');
if (!f.open(QIODevice::ReadOnly)) {
sDebug(QString("couldn't open %1 as color profile").arg(fi.filePath()));
continue;
break;
case icSigColorSpaceClass:
if (static_cast<int>(profInfo.colorSpace) == icSigRgbData)
{
if (!InputProfiles.contains(profileName))
InputProfiles.insert(profileName, profInfo.file);
}
int len = f.read(bb.data(), 40);
f.close();
if (len == 40 && bb[36] == 'a' && bb[37] == 'c' && bb[38] == 's' && bb[39] == 'p')
if (static_cast<int>(profInfo.colorSpace) == icSigCmykData)
{
const QByteArray profilePath( QString(pfad + d[dc]).toLocal8Bit() );
if (setjmp(cmsJumpBuffer))
{
// Profile is broken, show info if necessary
if (showInfo)
sDebug(QString("Color profile %s is broken").arg(fi.filePath()));
// Reset to the default handler otherwise may enter a loop
// if an error occur in cmsCloseProfile()
cmsSetErrorHandler(NULL);
if (hIn)
{
cmsCloseProfile(hIn);
hIn = NULL;
}
continue;
}
cmsSetErrorHandler(&cmsErrorHandler);
hIn = cmsOpenProfileFromFile(profilePath.data(), "r");
if (hIn == NULL)
continue;
Descriptor = cmsTakeProductDesc(hIn);
nam = QString(Descriptor);
if (nam.isEmpty())
{
cmsCloseProfile(hIn);
if (showInfo)
sDebug(QString("Color profile %s is broken : no valid description").arg(fi.filePath()));
continue;
}
switch (static_cast<int>(cmsGetDeviceClass(hIn)))
{
case icSigInputClass:
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
{
if (!InputProfiles.contains(nam))
InputProfiles.insert(nam, pfad + d[dc]);
}
break;
case icSigColorSpaceClass:
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
{
if (!InputProfiles.contains(nam))
InputProfiles.insert(nam, pfad + d[dc]);
}
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
{
if (!InputProfilesCMYK.contains(nam))
InputProfilesCMYK.insert(nam, pfad + d[dc]);
}
break;
case icSigDisplayClass:
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
{
if (!MonitorProfiles.contains(nam))
MonitorProfiles.insert(nam, pfad + d[dc]);
if (!InputProfiles.contains(nam))
InputProfiles.insert(nam, pfad + d[dc]);
}
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
{
if (!InputProfilesCMYK.contains(nam))
InputProfilesCMYK.insert(nam, pfad + d[dc]);
}
break;
case icSigOutputClass:
// Disable rgb printer profile detection until effective support
// PrinterProfiles.insert(nam, pfad + d[dc], false);
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
{
if (!PDFXProfiles.contains(nam))
PDFXProfiles.insert(nam, pfad + d[dc]);
if (!InputProfilesCMYK.contains(nam))
InputProfilesCMYK.insert(nam, pfad + d[dc]);
if (!PrinterProfiles.contains(nam))
PrinterProfiles.insert(nam, pfad + d[dc]);
}
break;
}
cmsCloseProfile(hIn);
hIn = NULL;
if (showInfo)
sDebug( QString("Color profile %1 loaded from %2").arg(nam).arg(pfad + d[dc]) );
if (!InputProfilesCMYK.contains(profileName))
InputProfilesCMYK.insert(profileName, profInfo.file);
}
break;
case icSigDisplayClass:
if (static_cast<int>(profInfo.colorSpace) == icSigRgbData)
{
if (!MonitorProfiles.contains(profileName))
MonitorProfiles.insert(profileName, profInfo.file);
if (!InputProfiles.contains(profileName))
InputProfiles.insert(profileName, profInfo.file);
}
if (static_cast<int>(profInfo.colorSpace) == icSigCmykData)
{
if (!InputProfilesCMYK.contains(profileName))
InputProfilesCMYK.insert(profileName, profInfo.file);
}
break;
case icSigOutputClass:
// Disable rgb printer profile detection until effective support
// PrinterProfiles.insert(nam, pfad + d[dc], false);
if (static_cast<int>(profInfo.colorSpace) == icSigCmykData)
{
if (!PDFXProfiles.contains(profileName))
PDFXProfiles.insert(profileName, profInfo.file);
if (!InputProfilesCMYK.contains(profileName))
InputProfilesCMYK.insert(profileName, profInfo.file);
if (!PrinterProfiles.contains(profileName))
PrinterProfiles.insert(profileName, profInfo.file);
}
break;
}
cmsSetErrorHandler(NULL);
if (showInfo)
sDebug( QString("Color profile %1 loaded from %2").arg(profileName).arg(profInfo.file) );
}
}
 
void ScribusCore::InitDefaultColorTransforms(void)
{
TermDefaultColorTransforms();
 
cmsErrorAction(LCMS_ERROR_ABORT);
if (setjmp(cmsJumpBuffer))
{
507,7 → 456,7
// if an error occur afterwards
cmsSetErrorHandler(NULL);
cmsErrorAction(LCMS_ERROR_IGNORE);
TermDefaultColorTransforms();
ResetDefaultColorTransforms();
cmsErrorAction(LCMS_ERROR_ABORT);
return;
}
515,92 → 464,56
 
// Ouvre le profile RGB par d�fault
if (InputProfiles.contains("sRGB IEC61966-2.1"))
{
const QByteArray rgbProfPath(InputProfiles["sRGB IEC61966-2.1"].toLocal8Bit());
defaultRGBProfile = cmsOpenProfileFromFile(rgbProfPath.data(), "r");
}
defaultRGBProfile = defaultEngine.openProfileFromFile(InputProfiles["sRGB IEC61966-2.1"]);
else
defaultRGBProfile = cmsCreate_sRGBProfile();
defaultRGBProfile = defaultEngine.createProfile_sRGB();
 
// Ouvre le profile CMYK par d�faut
if (InputProfilesCMYK.contains("Fogra27L CMYK Coated Press"))
{
const QByteArray cmykProfPath(InputProfilesCMYK["Fogra27L CMYK Coated Press"].toLocal8Bit());
defaultCMYKProfile = cmsOpenProfileFromFile(cmykProfPath.data(), "r");
defaultCMYKProfile = defaultEngine.openProfileFromFile(InputProfilesCMYK["Fogra27L CMYK Coated Press"]);
}
 
if (!defaultRGBProfile || !defaultCMYKProfile)
{
TermDefaultColorTransforms();
ResetDefaultColorTransforms();
cmsSetErrorHandler(NULL);
return;
}
 
int dcmsFlags = cmsFLAGS_LOWRESPRECALC | cmsFLAGS_BLACKPOINTCOMPENSATION;
int intent = INTENT_RELATIVE_COLORIMETRIC;
int dcmsFlags = Ctf_BlackPointCompensation;
eRenderIntent intent = Intent_Relative_Colorimetric;
 
defaultRGBToScreenSolidTrans = scCmsCreateTransform(defaultRGBProfile, TYPE_RGB_16,
defaultRGBProfile, TYPE_RGB_16, intent, cmsFLAGS_NULLTRANSFORM);
defaultRGBToScreenImageTrans = scCmsCreateTransform(defaultRGBProfile, TYPE_RGBA_8,
defaultRGBProfile, TYPE_RGBA_8, intent, cmsFLAGS_NULLTRANSFORM);
defaultCMYKToScreenImageTrans = scCmsCreateTransform(defaultRGBProfile, TYPE_CMYK_8,
defaultCMYKProfile, TYPE_RGBA_8, intent, cmsFLAGS_NULLTRANSFORM);
defaultRGBToCMYKTrans = scCmsCreateTransform(defaultRGBProfile, TYPE_RGB_16,
defaultCMYKProfile, TYPE_CMYK_16, intent, dcmsFlags);
defaultCMYKToRGBTrans = scCmsCreateTransform(defaultCMYKProfile, TYPE_CMYK_16,
defaultRGBProfile, TYPE_RGB_16, intent, dcmsFlags);
defaultRGBToScreenSolidTrans = defaultEngine.createTransform(defaultRGBProfile, Format_RGB_16,
defaultRGBProfile, Format_RGB_16, intent, dcmsFlags);
defaultRGBToScreenImageTrans = defaultEngine.createTransform(defaultRGBProfile, Format_RGBA_8,
defaultRGBProfile, Format_RGBA_8, intent, dcmsFlags);
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);
if (!defaultRGBToScreenSolidTrans || !defaultRGBToScreenImageTrans ||
!defaultCMYKToScreenImageTrans || !defaultRGBToCMYKTrans ||
!defaultCMYKToRGBTrans )
{
TermDefaultColorTransforms();
ResetDefaultColorTransforms();
}
cmsSetErrorHandler(NULL);
}
 
void ScribusCore::TermDefaultColorTransforms(void)
void ScribusCore::ResetDefaultColorTransforms(void)
{
if (defaultRGBProfile)
cmsCloseProfile(defaultRGBProfile);
if (defaultCMYKProfile)
cmsCloseProfile(defaultCMYKProfile);
if (defaultRGBToScreenSolidTrans)
cmsDeleteTransform(defaultRGBToScreenSolidTrans);
if (defaultRGBToScreenImageTrans)
cmsDeleteTransform(defaultRGBToScreenImageTrans);
if (defaultCMYKToScreenImageTrans)
cmsDeleteTransform(defaultCMYKToScreenImageTrans);
if (defaultRGBToCMYKTrans)
cmsDeleteTransform(defaultRGBToCMYKTrans);
if (defaultCMYKToRGBTrans)
cmsDeleteTransform(defaultCMYKToRGBTrans);
defaultRGBProfile = NULL;
defaultCMYKProfile = NULL;
defaultRGBToScreenSolidTrans = NULL;
defaultRGBToScreenImageTrans = NULL;
defaultCMYKToScreenImageTrans = NULL;
defaultRGBToCMYKTrans = NULL;
defaultCMYKToRGBTrans = NULL;
defaultRGBProfile = ScColorProfile();
defaultCMYKProfile = ScColorProfile();
defaultRGBToScreenSolidTrans = ScColorTransform();
defaultRGBToScreenImageTrans = ScColorTransform();
defaultCMYKToScreenImageTrans = ScColorTransform();
defaultRGBToCMYKTrans = ScColorTransform();
defaultCMYKToRGBTrans = ScColorTransform();
}
 
bool ScribusCore::IsDefaultProfile(cmsHPROFILE prof)
{
if (prof == defaultRGBProfile || prof == defaultCMYKProfile)
return true;
return false;
}
 
bool ScribusCore::IsDefaultTransform(cmsHTRANSFORM trans)
{
if (trans == defaultRGBToScreenSolidTrans || trans == defaultRGBToScreenImageTrans)
return true;
if (trans == defaultCMYKToScreenImageTrans)
return true;
if (trans == defaultRGBToCMYKTrans || trans == defaultCMYKToRGBTrans)
return true;
return false;
}
 
void ScribusCore::initCMS()
{
if (m_HaveCMS)
/trunk/Scribus/scribus/scpainterex_ps2.h
41,12 → 41,11
 
#include "scribusapi.h"
#include "scconfig.h"
#include "colormngt/sccolormngtengine.h"
#include "fpoint.h"
#include "fpointarray.h"
#include "vgradient.h"
 
#include "scpainterexbase.h"
#include CMS_INC
 
class ScribusDoc;
 
63,11 → 62,11
bool mirrorH;
bool mirrorV;
QString outputProfile;
cmsHPROFILE hProfile;
cmsHTRANSFORM rgbToOutputColorTransform;
cmsHTRANSFORM rgbToOutputImageTransform;
cmsHTRANSFORM cmykToOutputColorTransform;
cmsHTRANSFORM cmykToOutputImageTransform;
ScColorProfile hProfile;
ScColorTransform rgbToOutputColorTransform;
ScColorTransform rgbToOutputImageTransform;
ScColorTransform cmykToOutputColorTransform;
ScColorTransform cmykToOutputImageTransform;
};
 
class SCRIBUS_API ScPainterEx_Ps2 : public ScPainterExBase
/trunk/Scribus/scribus/colormngt/sccolortransformdata.h
28,6 → 28,8
 
virtual bool apply(void* input, void* output, uint numElem) = 0;
virtual bool apply(QByteArray& input, QByteArray& output, uint numElem) = 0;
 
virtual void changeBufferFormat(eColorFormat input, eColorFormat output) = 0;
};
 
#endif
/trunk/Scribus/scribus/colormngt/sccolortransform.cpp
7,6 → 7,11
 
#include "sccolortransform.h"
 
ScColorTransform::ScColorTransform() : m_data(NULL)
{
 
}
 
ScColorTransform::ScColorTransform(ScColorTransformData* data) : m_data(data)
{
 
22,7 → 27,12
return m_data->apply(input, output, numElem);
}
 
bool ScColorTransform::operator==(const ScColorTransform& other)
void ScColorTransform::changeBufferFormat(eColorFormat input, eColorFormat output)
{
return m_data->changeBufferFormat(input, output);
}
 
bool ScColorTransform::operator==(const ScColorTransform& other) const
{
return m_data == other.m_data;
}
/trunk/Scribus/scribus/colormngt/sclcmscolortransformimpl.cpp
6,6 → 6,7
*/
 
#include "sclcmscolortransformimpl.h"
#include "sclcmscolormngtengineimpl.h"
 
ScLcmsColorTransformImpl::ScLcmsColorTransformImpl(ScColorMngtEngine& engine, cmsHTRANSFORM lcmsTransform)
: ScColorTransformImplBase(engine), m_transformHandle(lcmsTransform)
43,6 → 44,16
return false;
}
 
void ScLcmsColorTransformImpl::changeBufferFormat(eColorFormat input, eColorFormat output)
{
if (m_transformHandle)
{
DWORD lcmsInput = ScLcmsColorMngtEngineImpl::translateFormatToLcmsFormat(input);
DWORD lcmsOutput = ScLcmsColorMngtEngineImpl::translateFormatToLcmsFormat(output);
cmsChangeBuffersFormat(m_transformHandle, lcmsInput, lcmsOutput);
}
}
 
void ScLcmsColorTransformImpl::deleteTransform(void)
{
if (m_transformHandle)
/trunk/Scribus/scribus/colormngt/sccolortransform.h
9,11 → 9,13
#define SCCOLORTRANSFORM_H
 
#include <QSharedPointer>
#include "scribusapi.h"
#include "sccolortransformdata.h"
 
class ScColorTransform
class SCRIBUS_API ScColorTransform
{
public:
ScColorTransform();
ScColorTransform(ScColorTransformData* data);
ScColorMngtEngine& engine() { return m_data->engine(); }
27,8 → 29,11
bool apply(void* input, void* output, uint numElem);
bool apply(QByteArray& input, QByteArray& output, uint numElem);
 
bool operator==(const ScColorTransform& other);
// FIXME get rif of this API as soon as possible (cf scimage)
void changeBufferFormat(eColorFormat input, eColorFormat output);
 
bool operator==(const ScColorTransform& other) const;
 
protected:
QSharedPointer<ScColorTransformData> m_data;
};
/trunk/Scribus/scribus/colormngt/sclcmscolortransformimpl.h
25,6 → 25,8
virtual bool apply(void* input, void* output, uint numElem);
virtual bool apply(QByteArray& input, QByteArray& output, uint numElem);
 
virtual void changeBufferFormat(eColorFormat input, eColorFormat output);
 
protected:
cmsHTRANSFORM m_transformHandle;
 
/trunk/Scribus/scribus/colormngt/sccolormngtenginedata.h
40,6 → 40,9
// Setter, only for color management strategy, and purely virtual ;)
virtual void setStrategy(const ScColorMngtStrategy& strategy) = 0;
 
// function for getting available profile in a directory
virtual QList<ScColorProfileInfo> getAvailableProfileInfo(const QString& directory, bool recursive) = 0;
// functions for opening icc profiles
virtual ScColorProfile openProfileFromFile(ScColorMngtEngine& engine, const QString& filePath) = 0;
58,7 → 61,7
const ScColorProfile& inputProfile , eColorFormat inputFormat,
const ScColorProfile& outputProfile, eColorFormat outputFormat,
const ScColorProfile& proofing, eRenderIntent renderIntent,
eRenderIntent proofingIntent, long transformFlags) = 0;
eRenderIntent proofingIntent, long transformFlags) = 0;
};
 
#endif
/trunk/Scribus/scribus/colormngt/sccolormngtengine.cpp
33,6 → 33,11
m_data->setStrategy(strategy);
}
 
QList<ScColorProfileInfo> ScColorMngtEngine::getAvailableProfileInfo(const QString& directory, bool recursive)
{
return m_data->getAvailableProfileInfo(directory, recursive);
}
 
ScColorProfile ScColorMngtEngine::openProfileFromFile(const QString& filePath)
{
return m_data->openProfileFromFile(*this, filePath);
/trunk/Scribus/scribus/colormngt/sclcmscolormngtengineimpl.cpp
5,6 → 5,8
for which a new license (GPL+exception) is in place.
*/
 
#include <iostream>
#include <QDir>
#include <QFile>
 
#include "sclcmscolormngtengineimpl.h"
15,6 → 17,8
#define cmsFLAGS_PRESERVEBLACK 0x8000
#endif
 
jmp_buf ScLcmsColorMngtEngineImpl::cmsJumpBuffer;
 
QSharedPointer<ScColorProfileCache> ScLcmsColorMngtEngineImpl::m_profileCache;
 
ScLcmsColorMngtEngineImpl::ScLcmsColorMngtEngineImpl()
22,6 → 26,7
{
if (!m_profileCache)
m_profileCache = QSharedPointer<ScColorProfileCache>(new ScColorProfileCache());
cmsSetAlarmCodes(0, 255, 0);
}
 
void ScLcmsColorMngtEngineImpl::setStrategy(const ScColorMngtStrategy& strategy)
30,6 → 35,87
m_transformPool.clear();
}
 
QList<ScColorProfileInfo> ScLcmsColorMngtEngineImpl::getAvailableProfileInfo(const QString& directory, bool recursive)
{
QList<ScColorProfileInfo> profileInfos;
 
QDir d(directory, "*", QDir::Name, QDir::Files | QDir::Readable | QDir::Dirs | QDir::NoSymLinks);
if ((!d.exists()) || (d.count() == 0))
return profileInfos;
 
QString nam = "";
cmsHPROFILE hIn = NULL;
 
for (uint dc = 0; dc < d.count(); ++dc)
{
QString file = d[dc];
if (file == "." || file == "..")
continue;
QFileInfo fi(directory + "/" + file);
if (fi.isDir() && !recursive)
continue;
else if (fi.isDir() && !file.startsWith('.'))
{
QList<ScColorProfileInfo> profileInfos2 = getAvailableProfileInfo(fi.filePath()+"/", true);
profileInfos.append(profileInfos2);
continue;
}
 
ScColorProfileInfo profileInfo;
profileInfo.file = fi.filePath();
 
QFile f(fi.filePath());
QByteArray bb(40, ' ');
if (!f.open(QIODevice::ReadOnly)) {
profileInfo.debug = QString("couldn't open %1 as color profile").arg(fi.filePath());
profileInfos.append(profileInfo);
continue;
}
int len = f.read(bb.data(), 40);
f.close();
if (len == 40 && bb[36] == 'a' && bb[37] == 'c' && bb[38] == 's' && bb[39] == 'p')
{
const QByteArray profilePath( QString(directory + "/" + file).toLocal8Bit() );
if (setjmp(cmsJumpBuffer))
{
// Profile is broken
profileInfo.debug = QString("Color profile %1 is broken").arg(fi.filePath());
profileInfos.append(profileInfo);
// Reset to the default handler otherwise may enter a loop
// if an error occur in cmsCloseProfile()
cmsSetErrorHandler(NULL);
if (hIn)
{
cmsCloseProfile(hIn);
hIn = NULL;
}
continue;
}
cmsSetErrorHandler(&cmsErrorHandler);
hIn = cmsOpenProfileFromFile(profilePath.data(), "r");
if (hIn == NULL)
continue;
const char* profileDescriptor = cmsTakeProductDesc(hIn);
profileInfo.description = QString(profileDescriptor);
if (profileInfo.description.isEmpty())
{
cmsCloseProfile(hIn);
profileInfo.debug = QString("Color profile %1 is broken : no valid description").arg(fi.filePath());
profileInfos.append(profileInfo);
continue;
}
profileInfo.colorSpace = cmsGetColorSpace(hIn);
profileInfo.deviceClass = cmsGetDeviceClass(hIn);
profileInfos.append(profileInfo);
cmsCloseProfile(hIn);
hIn = NULL;
}
}
cmsSetErrorHandler(NULL);
 
return profileInfos;
}
 
ScColorProfile ScLcmsColorMngtEngineImpl::openProfileFromFile(ScColorMngtEngine& engine, const QString& filePath)
{
// Search profile in profile cache first
36,19 → 122,24
ScColorProfile profile;
// We do not use lcms cmsOpenProfileFromFile() to avoid limitations
// of I/O on 8bit filenames on Windows
QByteArray data = QFile(filePath).readAll();
if (!data.isEmpty())
QFile file(filePath);
if (file.open(QFile::ReadOnly))
{
cmsHPROFILE lcmsProf = cmsOpenProfileFromMem(data.data(), data.size());
if (lcmsProf)
QByteArray data = file.readAll();
if (!data.isEmpty())
{
ScLcmsColorProfileImpl* profData = new ScLcmsColorProfileImpl(engine, lcmsProf);
profData->m_profileData = data;
profData->m_profilePath = filePath;
profile = ScColorProfile(dynamic_cast<ScColorProfileData*>(profData));
cmsHPROFILE lcmsProf = cmsOpenProfileFromMem(data.data(), data.size());
if (lcmsProf)
{
ScLcmsColorProfileImpl* profData = new ScLcmsColorProfileImpl(engine, lcmsProf);
profData->m_profileData = data;
profData->m_profilePath = filePath;
profile = ScColorProfile(dynamic_cast<ScColorProfileData*>(profData));
}
if (profile.isNull() && lcmsProf)
cmsCloseProfile(lcmsProf);
}
if (profile.isNull() && lcmsProf)
cmsCloseProfile(lcmsProf);
file.close();
}
return profile;
}
158,7 → 249,7
lcmsFlags |= cmsFLAGS_NULLTRANSFORM;
cmsHTRANSFORM hTransform = cmsCreateTransform(lcmsInputProf->m_profileHandle , lcmsInputFmt,
lcmsOutputProf->m_profileHandle, lcmsOutputFmt,
lcmsIntent, lcmsFlags);
lcmsIntent, lcmsFlags | cmsFLAGS_LOWRESPRECALC);
if (hTransform)
{
ScLcmsColorTransformImpl* newTrans = new ScLcmsColorTransformImpl(engine, hTransform);
254,7 → 345,7
{
cmsHTRANSFORM hTransform = cmsCreateTransform(lcmsInputProf->m_profileHandle , lcmsInputFmt,
lcmsOutputProf->m_profileHandle, lcmsOutputFmt,
lcmsPrfIntent, lcmsFlags);
lcmsPrfIntent, lcmsFlags | cmsFLAGS_LOWRESPRECALC);
if (hTransform)
{
ScLcmsColorTransformImpl* newTrans = new ScLcmsColorTransformImpl(engine, hTransform);
315,7 → 406,9
lFormat = TYPE_GRAY_8;
if (format == Format_GRAY_16)
lFormat = TYPE_GRAY_16;
return format;
if (format == Format_LabA_8)
lFormat = COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1);
return lFormat;
}
 
int ScLcmsColorMngtEngineImpl::translateIntentToLcmsIntent(eRenderIntent intent, eRenderIntent defIntent)
331,3 → 424,10
lIntent = INTENT_ABSOLUTE_COLORIMETRIC;
return lIntent;
}
 
int ScLcmsColorMngtEngineImpl::cmsErrorHandler(int /*ErrorCode*/, const char *ErrorText)
{
std::cerr << "Littlecms : " << ErrorText << std::endl;
longjmp(cmsJumpBuffer, 1);
return 1;
}
/trunk/Scribus/scribus/colormngt/sccolorprofile.cpp
33,4 → 33,9
QString ScColorProfile::productDescription() const
{
return m_data->productDescription();
}
 
bool ScColorProfile::operator==(const ScColorProfile& other) const
{
return m_data == other.m_data;
}
/trunk/Scribus/scribus/colormngt/sccolormngtengine.h
8,10 → 8,12
#ifndef SCCOLORMNGTENGINE_H
#define SCCOLORMNGTENGINE_H
 
#include <QList>
#include <QSharedPointer>
#include "scribusapi.h"
#include "sccolormngtenginedata.h"
 
class ScColorMngtEngine
class SCRIBUS_API ScColorMngtEngine
{
public:
ScColorMngtEngine(ScColorMngtEngineData*);
23,6 → 25,9
// Setters, only for color management strategy, and purely virtual ;)
void setStrategy(const ScColorMngtStrategy& strategy);
 
// function for getting available profile in a directory
QList<ScColorProfileInfo> getAvailableProfileInfo(const QString& directory, bool recursive);
// functions for opening icc profiles
ScColorProfile openProfileFromFile(const QString& filePath);
/trunk/Scribus/scribus/colormngt/sclcmscolormngtengineimpl.h
8,6 → 8,8
#ifndef SCLCMSCOLORMNGTENGINEIMPL_H
#define SCLCMSCOLORMNGTENGINEIMPL_H
 
#include <setjmp.h>
 
#include "lcms.h"
#include "sccolormngtenginedata.h"
#include "sccolorprofilecache.h"
14,11 → 16,16
 
class ScLcmsColorMngtEngineImpl : public ScColorMngtEngineData
{
friend class ScLcmsColorTransformImpl;
 
public:
ScLcmsColorMngtEngineImpl();
 
// Setter, only for color management strategy
virtual void setStrategy(const ScColorMngtStrategy& strategy);
 
// function for getting available profile in a directory
virtual QList<ScColorProfileInfo> getAvailableProfileInfo(const QString& directory, bool recursive);
// functions for opening icc profiles
virtual ScColorProfile openProfileFromFile(ScColorMngtEngine& engine, const QString& filePath);
43,9 → 50,23
 
static QSharedPointer<ScColorProfileCache> m_profileCache;
 
DWORD translateFlagsToLcmsFlags(long flags);
DWORD translateFormatToLcmsFormat(eColorFormat format);
int translateIntentToLcmsIntent(eRenderIntent intent, eRenderIntent defaut = Intent_Relative_Colorimetric);
static DWORD translateFlagsToLcmsFlags(long flags);
static DWORD translateFormatToLcmsFormat(eColorFormat format);
static int translateIntentToLcmsIntent(eRenderIntent intent, eRenderIntent defaut = Intent_Relative_Colorimetric);
 
// (Nasty) error handling : get rid of that in lcms2
/*!
\brief Jump buffer used by cmsErrorHandler, must be set with the setjmp() function
* before cmsErrorHandler may be called
*/
static jmp_buf cmsJumpBuffer;
 
/*!
\brief Simple error handler for use in conjunction with littlecms
\param ErrorCode error code issued by little cms
\param ErrorText error message corresponding to the error code
*/
static int cmsErrorHandler(int ErrorCode, const char *ErrorText);
};
 
#endif
/trunk/Scribus/scribus/colormngt/sccolormngtstructs.h
8,6 → 8,7
#ifndef SCCOLORMNGTSTRUCTS_H
#define SCCOLORMNGTSTRUCTS_H
 
#include "icc34.h" //part of lcms1
#include <QString>
 
typedef enum
28,7 → 29,8
Format_YMCK_8,
Format_YMCK_16,
Format_GRAY_8,
Format_GRAY_16
Format_GRAY_16,
Format_LabA_8
} eColorFormat;
 
typedef enum
41,10 → 43,11
 
typedef enum
{
Intent_Perceptual,
Intent_Relative_Colorimetric,
Intent_Saturation,
Intent_Absolute_Colorimetric
Intent_Perceptual = 0,
Intent_Relative_Colorimetric = 1,
Intent_Saturation = 2,
Intent_Absolute_Colorimetric = 3,
Intent_Max = 4
} eRenderIntent;
 
class ScColorMngtStrategy
62,6 → 65,15
 
typedef struct
{
QString file;
QString description;
icColorSpaceSignature colorSpace;
icProfileClassSignature deviceClass;
QString debug;
} ScColorProfileInfo;
 
typedef struct
{
QString inputProfile;
QString outputProfile;
QString proofingProfile;
/trunk/Scribus/scribus/colormngt/sccolorprofile.h
9,9 → 9,10
#define SCCOLORPROFILE_H
 
#include <QSharedPointer>
#include "scribusapi.h"
#include "sccolorprofiledata.h"
 
class ScColorProfile
class SCRIBUS_API ScColorProfile
{
public:
ScColorProfile();
30,6 → 31,8
icProfileClassSignature deviceClass() const;
const ScColorProfileData* data() const { return m_data.data(); }
 
bool operator==(const ScColorProfile& prof) const;
protected:
QSharedPointer<ScColorProfileData> m_data;
/trunk/Scribus/scribus/colormngt/CMakeLists.txt
0,0 → 1,27
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/scribus
${LCMS_INCLUDE_DIR}
)
 
SET(SCRIBUS_COLORMNGT_LIB_SOURCES
sccolormngtengine.cpp
sccolormngtenginefactory.cpp
sccolormngtimplelem.cpp
sccolormngtstructs.cpp
sccolorprofile.cpp
sccolorprofilecache.cpp
sccolortransform.cpp
sccolortransformpool.cpp
sclcmscolormngtengineimpl.cpp
sclcmscolorprofileimpl.cpp
sclcmscolortransformimpl.cpp
)
SET(SCRIBUS_COLORMNGT_LIB "scribus_colormngt_lib")
ADD_LIBRARY(${SCRIBUS_COLORMNGT_LIB} STATIC ${SCRIBUS_COLORMNGT_LIB_SOURCES})
# This is a convenience library that for linkage purposes is part of Scribus's
# main API.
SET_TARGET_PROPERTIES(${SCRIBUS_COLORMNGT_LIB}
PROPERTIES
COMPILE_FLAGS -DCOMPILE_SCRIBUS_MAIN_APP
)
/trunk/Scribus/scribus/pdflib_core.h
162,7 → 162,7
#endif
void PDF_Form(const QString& im);
void PDF_xForm(uint objNr, double w, double h, QString im);
bool PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, int Intent = 1, QString* output = NULL);
bool PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QString* output = NULL);
bool PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN, const QString& Profil, bool Embedded, int Intent, ShIm& imgInfo, QString* output = NULL);
#if HAVE_PODOFO
void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
/trunk/Scribus/scribus/scribusdoc.cpp
64,6 → 64,7
#include "resourcecollection.h"
#include "sccolorengine.h"
#include "ui/scmessagebox.h"
#include "sccolormngtenginefactory.h"
#include "scpainter.h"
#include "scraction.h"
#include "scribus.h"
188,6 → 189,7
Layers(),
marginColored(prefsData.displayPrefs.marginColored),
GroupCounter(1),
colorEngine(ScCore->defaultEngine),
JavaScripts(),
TotalItems(0),
MinWordLen(prefsData.hyphPrefs.MinWordLen),
301,6 → 303,7
Layers(),
marginColored(prefsData.displayPrefs.marginColored),
GroupCounter(1),
colorEngine(ScCore->defaultEngine),
JavaScripts(),
TotalItems(0),
MinWordLen(prefsData.hyphPrefs.MinWordLen),
352,22 → 355,7
HasCMS = false;
CMSSettings.CMSinUse = false;
 
DocInputRGBProf = NULL;
DocInputCMYKProf = NULL;
DocInputImageRGBProf = NULL;
DocInputImageCMYKProf = NULL;
DocOutputProf = NULL;
DocPrinterProf = NULL;
stdTransRGBMon = NULL;
stdTransCMYKMon = NULL;
stdProof = NULL;
stdTransImg = NULL;
stdProofImg = NULL;
stdTransCMYK = NULL;
stdProofCMYK = NULL;
stdTransRGB = NULL;
stdProofGC = NULL;
stdProofCMYKGC = NULL;
colorEngine = ScCore->defaultEngine;
SetDefaultCMSParams();
 
// init update change management
631,57 → 619,6
void ScribusDoc::CloseCMSProfiles()
{
HasCMS = false;
if (ScCore->haveCMS() /*&& CMSSettings.CMSinUse*/)
{
if (DocInputImageRGBProf && !ScCore->IsDefaultProfile(DocInputImageRGBProf))
cmsCloseProfile(DocInputImageRGBProf);
if (DocInputImageCMYKProf && !ScCore->IsDefaultProfile(DocInputImageCMYKProf))
cmsCloseProfile(DocInputImageCMYKProf);
if (DocInputRGBProf && !ScCore->IsDefaultProfile(DocInputRGBProf))
cmsCloseProfile(DocInputRGBProf);
if (DocInputCMYKProf && !ScCore->IsDefaultProfile(DocInputCMYKProf))
cmsCloseProfile(DocInputCMYKProf);
if (DocOutputProf && !ScCore->IsDefaultProfile(DocOutputProf))
cmsCloseProfile(DocOutputProf);
if (DocPrinterProf && !ScCore->IsDefaultProfile(DocPrinterProf))
cmsCloseProfile(DocPrinterProf);
if (stdTransRGBMon && !ScCore->IsDefaultTransform(stdTransRGBMon))
cmsDeleteTransform(stdTransRGBMon);
if (stdTransCMYKMon && !ScCore->IsDefaultTransform(stdTransCMYKMon))
cmsDeleteTransform(stdTransCMYKMon);
if (stdProof && !ScCore->IsDefaultTransform(stdProof))
cmsDeleteTransform(stdProof);
if (stdTransImg && !ScCore->IsDefaultTransform(stdTransImg))
cmsDeleteTransform(stdTransImg);
if (stdProofImg && !ScCore->IsDefaultTransform(stdProofImg))
cmsDeleteTransform(stdProofImg);
if (stdTransCMYK && !ScCore->IsDefaultTransform(stdTransCMYK))
cmsDeleteTransform(stdTransCMYK);
if (stdProofCMYK && !ScCore->IsDefaultTransform(stdProofCMYK))
cmsDeleteTransform(stdProofCMYK);
if (stdTransRGB && !ScCore->IsDefaultTransform(stdTransRGB))
cmsDeleteTransform(stdTransRGB);
if (stdProofCMYKGC && !ScCore->IsDefaultTransform(stdProofCMYKGC))
cmsDeleteTransform(stdProofCMYKGC);
if (stdProofGC && !ScCore->IsDefaultTransform(stdProofGC))
cmsDeleteTransform(stdProofGC);
DocInputRGBProf = NULL;
DocInputCMYKProf = NULL;
DocInputImageRGBProf = NULL;
DocInputImageCMYKProf = NULL;
DocOutputProf = NULL;
DocPrinterProf = NULL;
stdTransRGBMon = NULL;
stdTransCMYKMon = NULL;
stdProof = NULL;
stdTransImg = NULL;
stdProofImg = NULL;
stdTransCMYK = NULL;
stdProofCMYK = NULL;
stdTransRGB = NULL;
stdProofCMYKGC = NULL;
stdProofGC = NULL;
}
SetDefaultCMSParams();
}
 
690,8 → 627,8
BlackPoint = true;
SoftProofing = false;
Gamut = false;
IntentColors = 1; // INTENT_RELATIVE_COLORIMETRIC
IntentImages = 1; // INTENT_RELATIVE_COLORIMETRIC
IntentColors = Intent_Relative_Colorimetric;
IntentImages = Intent_Relative_Colorimetric;
DocInputRGBProf = ScCore->defaultRGBProfile;
DocInputCMYKProf = ScCore->defaultCMYKProfile;
DocInputImageRGBProf = ScCore->defaultRGBProfile;
714,7 → 651,7
bool ScribusDoc::OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo)
{
HasCMS = false;
cmsHPROFILE inputProf = NULL;
ScColorProfile inputProf;
cmsErrorAction(LCMS_ERROR_ABORT);
if (setjmp(cmsJumpBuffer))
{
733,72 → 670,61
return false;
}
cmsSetErrorHandler(&cmsErrorHandler);
const QByteArray rgbInputProfilePath(InPo[CMSSettings.DefaultSolidColorRGBProfile].toLocal8Bit());
DocInputRGBProf = cmsOpenProfileFromFile(rgbInputProfilePath.data(), "r");
const QByteArray cmykInputProfilePath(InPoCMYK[CMSSettings.DefaultSolidColorCMYKProfile].toLocal8Bit());
DocInputCMYKProf = cmsOpenProfileFromFile(cmykInputProfilePath.data(), "r");
const QByteArray monitorProfilePath(MoPo[CMSSettings.DefaultMonitorProfile].toLocal8Bit());
DocOutputProf = cmsOpenProfileFromFile(monitorProfilePath.data(), "r");
const QByteArray printerProfilePath(PrPo[CMSSettings.DefaultPrinterProfile].toLocal8Bit());
DocPrinterProf = cmsOpenProfileFromFile(printerProfilePath, "r");
const QByteArray rgbInputImgProfilePath(InPo[CMSSettings.DefaultImageRGBProfile].toLocal8Bit());
DocInputImageRGBProf = cmsOpenProfileFromFile(rgbInputImgProfilePath.data(), "r");
const QByteArray cmykInputImgProfilePath(InPoCMYK[CMSSettings.DefaultImageCMYKProfile].toLocal8Bit());
DocInputImageCMYKProf = cmsOpenProfileFromFile(cmykInputImgProfilePath.data(), "r");
if ((DocInputRGBProf == NULL) || (DocInputCMYKProf == NULL) || (DocOutputProf == NULL) || (DocPrinterProf == NULL) || (DocInputImageCMYKProf == NULL) || (DocInputImageRGBProf == NULL))
 
colorEngine = colorMngtEngineFactory.createDefaultEngine();
ScColorMngtStrategy colorStrategy;
colorStrategy.useBlackPointCompensation = CMSSettings.BlackPoint;
colorStrategy.useBlackPreservation = false;
colorEngine.setStrategy(colorStrategy);
 
DocInputRGBProf = colorEngine.openProfileFromFile( InPo[CMSSettings.DefaultSolidColorRGBProfile] );
DocInputCMYKProf = colorEngine.openProfileFromFile( InPoCMYK[CMSSettings.DefaultSolidColorCMYKProfile] );
DocOutputProf = colorEngine.openProfileFromFile( MoPo[CMSSettings.DefaultMonitorProfile] );
DocPrinterProf = colorEngine.openProfileFromFile( PrPo[CMSSettings.DefaultPrinterProfile] );
DocInputImageRGBProf = colorEngine.openProfileFromFile( InPo[CMSSettings.DefaultImageRGBProfile] );
DocInputImageCMYKProf = colorEngine.openProfileFromFile( InPoCMYK[CMSSettings.DefaultImageCMYKProfile] );
if ((!DocInputRGBProf) || (!DocInputCMYKProf) || (!DocOutputProf) || (!DocPrinterProf) || (!DocInputImageCMYKProf) || (!DocInputImageRGBProf))
{
CMSSettings.CMSinUse = false;
cmsSetErrorHandler(NULL);
return false;
}
int dcmsFlags = 0;
 
int dcmsFlags = 0;
int dcmsFlagsGC = 0;
dcmsFlags |= cmsFLAGS_LOWRESPRECALC;
dcmsFlagsGC |= cmsFLAGS_LOWRESPRECALC;
// int dcmsFlags2 = cmsFLAGS_NOTPRECALC;
if (CMSSettings.GamutCheck)
dcmsFlagsGC |= cmsFLAGS_GAMUTCHECK;
dcmsFlagsGC |= Ctf_GamutCheck;
if (CMSSettings.BlackPoint)
{
dcmsFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
dcmsFlagsGC |= cmsFLAGS_BLACKPOINTCOMPENSATION;
dcmsFlags |= Ctf_BlackPointCompensation;
dcmsFlagsGC |= Ctf_BlackPointCompensation;
}
// set Gamut alarm color to #00ff00
cmsSetAlarmCodes(0, 255, 0);
stdTransRGBMon = scCmsCreateTransform(DocInputRGBProf, TYPE_RGB_16,
DocOutputProf, TYPE_RGB_16,
IntentColors,
dcmsFlags);
stdTransCMYKMon = scCmsCreateTransform(DocInputCMYKProf, TYPE_CMYK_16,
DocOutputProf, TYPE_RGB_16,
IntentColors,
dcmsFlags);
stdTransRGBMon = colorEngine.createTransform(DocInputRGBProf, Format_RGB_16,
DocOutputProf, Format_RGB_16,
IntentColors, dcmsFlags);
stdTransCMYKMon = colorEngine.createTransform(DocInputCMYKProf, Format_CMYK_16,
DocOutputProf, Format_RGB_16,
IntentColors, dcmsFlags);
// TODO : check input profiles used for images
stdProofImg = scCmsCreateProofingTransform(DocInputImageRGBProf, TYPE_RGBA_8,
DocOutputProf, TYPE_RGBA_8,
DocPrinterProf,
IntentImages,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlagsGC | cmsFLAGS_SOFTPROOFING);
stdProofImgCMYK = scCmsCreateProofingTransform(DocInputImageCMYKProf, TYPE_CMYK_8,
DocOutputProf, TYPE_RGBA_8,
DocPrinterProf,
IntentImages,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlagsGC | cmsFLAGS_SOFTPROOFING);
stdTransImg = scCmsCreateTransform(DocInputRGBProf, TYPE_RGBA_8,
DocOutputProf, TYPE_RGBA_8,
IntentImages,
dcmsFlags);
stdTransRGB = scCmsCreateTransform(DocInputCMYKProf, TYPE_CMYK_16,
DocInputRGBProf, TYPE_RGB_16,
IntentColors,
dcmsFlags);
stdTransCMYK = scCmsCreateTransform(DocInputRGBProf, TYPE_RGB_16,
DocInputCMYKProf, TYPE_CMYK_16,
IntentColors,
dcmsFlags);
cmsHPROFILE inputProfRGB = NULL;
cmsHPROFILE inputProfCMYK = NULL;
if (static_cast<int>(cmsGetColorSpace(DocPrinterProf)) == icSigCmykData)
stdProofImg = colorEngine.createProofingTransform(DocInputImageRGBProf, Format_RGBA_8,
DocOutputProf, Format_RGBA_8, DocPrinterProf,
IntentImages, Intent_Relative_Colorimetric, dcmsFlagsGC);
stdProofImgCMYK = colorEngine.createProofingTransform(DocInputImageCMYKProf, Format_CMYK_8,
DocOutputProf, Format_RGBA_8, DocPrinterProf,
IntentImages, Intent_Relative_Colorimetric, dcmsFlagsGC);
stdTransImg = colorEngine.createTransform(DocInputRGBProf, Format_RGBA_8,
DocOutputProf, Format_RGBA_8,
IntentImages, dcmsFlags);
stdTransRGB = colorEngine.createTransform(DocInputCMYKProf, Format_CMYK_16,
DocInputRGBProf, Format_RGB_16,
IntentColors, dcmsFlags);
stdTransCMYK = colorEngine.createTransform(DocInputRGBProf, Format_RGB_16,
DocInputCMYKProf, Format_CMYK_16,
IntentColors, dcmsFlags);
 
ScColorProfile inputProfRGB;
ScColorProfile inputProfCMYK;
if (static_cast<int>(DocPrinterProf.colorSpace()) == icSigCmykData)
{
inputProf = (CMSSettings.SoftProofOn && CMSSettings.SoftProofFullOn) ? DocInputCMYKProf : DocPrinterProf;
inputProfRGB = DocInputRGBProf;
810,44 → 736,42
inputProfRGB = inputProf;
inputProfCMYK = DocInputCMYKProf;
}
stdProof = scCmsCreateProofingTransform(inputProfRGB, TYPE_RGB_16,
DocOutputProf, TYPE_RGB_16,
stdProof = colorEngine.createProofingTransform(inputProfRGB, Format_RGB_16,
DocOutputProf, Format_RGB_16,
DocPrinterProf,
IntentColors,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlags | cmsFLAGS_SOFTPROOFING);
stdProofGC = scCmsCreateProofingTransform(inputProfRGB, TYPE_RGB_16,
DocOutputProf, TYPE_RGB_16,
DocPrinterProf,
IntentColors,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlags | cmsFLAGS_SOFTPROOFING | cmsFLAGS_GAMUTCHECK);
stdProofCMYK = scCmsCreateProofingTransform(inputProfCMYK, TYPE_CMYK_16,
DocOutputProf, TYPE_RGB_16,
Intent_Relative_Colorimetric, dcmsFlags);
stdProofGC = colorEngine.createProofingTransform(inputProfRGB, Format_RGB_16,
DocOutputProf, Format_RGB_16,
DocPrinterProf, IntentColors,
Intent_Relative_Colorimetric, dcmsFlags| cmsFLAGS_GAMUTCHECK);
stdProofCMYK = colorEngine.createProofingTransform(inputProfCMYK, Format_CMYK_16,
DocOutputProf, Format_RGB_16,
DocPrinterProf, IntentColors,
Intent_Relative_Colorimetric, dcmsFlags);
stdProofCMYKGC = colorEngine.createProofingTransform(inputProfCMYK, Format_CMYK_16,
DocOutputProf, Format_RGB_16,
DocPrinterProf,
IntentColors,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlags | cmsFLAGS_SOFTPROOFING);
stdProofCMYKGC = scCmsCreateProofingTransform(inputProfCMYK, TYPE_CMYK_16,
DocOutputProf, TYPE_RGB_16,
DocPrinterProf,
IntentColors,
INTENT_RELATIVE_COLORIMETRIC, dcmsFlags | cmsFLAGS_SOFTPROOFING | cmsFLAGS_GAMUTCHECK);
Intent_Relative_Colorimetric, dcmsFlags | cmsFLAGS_GAMUTCHECK);
 
if (static_cast<int>(cmsGetColorSpace(DocInputRGBProf)) == icSigRgbData)
if (static_cast<int>(DocInputRGBProf.colorSpace()) == icSigRgbData)
CMSSettings.ComponentsInput2 = 3;
if (static_cast<int>(cmsGetColorSpace(DocInputRGBProf)) == icSigCmykData)
if (static_cast<int>(DocInputRGBProf.colorSpace()) == icSigCmykData)
CMSSettings.ComponentsInput2 = 4;
if (static_cast<int>(cmsGetColorSpace(DocInputRGBProf)) == icSigCmyData)
if (static_cast<int>(DocInputRGBProf.colorSpace()) == icSigCmyData)
CMSSettings.ComponentsInput2 = 3;
if (static_cast<int>(cmsGetColorSpace(DocInputCMYKProf)) == icSigRgbData)
if (static_cast<int>(DocInputCMYKProf.colorSpace()) == icSigRgbData)
CMSSettings.ComponentsInput3 = 3;
if (static_cast<int>(cmsGetColorSpace(DocInputCMYKProf)) == icSigCmykData)
if (static_cast<int>(DocInputCMYKProf.colorSpace()) == icSigCmykData)
CMSSettings.ComponentsInput3 = 4;
if (static_cast<int>(cmsGetColorSpace(DocInputCMYKProf)) == icSigCmyData)
if (static_cast<int>(DocInputCMYKProf.colorSpace()) == icSigCmyData)
CMSSettings.ComponentsInput3 = 3;
if (static_cast<int>(cmsGetColorSpace(DocPrinterProf)) == icSigRgbData)
if (static_cast<int>(DocPrinterProf.colorSpace()) == icSigRgbData)
CMSSettings.ComponentsPrinter = 3;
if (static_cast<int>(cmsGetColorSpace(DocPrinterProf)) == icSigCmykData)
if (static_cast<int>(DocPrinterProf.colorSpace()) == icSigCmykData)
CMSSettings.ComponentsPrinter = 4;
if (static_cast<int>(cmsGetColorSpace(DocPrinterProf)) == icSigCmyData)
if (static_cast<int>(DocPrinterProf.colorSpace()) == icSigCmyData)
CMSSettings.ComponentsPrinter = 3;
 
cmsSetErrorHandler(NULL);
11251,7 → 11175,7
PageItem *currItem = itemSelection->itemAt(i);
if (currItem && currItem->itemType() == PageItem::ImageFrame)
{
currItem->IRender = intentIndex;
currItem->IRender = (eRenderIntent) intentIndex;
LoadPict(currItem->Pfile, currItem->ItemNr, true);
currItem->update();
}
/trunk/Scribus/scribus/scimgdataloader_pict.cpp
16,7 → 16,6
#include <QStack>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
 
#include "scimgdataloader_pict.h"
/trunk/Scribus/scribus/prefsmanager.cpp
378,8 → 378,8
appPrefs.colorPrefs.DCMSset.SoftProofFullOn = false;
appPrefs.colorPrefs.DCMSset.GamutCheck = false;
appPrefs.colorPrefs.DCMSset.BlackPoint = true;
appPrefs.colorPrefs.DCMSset.DefaultIntentColors = 1;
appPrefs.colorPrefs.DCMSset.DefaultIntentImages = 0;
appPrefs.colorPrefs.DCMSset.DefaultIntentColors = Intent_Relative_Colorimetric;
appPrefs.colorPrefs.DCMSset.DefaultIntentImages = Intent_Perceptual;
appPrefs.fontPrefs.GFontSub.clear();
appPrefs.displayPrefs.scratch.Left = 100;
appPrefs.displayPrefs.scratch.Right = 100;
2099,8 → 2099,8
appPrefs.colorPrefs.DCMSset.DefaultImageCMYKProfile = dc.attribute("DPInCMYK","");
appPrefs.colorPrefs.DCMSset.DefaultSolidColorRGBProfile = dc.attribute("DPIn2","");
appPrefs.colorPrefs.DCMSset.DefaultSolidColorCMYKProfile = dc.attribute("DPIn3","");
appPrefs.colorPrefs.DCMSset.DefaultIntentColors = dc.attribute("DISc", "1").toInt();
appPrefs.colorPrefs.DCMSset.DefaultIntentImages = dc.attribute("DIIm", "0").toInt();
appPrefs.colorPrefs.DCMSset.DefaultIntentColors = (eRenderIntent) dc.attribute("DISc", "1").toInt();
appPrefs.colorPrefs.DCMSset.DefaultIntentImages = (eRenderIntent) dc.attribute("DIIm", "0").toInt();
}
if (!importingFrom12 && dc.tagName()=="SHORTCUT")
{
/trunk/Scribus/scribus/pageitem_polyline.cpp
21,6 → 21,9
* *
***************************************************************************/
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include <cassert>
 
/trunk/Scribus/scribus/sccolorengine.cpp
24,7 → 24,7
#include "sccolorengine.h"
#include "scribuscore.h"
#include "scribusdoc.h"
#include CMS_INC
#include "colormngt/sccolormngtengine.h"
 
QColor ScColorEngine::getRGBColor(const ScColor& color, const ScribusDoc* doc)
{
57,7 → 57,7
void ScColorEngine::getRGBValues(const ScColor& color, const ScribusDoc* doc, RGBColor& rgb)
{
colorModel model = color.getColorModel();
cmsHTRANSFORM transRGB = doc ? doc->stdTransRGB : ScCore->defaultCMYKToRGBTrans;
ScColorTransform transRGB = doc ? doc->stdTransRGB : ScCore->defaultCMYKToRGBTrans;
if (ScCore->haveCMS() && transRGB)
{
if (model == colorModelRGB)
68,13 → 68,13
}
else
{
WORD inC[4];
WORD outC[4];
unsigned short inC[4];
unsigned short outC[4];
inC[0] = color.CR * 257;
inC[1] = color.MG * 257;
inC[2] = color.YB * 257;
inC[3] = color.K * 257;
cmsDoTransform(transRGB, inC, outC, 1);
transRGB.apply(inC, outC, 1);
rgb.r = outC[0] / 257;
rgb.g = outC[1] / 257;
rgb.b = outC[2] / 257;
96,10 → 96,10
 
void ScColorEngine::getCMYKValues(const ScColor& color, const ScribusDoc* doc, CMYKColor& cmyk)
{
WORD inC[4];
WORD outC[4];
unsigned short inC[4];
unsigned short outC[4];
colorModel model = color.getColorModel();
cmsHTRANSFORM transCMYK = doc ? doc->stdTransCMYK : ScCore->defaultRGBToCMYKTrans;
ScColorTransform transCMYK = doc ? doc->stdTransCMYK : ScCore->defaultRGBToCMYKTrans;
if (ScCore->haveCMS() && transCMYK)
{
if (model == colorModelRGB)
115,7 → 115,7
inC[0] = color.CR * 257;
inC[1] = color.MG * 257;
inC[2] = color.YB * 257;
cmsDoTransform(transCMYK, inC, outC, 1);
transCMYK.apply(inC, outC, 1);
cmyk.c = outC[0] / 257;
cmyk.m = outC[1] / 257;
cmyk.y = outC[2] / 257;
334,12 → 334,12
 
QColor ScColorEngine::getColorProof(RGBColor& rgb, const ScribusDoc* doc, bool spot, bool gamutCkeck)
{
WORD inC[4];
WORD outC[4];
unsigned short inC[4];
unsigned short outC[4];
int r = rgb.r, g = rgb.g, b = rgb.b;
cmsHTRANSFORM transRGBMon = doc ? doc->stdTransRGBMon : ScCore->defaultRGBToScreenSolidTrans;
cmsHTRANSFORM transProof = doc ? doc->stdProof : ScCore->defaultRGBToScreenSolidTrans;
cmsHTRANSFORM transProofGC = doc ? doc->stdProofGC : ScCore->defaultRGBToScreenSolidTrans;
ScColorTransform transRGBMon = doc ? doc->stdTransRGBMon : ScCore->defaultRGBToScreenSolidTrans;
ScColorTransform transProof = doc ? doc->stdProof : ScCore->defaultRGBToScreenSolidTrans;
ScColorTransform transProofGC = doc ? doc->stdProofGC : ScCore->defaultRGBToScreenSolidTrans;
bool cmsUse = doc ? doc->HasCMS : false;
bool cmsTrans = (transRGBMon && transProof && transProofGC);
if (ScCore->haveCMS() && cmsTrans)
349,8 → 349,8
inC[2] = rgb.b * 257;
if (cmsUse && !spot && doc->SoftProofing)
{
cmsHTRANSFORM xform = gamutCkeck ? transProofGC : transProof;
cmsDoTransform(xform, inC, outC, 1);
ScColorTransform xform = gamutCkeck ? transProofGC : transProof;
xform.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
357,7 → 357,7
}
else
{
cmsDoTransform(transRGBMon, inC, outC, 1);
transRGBMon.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
369,11 → 369,11
QColor ScColorEngine::getColorProof(CMYKColor& cmyk, const ScribusDoc* doc, bool spot, bool gamutCkeck)
{
int r = 0, g = 0, b = 0;
WORD inC[4];
WORD outC[4];
cmsHTRANSFORM transCMYKMon = doc ? doc->stdTransCMYKMon : ScCore->defaultCMYKToRGBTrans;
cmsHTRANSFORM transProofCMYK = doc ? doc->stdProofCMYK : ScCore->defaultCMYKToRGBTrans;
cmsHTRANSFORM transProofCMYKGC = doc ? doc->stdProofCMYKGC : ScCore->defaultCMYKToRGBTrans;
unsigned short inC[4];
unsigned short outC[4];
ScColorTransform transCMYKMon = doc ? doc->stdTransCMYKMon : ScCore->defaultCMYKToRGBTrans;
ScColorTransform transProofCMYK = doc ? doc->stdProofCMYK : ScCore->defaultCMYKToRGBTrans;
ScColorTransform transProofCMYKGC = doc ? doc->stdProofCMYKGC : ScCore->defaultCMYKToRGBTrans;
bool cmsUse = doc ? doc->HasCMS : false;
bool cmsTrans = (transCMYKMon && transProofCMYK && transProofCMYKGC);
if (ScCore->haveCMS() && cmsTrans)
384,8 → 384,8
inC[3] = cmyk.k * 257;
if (cmsUse && !spot && doc->SoftProofing)
{
cmsHTRANSFORM xform = gamutCkeck ? transProofCMYKGC : transProofCMYK;
cmsDoTransform(xform, inC, outC, 1);
ScColorTransform xform = gamutCkeck ? transProofCMYKGC : transProofCMYK;
xform.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
392,7 → 392,7
}
else
{
cmsDoTransform(transCMYKMon, inC, outC, 1);
transCMYKMon.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
409,18 → 409,18
 
QColor ScColorEngine::getDisplayColor(RGBColor& rgb, const ScribusDoc* doc, bool spot)
{
WORD inC[4];
WORD outC[4];
unsigned short inC[4];
unsigned short outC[4];
int r = rgb.r;
int g = rgb.g;
int b = rgb.b;
cmsHTRANSFORM transRGBMon = doc ? doc->stdTransRGBMon : ScCore->defaultRGBToScreenSolidTrans;
ScColorTransform transRGBMon = doc ? doc->stdTransRGBMon : ScCore->defaultRGBToScreenSolidTrans;
if (ScCore->haveCMS() && transRGBMon)
{
inC[0] = r * 257;
inC[1] = g * 257;
inC[2] = b * 257;
cmsDoTransform(transRGBMon, inC, outC, 1);
transRGBMon.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
431,9 → 431,9
QColor ScColorEngine::getDisplayColor(CMYKColor& cmyk, const ScribusDoc* doc, bool spot)
{
int r = 0, g = 0, b = 0;
WORD inC[4];
WORD outC[4];
cmsHTRANSFORM transCMYKMon = doc ? doc->stdTransCMYKMon : ScCore->defaultCMYKToRGBTrans;
unsigned short inC[4];
unsigned short outC[4];
ScColorTransform transCMYKMon = doc ? doc->stdTransCMYKMon : ScCore->defaultCMYKToRGBTrans;
if (ScCore->haveCMS() && transCMYKMon)
{
inC[0] = cmyk.c * 257;
440,7 → 440,7
inC[1] = cmyk.m * 257;
inC[2] = cmyk.y * 257;
inC[3] = cmyk.k * 257;
cmsDoTransform(transCMYKMon, inC, outC, 1);
transCMYKMon.apply(inC, outC, 1);
r = outC[0] / 257;
g = outC[1] / 257;
b = outC[2] / 257;
459,13 → 459,13
bool outOfGamutFlag = false;
if (color.isSpotColor())
return false;
WORD inC[4];
WORD outC[4];
unsigned short inC[4];
unsigned short outC[4];
bool cmsUse = doc ? doc->HasCMS : false;
if (ScCore->haveCMS() && cmsUse)
{
bool alert = true;
cmsHTRANSFORM xformProof;
ScColorTransform xformProof;
if (color.getColorModel() == colorModelRGB)
{
inC[0] = color.CR * 257;
493,7 → 493,7
}
if (alert)
{
cmsDoTransform(xformProof, inC, outC, 1);
xformProof.apply(inC, outC, 1);
if ((outC[0]/257 == 0) && (outC[1]/257 == 255) && (outC[2]/257 == 0))
outOfGamutFlag = true;
}
/trunk/Scribus/scribus/scribusXml.cpp
30,8 → 30,8
#include <QDebug>
 
#include <cstdlib>
#include <cmath>
#include "ui/missing.h"
 
#include "commonstrings.h"
#include "page.h"
#include "pageitem.h"
#include "pageitem_latexframe.h"
38,14 → 38,14
#ifdef HAVE_OSG
#include "pageitem_osgframe.h"
#endif
#include "selection.h"
#include "units.h"
#include "prefsmanager.h"
#include "scclocale.h"
#include "scribusview.h"
#include "scribusdoc.h"
#include "scclocale.h"
#include "commonstrings.h"
#include "selection.h"
#include "text/nlsconfig.h"
#include "units.h"
#include "ui/missing.h"
 
#include <iostream>
 
290,7 → 290,7
OB->Pfile3 = attrAsString(attrs, "PFILE3","");
OB->IProfile = attrAsString(attrs, "PRFILE","");
OB->EmProfile = attrAsString(attrs, "EPROF","");
OB->IRender = attrAsInt (attrs, "IRENDER", 1);
OB->IRender = (eRenderIntent) attrAsInt (attrs, "IRENDER", (int) Intent_Relative_Colorimetric);
OB->UseEmbedded= attrAsInt (attrs, "EMBEDDED", 1);
OB->Locked = attrAsBool(attrs, "LOCK", false);
OB->LockRes = attrAsBool(attrs, "LOCKR", false);
/trunk/Scribus/scribus/scimgdataloader_tiff.cpp
7,12 → 7,13
#include <QFile>
#include <QFileInfo>
#include <QObject>
//Added by qt3to4:
#include <QList>
 
#include "scconfig.h"
#include "colormngt/sccolormngtengine.h"
#include "scimgdataloader_tiff.h"
#include "scribuscore.h"
#include "util_color.h"
#include CMS_INC
 
static void TagExtender(TIFF *tiff)
{
37,6 → 38,7
 
void ScImgDataLoader_TIFF::loadEmbeddedProfile(const QString& fn, int /*page*/)
{
ScColorMngtEngine engine(ScCore->defaultEngine);
m_embeddedProfile.resize(0);
m_profileComponents = 0;
if ( !QFile::exists(fn) )
45,22 → 47,22
TIFF* tif = TIFFOpen(fn.toLocal8Bit(), "r");
if(tif)
{
DWORD EmbedLen = 0;
LPBYTE EmbedBuffer;
uint32 EmbedLen = 0;
void* EmbedBuffer;
if (TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer))
{
cmsHPROFILE tiffProf = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
QByteArray profArray((const char*) EmbedBuffer, EmbedLen);
ScColorProfile tiffProf = engine.openProfileFromMem(profArray);
if (tiffProf)
{
if (static_cast<int>(cmsGetColorSpace(tiffProf)) == icSigRgbData)
if (static_cast<int>(tiffProf.colorSpace()) == icSigRgbData)
m_profileComponents = 3;
if (static_cast<int>(cmsGetColorSpace(tiffProf)) == icSigCmykData)
if (static_cast<int>(tiffProf.colorSpace()) == icSigCmykData)
m_profileComponents = 4;
if (static_cast<int>(cmsGetColorSpace(tiffProf)) == icSigGrayData)
if (static_cast<int>(tiffProf.colorSpace()) == icSigGrayData)
m_profileComponents = 1;
m_embeddedProfile = QByteArray((const char*) EmbedBuffer, EmbedLen);
m_embeddedProfile = profArray;
}
cmsCloseProfile(tiffProf);
}
TIFFClose(tif);
}
590,6 → 592,7
 
bool ScImgDataLoader_TIFF::loadPicture(const QString& fn, int page, int res, bool thumbnail)
{
ScColorMngtEngine engine(ScCore->defaultEngine);
bool bilevel = false;
bool failedPS = false;
bool foundPS = false;
661,17 → 664,15
m_imageInfoRecord.exifInfo.artist = QString(artist);
m_imageInfoRecord.exifInfo.thumbnail = QImage();
m_imageInfoRecord.exifDataValid = true;
DWORD EmbedLen = 0;
LPBYTE EmbedBuffer;
uint32 EmbedLen = 0;
void* EmbedBuffer;
if (TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer))
{
const char *Descriptor;
cmsHPROFILE tiffProf = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
Descriptor = cmsTakeProductDesc(tiffProf);
m_embeddedProfile = QByteArray((const char*) EmbedBuffer, EmbedLen);
m_imageInfoRecord.profileName = QString(Descriptor);
QByteArray profArray((const char*) EmbedBuffer, EmbedLen);
ScColorProfile tiffProf = engine.openProfileFromMem(profArray);
m_embeddedProfile = profArray;
m_imageInfoRecord.profileName = tiffProf.productDescription();
m_imageInfoRecord.isEmbedded = true;
cmsCloseProfile(tiffProf);
}
else
{
/trunk/Scribus/scribus/scdocoutput_ps2.cpp
34,7 → 34,6
{
if (m_file.isOpen())
m_file.close();
closeTransforms();
}
 
void ScDocOutput_Ps2::begin(void)
73,25 → 72,6
m_file.close();
}
 
void ScDocOutput_Ps2::closeTransforms(void)
{
if (m_options.rgbToOutputColorTransform)
cmsDeleteTransform(m_options.rgbToOutputColorTransform);
if (m_options.rgbToOutputImageTransform)
cmsDeleteTransform(m_options.rgbToOutputImageTransform);
if (m_options.cmykToOutputColorTransform)
cmsDeleteTransform(m_options.cmykToOutputColorTransform);
if (m_options.cmykToOutputImageTransform)
cmsDeleteTransform(m_options.cmykToOutputImageTransform);
if (m_options.hProfile)
cmsCloseProfile(m_options.hProfile);
m_options.hProfile = NULL;
m_options.rgbToOutputColorTransform = NULL;
m_options.rgbToOutputImageTransform = NULL;
m_options.cmykToOutputColorTransform = NULL;
m_options.cmykToOutputImageTransform = NULL;
}
 
bool ScDocOutput_Ps2::initializeCmsTransforms(void)
{
bool success = false;
101,8 → 81,6
if (setjmp(cmsJumpBuffer))
{
cmsSetErrorHandler(NULL);
cmsErrorAction(LCMS_ERROR_IGNORE);
closeTransforms();
cmsErrorAction(LCMS_ERROR_ABORT);
m_lastError = QObject::tr("An error occurred while initializing icc transforms");
qWarning( "%s", m_lastError.toLocal8Bit().data() );
111,23 → 89,22
cmsSetErrorHandler(&cmsErrorHandler);
 
int dcmsflags = 0;
dcmsflags |= cmsFLAGS_LOWRESPRECALC;
if (m_doc->BlackPoint)
dcmsflags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
dcmsflags |= Ctf_BlackPointCompensation;
 
int outputDataTypeColors = 0;
int outputDataTypeImages = 0;
QByteArray outputProfilePath(m_options.outputProfile.toLocal8Bit());
m_options.hProfile = cmsOpenProfileFromFile(outputProfilePath.data(), "r");
if (static_cast<int>(cmsGetColorSpace(m_options.hProfile)) == icSigRgbData)
eColorFormat outputDataTypeColors = Format_Undefined;
eColorFormat outputDataTypeImages = Format_Undefined;
ScColorMngtEngine engine(m_doc->colorEngine);
m_options.hProfile = engine.openProfileFromFile(m_options.outputProfile);
if (static_cast<int>(m_options.hProfile.colorSpace()) == icSigRgbData)
{
outputDataTypeColors = TYPE_RGB_16;
outputDataTypeImages = TYPE_ARGB_8;
outputDataTypeColors = Format_RGB_16;
outputDataTypeImages = Format_ARGB_8;
}
else if (static_cast<int>(cmsGetColorSpace(m_options.hProfile)) == icSigCmykData)
else if (static_cast<int>(m_options.hProfile.colorSpace()) == icSigCmykData)
{
outputDataTypeColors = TYPE_CMYK_16;
outputDataTypeImages = TYPE_CMYK_8;
outputDataTypeColors = Format_CMYK_16;
outputDataTypeImages = Format_CMYK_8;
}
else
{
134,13 → 111,13
m_lastError = QObject::tr("Output profile is not supported");
return false;
}
m_options.rgbToOutputColorTransform = cmsCreateTransform(m_doc->DocInputRGBProf, TYPE_RGB_16, m_options.hProfile,
m_options.rgbToOutputColorTransform = engine.createTransform(m_doc->DocInputRGBProf, Format_RGB_16, m_options.hProfile,
outputDataTypeColors, m_doc->IntentColors, dcmsflags);
m_options.rgbToOutputImageTransform = cmsCreateTransform(m_doc->DocInputRGBProf, TYPE_ARGB_8, m_options.hProfile,
m_options.rgbToOutputImageTransform = engine.createTransform(m_doc->DocInputRGBProf, Format_ARGB_8, m_options.hProfile,
outputDataTypeImages, m_doc->IntentImages, dcmsflags);
m_options.cmykToOutputColorTransform = cmsCreateTransform(m_doc->DocInputRGBProf, TYPE_CMYK_16, m_options.hProfile,
m_options.cmykToOutputColorTransform = engine.createTransform(m_doc->DocInputRGBProf, Format_CMYK_16, m_options.hProfile,
outputDataTypeColors, m_doc->IntentColors, dcmsflags);
m_options.cmykToOutputImageTransform = cmsCreateTransform(m_doc->DocInputRGBProf, TYPE_CMYK_8 , m_options.hProfile,
m_options.cmykToOutputImageTransform = engine.createTransform(m_doc->DocInputRGBProf, Format_CMYK_8 , m_options.hProfile,
outputDataTypeImages, m_doc->IntentImages, dcmsflags);
cmsSetErrorHandler(NULL);
success = true;
/trunk/Scribus/scribus/canvas.cpp
13,6 → 13,10
* *
***************************************************************************/
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
 
// #include <QDebug>
#include <QToolTip>
/trunk/Scribus/scribus/pageitem_pathtext.cpp
27,7 → 27,6
#include <QList>
#include <QPainterPath>
 
#include <cmath>
#include <cassert>
 
#include "page.h"
/trunk/Scribus/scribus/cmsettings.cpp
27,7 → 27,7
#include "cmsettings.h"
#include "scribusdoc.h"
 
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, int intent) :
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, eRenderIntent intent) :
m_Doc(doc),
m_ProfileName(profileName),
m_Intent(intent)
87,18 → 87,18
return QString();
}
 
int CMSettings::colorRenderingIntent() const
eRenderIntent CMSettings::colorRenderingIntent() const
{
if (m_Doc)
return m_Doc->IntentColors;
return 1; // Use relative colorimetric by default
return Intent_Relative_Colorimetric; // Use relative colorimetric by default
}
 
int CMSettings::imageRenderingIntent() const
eRenderIntent CMSettings::imageRenderingIntent() const
{
if (m_Doc)
return m_Doc->IntentImages;
return 0; // Use perceptual by default
return Intent_Perceptual; // Use perceptual by default
}
 
bool CMSettings::useBlackPoint() const
122,93 → 122,93
return false;
}
 
cmsHPROFILE CMSettings::monitorProfile() const
ScColorProfile CMSettings::monitorProfile() const
{
if (m_Doc)
return m_Doc->DocOutputProf;
return NULL;
return ScColorProfile();
}
 
cmsHPROFILE CMSettings::printerProfile() const
ScColorProfile CMSettings::printerProfile() const
{
if (m_Doc)
return m_Doc->DocPrinterProf;
return NULL;
return ScColorProfile();
}
 
cmsHTRANSFORM CMSettings::rgbColorDisplayTransform() const // stdTransRGBMonG
ScColorTransform CMSettings::rgbColorDisplayTransform() const // stdTransRGBMonG
{
if (m_Doc)
return m_Doc->stdTransRGBMon;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::rgbColorProofingTransform() const // stdProofG
ScColorTransform CMSettings::rgbColorProofingTransform() const // stdProofG
{
if (m_Doc)
return m_Doc->stdProof;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::rgbImageDisplayTransform() const // stdTransImgG
ScColorTransform CMSettings::rgbImageDisplayTransform() const // stdTransImgG
{
if (m_Doc)
return m_Doc->stdTransImg;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::rgbImageProofingTransform() const // stdProofImgG
ScColorTransform CMSettings::rgbImageProofingTransform() const // stdProofImgG
{
if (m_Doc)
return m_Doc->stdProofImg;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
ScColorTransform CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
{
if (m_Doc)
return m_Doc->stdTransCMYK;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::rgbGamutCheckTransform() const // stdProofGCG
ScColorTransform CMSettings::rgbGamutCheckTransform() const // stdProofGCG
{
if (m_Doc)
return m_Doc->stdProofGC;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
ScColorTransform CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
{
if (m_Doc)
return m_Doc->stdTransCMYKMon;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
ScColorTransform CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
{
if (m_Doc)
return m_Doc->stdProofCMYK;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::cmykImageProofingTransform() const // stdProofImgCMYK
ScColorTransform CMSettings::cmykImageProofingTransform() const // stdProofImgCMYK
{
if (m_Doc)
return m_Doc->stdProofImgCMYK;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::cmykToRgbColorTransform() const // stdTransRGBG
ScColorTransform CMSettings::cmykToRgbColorTransform() const // stdTransRGBG
{
if (m_Doc)
return m_Doc->stdTransRGB;
return NULL;
return ScColorTransform();
}
 
cmsHTRANSFORM CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
ScColorTransform CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
{
if (m_Doc)
return m_Doc->stdProofCMYKGC;
return NULL;
return ScColorTransform();
}
/trunk/Scribus/scribus/scimgdataloader_psd.cpp
5,16 → 5,16
for which a new license (GPL+exception) is in place.
*/
#include "scconfig.h"
#include "colormngt/sccolormngtengine.h"
#include "scimgdataloader_psd.h"
#include "util_color.h"
#include "sccolorengine.h"
#include "scribuscore.h"
 
#include <QFile>
#include <QFileInfo>
#include <QList>
 
#include CMS_INC
 
static QDataStream & operator>> ( QDataStream & s, PSDHeader & header )
{
s >> header.signature;
46,7 → 46,8
{
m_embeddedProfile.resize(0);
m_profileComponents = 0;
cmsHPROFILE prof = 0;
ScColorProfile prof;
ScColorMngtEngine engine(ScCore->defaultEngine);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return;
72,17 → 73,16
return;
if (m_embeddedProfile.size() > 0)
{
prof = cmsOpenProfileFromMem(m_embeddedProfile.data(), m_embeddedProfile.size());
prof = engine.openProfileFromMem(m_embeddedProfile.data());
if (prof)
{
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigRgbData)
if (static_cast<int>(prof.colorSpace()) == icSigRgbData)
m_profileComponents = 3;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigCmykData)
if (static_cast<int>(prof.colorSpace()) == icSigCmykData)
m_profileComponents = 4;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigGrayData)
if (static_cast<int>(prof.colorSpace()) == icSigGrayData)
m_profileComponents = 1;
}
cmsCloseProfile(prof);
}
f.close();
}
133,6 → 133,7
 
bool ScImgDataLoader_PSD::loadPicture(const QString& fn, int /*page*/, int res, bool thumbnail)
{
ScColorMngtEngine engine(ScCore->defaultEngine);
bool isCMYK = false;
float xres = 72.0, yres = 72.0;
if (!QFile::exists(fn))
167,10 → 168,8
return false;
if (m_embeddedProfile.size() > 0)
{
cmsHPROFILE prof = cmsOpenProfileFromMem(m_embeddedProfile.data(), m_embeddedProfile.size());
const char *Descriptor;
Descriptor = cmsTakeProductDesc(prof);
m_imageInfoRecord.profileName = QString(Descriptor);
ScColorProfile prof = engine.openProfileFromMem(m_embeddedProfile);
m_imageInfoRecord.profileName = prof.productDescription();
m_imageInfoRecord.isEmbedded = true;
}
if (header.color_mode == CM_CMYK)
840,6 → 839,7
RawImage r2_image;
RawImage mask;
bool createOk = false;
ScColorMngtEngine engine(ScCore->defaultEngine);
if (header.color_mode == CM_CMYK)
{
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, qMax(channel_num, (uint)5));
926,18 → 926,14
}
if (header.color_mode == CM_LABCOLOR)
{
cmsHPROFILE hsRGB = cmsCreate_sRGBProfile();
cmsHPROFILE hLab = cmsCreateLabProfile(NULL);
DWORD inputProfFormat = (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1));
cmsHTRANSFORM xform = cmsCreateTransform(hLab, inputProfFormat, hsRGB, TYPE_RGBA_8, INTENT_PERCEPTUAL, 0);
ScColorProfile hsRGB = engine.createProfile_sRGB();
ScColorProfile hLab = engine.createProfile_Lab();
ScColorTransform xform = engine.createTransform(hLab, Format_LabA_8, hsRGB, Format_RGBA_8, Intent_Perceptual, 0);
for (int i = 0; i < r2_image.height(); i++)
{
LPBYTE ptr = r2_image.scanLine(i);
cmsDoTransform(xform, ptr, ptr, r2_image.width());
uchar* ptr = r2_image.scanLine(i);
xform.apply(ptr, ptr, r2_image.width());
}
cmsDeleteTransform (xform);
cmsCloseProfile(hsRGB);
cmsCloseProfile(hLab);
}
s.device()->seek( base2 );
QImage tmpImg2;
1337,6 → 1333,7
 
bool ScImgDataLoader_PSD::loadLayer( QDataStream & s, const PSDHeader & header )
{
ScColorMngtEngine engine(ScCore->defaultEngine);
// Find out if the data is compressed.
// Known values:
// 0: no compression
1517,18 → 1514,14
}
if (header.color_mode == CM_LABCOLOR)
{
cmsHPROFILE hsRGB = cmsCreate_sRGBProfile();
cmsHPROFILE hLab = cmsCreateLabProfile(NULL);
DWORD inputProfFormat = (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1));
cmsHTRANSFORM xform = cmsCreateTransform(hLab, inputProfFormat, hsRGB, TYPE_RGBA_8, INTENT_PERCEPTUAL, 0);
ScColorProfile hsRGB = engine.createProfile_sRGB();
ScColorProfile hLab = engine.createProfile_Lab();
ScColorTransform xform = engine.createTransform(hLab, Format_LabA_8, hsRGB, Format_RGBA_8, Intent_Perceptual, 0);
for (int i = 0; i < r_image.height(); i++)
{
LPBYTE ptr = r_image.scanLine(i);
cmsDoTransform(xform, ptr, ptr, r_image.width());
uchar* ptr = r_image.scanLine(i);
xform.apply(ptr, ptr, r_image.width());
}
cmsDeleteTransform (xform);
cmsCloseProfile(hsRGB);
cmsCloseProfile(hLab);
}
return true;
}
/trunk/Scribus/scribus/pageitem.h
38,15 → 38,16
 
#include "scribusapi.h"
#include "annotation.h"
#include "colormngt/sccolormngtstructs.h"
#include "desaxe/saxio.h"
#include "observable.h"
#include "pagestructs.h"
#include "scimage.h"
#include "sctextstruct.h"
#include "text/nlsconfig.h"
#include "text/storytext.h"
#include "undoobject.h"
#include "vgradient.h"
#include "text/nlsconfig.h"
#include "text/storytext.h"
#include "desaxe/saxio.h"
#ifdef HAVE_CONFIG_H
#include "scconfig.h"
#endif
429,10 → 430,10
QString IProfile;
bool UseEmbedded;
QString EmProfile;
int IRender;
eRenderIntent IRender;
// some accessor methods:
int cmsRenderingIntent() const { return IRender; }
void setCmsRenderingIntent(int val) { IRender = val; }
int cmsRenderingIntent() const { return IRender; }
void setCmsRenderingIntent(eRenderIntent val) { IRender = val; }
QString cmsProfile() const { return IProfile; }
void setCmsProfile(QString val) { IProfile = val; }
/trunk/Scribus/scribus/scribusstructs.h
25,6 → 25,7
#include <vector>
 
#include "scribusapi.h"
#include "colormngt/sccolormngtstructs.h"
#include "scimagestructs.h"
#include "sctextstruct.h"
#include "scfonts.h"
128,7 → 129,7
QString Pfile3;
QString IProfile;
QString EmProfile;
int IRender;
eRenderIntent IRender;
bool UseEmbedded;
QString itemText;
QPolygon Clip;
188,7 → 189,7
ScImageEffectList effects;
QString inputProfile;
bool useEmbedded;
int renderingIntent;
eRenderIntent renderingIntent;
};
 
/** \brief Pagemargins and bleeds*/
247,8 → 248,8
int ComponentsInput2;
int ComponentsInput3;
int ComponentsPrinter;
int DefaultIntentImages;
int DefaultIntentColors;
eRenderIntent DefaultIntentImages;
eRenderIntent DefaultIntentColors;
bool CMSinUse;
bool SoftProofOn;
bool SoftProofFullOn;
/trunk/Scribus/scribus/pageitem.cpp
32,7 → 32,6
#include <QRegExp>
#include <QMessageBox>
#include <QPolygon>
#include <cmath>
#include <cassert>
#include <QDebug>
 
454,7 → 453,7
Sizing = false;
toPixmap = false;
UseEmbedded = true;
IRender = 1;
IRender = Intent_Relative_Colorimetric;
EmProfile = "";
Groups.clear();
LayerID = m_Doc->activeLayer();
/trunk/Scribus/scribus/scribusdoc.h
36,24 → 36,22
#include <QStringList>
#include <QTimer>
 
 
#include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
#include "scribusapi.h"
#include "colormngt/sccolormngtengine.h"
#include "documentinformation.h"
#include "observable.h"
#include "prefsstructs.h"
#include "documentinformation.h"
#include "undoobject.h"
#include "page.h"
#include "pageitem.h"
#include "pagestructs.h"
#include "usertaskstructs.h"
#include "prefsstructs.h"
#include "scguardedptr.h"
#include "sclayer.h"
#include "styles/styleset.h"
#include "scguardedptr.h"
#include "undoobject.h"
#include "updatemanager.h"
#include "sclayer.h"
#include "usertaskstructs.h"
 
#include CMS_INC
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
1029,28 → 1027,30
bool marginColored;
int GroupCounter;
CMSData CMSSettings;
cmsHPROFILE DocInputImageRGBProf;
cmsHPROFILE DocInputImageCMYKProf;
cmsHPROFILE DocInputRGBProf;
cmsHPROFILE DocInputCMYKProf;
cmsHPROFILE DocOutputProf;
cmsHPROFILE DocPrinterProf;
cmsHTRANSFORM stdTransRGBMon;
cmsHTRANSFORM stdTransCMYKMon;
cmsHTRANSFORM stdProof;
cmsHTRANSFORM stdTransImg;
cmsHTRANSFORM stdProofImg;
cmsHTRANSFORM stdProofImgCMYK;
cmsHTRANSFORM stdTransCMYK;
cmsHTRANSFORM stdProofCMYK;
cmsHTRANSFORM stdTransRGB;
cmsHTRANSFORM stdProofGC;
cmsHTRANSFORM stdProofCMYKGC;
 
ScColorMngtEngine colorEngine;
ScColorProfile DocInputImageRGBProf;
ScColorProfile DocInputImageCMYKProf;
ScColorProfile DocInputRGBProf;
ScColorProfile DocInputCMYKProf;
ScColorProfile DocOutputProf;
ScColorProfile DocPrinterProf;
ScColorTransform stdTransRGBMon;
ScColorTransform stdTransCMYKMon;
ScColorTransform stdProof;
ScColorTransform stdTransImg;
ScColorTransform stdProofImg;
ScColorTransform stdProofImgCMYK;
ScColorTransform stdTransCMYK;
ScColorTransform stdProofCMYK;
ScColorTransform stdTransRGB;
ScColorTransform stdProofGC;
ScColorTransform stdProofCMYKGC;
bool BlackPoint;
bool SoftProofing;
bool Gamut;
int IntentColors;
int IntentImages;
eRenderIntent IntentColors;
eRenderIntent IntentImages;
bool HasCMS;
QMap<QString,QString> JavaScripts;
int TotalItems;
/trunk/Scribus/scribus/scribusview.cpp
51,7 → 51,6
#include <QWheelEvent>
#include <QWidgetAction>
 
#include <cmath>
#include <cstdio>
#include <cstdlib>
 
127,7 → 126,6
#include "fileloader.h"
#include "plugins/formatidlist.h"
#include <tiffio.h>
#include CMS_INC
 
 
using namespace std;
/trunk/Scribus/scribus/scimage.cpp
33,7 → 33,7
#include <cstdlib>
#include <memory>
#include <setjmp.h>
#include CMS_INC
//#include CMS_INC
#include "util_cms.h"
#include "commonstrings.h"
#include "exif.h"
1988,8 → 1988,6
bool bilevel = false;
// short resolutionunit = 0;
RequestType reqType = requestType;
cmsHTRANSFORM xform = 0;
cmsHPROFILE inputProf = 0;
int cmsFlags = 0;
int cmsProofFlags = 0;
auto_ptr<ScImgDataLoader> pDataLoader;
2003,6 → 2001,8
bool hasEmbeddedProfile = false;
QList<QByteArray> fmtList = QImageReader::supportedImageFormats();
QStringList fmtImg;
ScColorTransform xform;
ScColorProfile inputProf;
for (int i = 0; i < fmtList.count(); i++)
{
fmtImg.append( QString(fmtList[i].toLower()) );
2095,12 → 2095,12
{
if ((embeddedProfile.size() > 0 ) && (useEmbedded))
{
inputProf = cmsOpenProfileFromMem(embeddedProfile.data(), embeddedProfile.size());
inputProf = cmSettings.doc()->colorEngine.openProfileFromMem(embeddedProfile);
inputProfisEmbedded = true;
}
else
{
QByteArray profilePath;
QString profilePath;
//CB If this is null, customfiledialog/picsearch/ScPreview might be sending it
Q_ASSERT(cmSettings.doc()!=0);
if (isCMYK)
2109,8 → 2109,8
{
imgInfo.profileName = cmSettings.profileName();
inputProfisEmbedded = true;
profilePath = ScCore->InputProfilesCMYK[imgInfo.profileName].toLocal8Bit();
inputProf = cmsOpenProfileFromFile(profilePath.data(), "r");
profilePath = ScCore->InputProfilesCMYK[imgInfo.profileName];
inputProf = cmSettings.doc()->colorEngine.openProfileFromFile(profilePath);
}
else
{
2124,9 → 2124,9
if (ScCore->InputProfiles.contains(cmSettings.profileName()) && (cmSettings.profileName() != cmSettings.doc()->CMSSettings.DefaultImageRGBProfile))
{
imgInfo.profileName = cmSettings.profileName();
profilePath = ScCore->InputProfiles[imgInfo.profileName].toLocal8Bit();
profilePath = ScCore->InputProfiles[imgInfo.profileName];
inputProfisEmbedded = true;
inputProf = cmsOpenProfileFromFile(profilePath.data(), "r");
inputProf = cmSettings.doc()->colorEngine.openProfileFromFile(profilePath);
}
else
{
2139,7 → 2139,7
}
else if ((useProf && embeddedProfile.size() > 0) && (useEmbedded))
{
inputProf = cmsOpenProfileFromMem(embeddedProfile.data(), embeddedProfile.size());
inputProf = cmSettings.doc()->colorEngine.openProfileFromMem(embeddedProfile);
inputProfisEmbedded = true;
}
else if (useProf && isCMYK)
2148,48 → 2148,48
inputProf = NULL; // Workaround to map directly gray to K channel
else if (useProf)
inputProf = ScCore->defaultRGBProfile;
cmsHPROFILE screenProf = cmSettings.monitorProfile() ? cmSettings.monitorProfile() : ScCore->defaultRGBProfile;
cmsHPROFILE printerProf = cmSettings.printerProfile() ? cmSettings.printerProfile() : ScCore->defaultCMYKProfile;
ScColorProfile screenProf = cmSettings.monitorProfile() ? cmSettings.monitorProfile() : ScCore->defaultRGBProfile;
ScColorProfile printerProf = cmSettings.printerProfile() ? cmSettings.printerProfile() : ScCore->defaultCMYKProfile;
if (useProf && inputProf && screenProf && printerProf)
{
ScColorMngtEngine engine(cmSettings.doc() ? cmSettings.doc()->colorEngine : ScCore->defaultEngine);
bool isPsdTiff = (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext));
DWORD SC_TYPE_YMCK_8 = (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1));
DWORD inputProfFormat = TYPE_BGRA_8;
DWORD outputProfFormat = SC_TYPE_YMCK_8;
int inputProfColorSpace = static_cast<int>(cmsGetColorSpace(inputProf));
eColorFormat inputProfFormat = Format_BGRA_8;
eColorFormat outputProfFormat = Format_YMCK_8;
int inputProfColorSpace = static_cast<int>(inputProf.colorSpace());
if ( inputProfColorSpace == icSigRgbData )
inputProfFormat = isPsdTiff ? TYPE_RGBA_8 : TYPE_BGRA_8; // Later make tiff and psd loader use TYPE_BGRA_8
inputProfFormat = isPsdTiff ? Format_RGBA_8 : Format_BGRA_8; // Later make tiff and psd loader use Format_BGRA_8
else if (( inputProfColorSpace == icSigCmykData ) && (isPsdTiff || pDataLoader->useRawImage()))
{
if (pDataLoader->r_image.channels() == 5)
inputProfFormat = (COLORSPACE_SH(PT_CMYK)|EXTRA_SH(1)|CHANNELS_SH(4)|BYTES_SH(1));
inputProfFormat = Format_CMYKA_8;
else
inputProfFormat = TYPE_CMYK_8;
inputProfFormat = Format_CMYK_8;
}
else if ( inputProfColorSpace == icSigCmykData )
inputProfFormat = SC_TYPE_YMCK_8;
inputProfFormat = Format_YMCK_8;
else if ( inputProfColorSpace == icSigGrayData )
inputProfFormat = TYPE_GRAY_8;
int outputProfColorSpace = static_cast<int>(cmsGetColorSpace(printerProf));
inputProfFormat = Format_GRAY_8;
int outputProfColorSpace = static_cast<int>(printerProf.colorSpace());
if ( outputProfColorSpace == icSigRgbData )
outputProfFormat = TYPE_BGRA_8;
outputProfFormat = Format_BGRA_8;
else if ( outputProfColorSpace == icSigCmykData )
outputProfFormat = SC_TYPE_YMCK_8;
outputProfFormat = Format_YMCK_8;
if (cmSettings.useColorManagement() && cmSettings.doSoftProofing())
{
cmsProofFlags |= cmsFLAGS_SOFTPROOFING;
cmsProofFlags |= Ctf_Softproofing;;
if (cmSettings.doGamutCheck())
{
cmsProofFlags |= cmsFLAGS_GAMUTCHECK;
cmsProofFlags |= Ctf_GamutCheck;
}
}
if (!cmSettings.useColorManagement() || cmSettings.useBlackPoint())
cmsFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
cmsFlags |= Ctf_BlackPointCompensation;
switch (reqType)
{
case CMYKData: // CMYK
// if ((!isCMYK && (outputProfColorSpace == icSigCmykData)) || (isCMYK && (outputProfColorSpace == icSigRgbData)) )
xform = scCmsCreateTransform(inputProf, inputProfFormat, printerProf, outputProfFormat, cmSettings.imageRenderingIntent(), cmsFlags);
xform = engine.createTransform(inputProf, inputProfFormat, printerProf, outputProfFormat, cmSettings.imageRenderingIntent(), cmsFlags);
if (outputProfColorSpace != icSigCmykData )
*realCMYK = isCMYK = false;
break;
2196,7 → 2196,7
case Thumbnail:
case RGBData: // RGB
if (isCMYK)
xform = scCmsCreateTransform(inputProf, inputProfFormat, screenProf, TYPE_BGRA_8, cmSettings.intent(), cmsFlags);
xform = engine.createTransform(inputProf, inputProfFormat, screenProf, Format_BGRA_8, cmSettings.intent(), cmsFlags);
else
{
if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
2222,17 → 2222,17
xform = cmSettings.cmykImageProofingTransform();
else
xform = cmSettings.rgbImageProofingTransform();
cmsChangeBuffersFormat(xform, inputProfFormat, TYPE_BGRA_8);
xform.changeBufferFormat(inputProfFormat, Format_BGRA_8);
stdProof = true;
}
else
xform = scCmsCreateProofingTransform(inputProf, inputProfFormat,
screenProf, TYPE_BGRA_8, printerProf,
cmSettings.intent(), INTENT_RELATIVE_COLORIMETRIC, cmsFlags | cmsProofFlags);
xform = engine.createProofingTransform(inputProf, inputProfFormat,
screenProf, Format_BGRA_8, printerProf,
cmSettings.intent(), Intent_Relative_Colorimetric, cmsFlags | cmsProofFlags);
}
else
xform = scCmsCreateTransform(inputProf, inputProfFormat, screenProf,
TYPE_BGRA_8, cmSettings.intent(), cmsFlags);
xform = engine.createTransform(inputProf, inputProfFormat, screenProf,
Format_BGRA_8, cmSettings.intent(), cmsFlags);
}
break;
case RawData: // no Conversion just raw Data
2269,7 → 2269,7
LPBYTE ptr = scanLine(i);
if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage())
ptr2 = pDataLoader->r_image.scanLine(i);
if ( inputProfFormat == TYPE_GRAY_8 && (reqType != CMYKData) )
if ( inputProfFormat == Format_GRAY_8 && (reqType != CMYKData) )
{
unsigned char* ucs = ptr2 ? (ptr2 + 1) : (ptr + 1);
unsigned char* uc = new unsigned char[width()];
2278,10 → 2278,10
uc[uci] = *ucs;
ucs += 4;
}
cmsDoTransform(xform, uc, ptr, width());
xform.apply(uc, ptr, width());
delete[] uc;
}
else if ( inputProfFormat == TYPE_GRAY_8 && (reqType == CMYKData) )
else if ( inputProfFormat == Format_GRAY_8 && (reqType == CMYKData) )
{
unsigned char value;
unsigned char* ucs = ptr2 ? ptr2 : ptr;
2298,10 → 2298,10
{
if (extensionIndicatesPSD(ext) || extensionIndicatesTIFF(ext) || pDataLoader->useRawImage()) //TODO: Unsure about this one
{
cmsDoTransform(xform, ptr2, ptr, width());
xform.apply(ptr2, ptr, width());
}
else
cmsDoTransform(xform, ptr, ptr, width());
xform.apply(ptr, ptr, width());
}
// if transforming from CMYK to RGB, flatten the alpha channel
// which will still contain the black channel
2357,15 → 2357,11
}
}
}
if (!stdProof && !ScCore->IsDefaultTransform(xform))
cmsDeleteTransform (xform);
}
if ((inputProf) && (inputProfisEmbedded) && !ScCore->IsDefaultProfile(inputProf))
cmsCloseProfile(inputProf);
if (isCMYK)
cmsChangeBuffersFormat(cmSettings.cmykImageProofingTransform(), TYPE_CMYK_8, TYPE_RGBA_8);
cmSettings.cmykImageProofingTransform().changeBufferFormat(Format_CMYK_8, Format_RGBA_8);
else
cmsChangeBuffersFormat(cmSettings.rgbImageProofingTransform(), TYPE_RGBA_8, TYPE_RGBA_8);
cmSettings.rgbImageProofingTransform().changeBufferFormat(Format_RGBA_8, Format_RGBA_8);
}
else
{
/trunk/Scribus/scribus/pageitem_textframe.cpp
29,7 → 29,6
#include <QPolygon>
#include <QRegion>
#include <cassert>
#include <cmath>
 
 
#include "canvas.h"
/trunk/Scribus/scribus/scimgdataloader_jpeg.cpp
9,11 → 9,11
#include <QObject>
#include <setjmp.h>
#include "scconfig.h"
#include "colormngt/sccolormngtengine.h"
#include "scimgdataloader_jpeg.h"
#include "scribuscore.h"
#include "exif.h"
 
#include CMS_INC
 
typedef struct my_error_mgr
{
struct jpeg_error_mgr pub; /* "public" fields */
76,18 → 76,18
unsigned char* EmbedBuffer;
if (read_jpeg_marker(ICC_MARKER,&cinfo, &EmbedBuffer, &EmbedLen))
{
cmsHPROFILE prof = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
QByteArray profArray = QByteArray((const char*) EmbedBuffer, EmbedLen);
ScColorProfile prof = ScCore->defaultEngine.openProfileFromMem(profArray);
if (prof)
{
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigRgbData)
if (static_cast<int>(prof.colorSpace()) == icSigRgbData)
m_profileComponents = 3;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigCmykData)
if (static_cast<int>(prof.colorSpace()) == icSigCmykData)
m_profileComponents = 4;
if (static_cast<int>(cmsGetColorSpace(prof)) == icSigGrayData)
if (static_cast<int>(prof.colorSpace()) == icSigGrayData)
m_profileComponents = 1;
m_embeddedProfile = QByteArray((const char*) EmbedBuffer, EmbedLen);
m_embeddedProfile = profArray;
}
cmsCloseProfile(prof);
free(EmbedBuffer);
}
//(void) jpeg_finish_decompress(&cinfo);
220,12 → 220,11
unsigned char* EmbedBuffer;
if (read_jpeg_marker(ICC_MARKER,&cinfo, &EmbedBuffer, &EmbedLen))
{
const char *Descriptor;
cmsHPROFILE prof = cmsOpenProfileFromMem(EmbedBuffer, EmbedLen);
Descriptor = cmsTakeProductDesc(prof);
m_embeddedProfile = QByteArray((const char*) EmbedBuffer, EmbedLen);
m_imageInfoRecord.profileName = QString(Descriptor);
m_imageInfoRecord.isEmbedded = true;
QByteArray profArray((const char*) EmbedBuffer, EmbedLen);
ScColorProfile prof = ScCore->defaultEngine.openProfileFromMem(profArray);
m_embeddedProfile = profArray;
m_imageInfoRecord.profileName = prof.productDescription();
m_imageInfoRecord.isEmbedded = true;
free(EmbedBuffer);
}
else
/trunk/Scribus/scribus/ui/pdfopts.cpp
12,13 → 12,15
* (at your option) any later version. *
* *
***************************************************************************/
#include "scconfig.h"
#include "pdfopts.h"
 
#include "colormngt/sccolormngtengine.h"
#include "commonstrings.h"
 
#include "pdfoptions.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "scconfig.h"
#include "sccolormngtengine.h"
#include "scpaths.h"
#include "scribusview.h"
#include "ui/customfdialog.h"
349,18 → 351,14
Opts.PrintProf = Options->PrintProfC->currentText();
if ((Opts.Version == PDFOptions::PDFVersion_X3) || (Opts.Version == PDFOptions::PDFVersion_X1a) || (Opts.Version == PDFOptions::PDFVersion_X4))
{
cmsHPROFILE hIn;
QByteArray profilePath( appPrinterProfiles[Opts.PrintProf].toLocal8Bit() );
hIn = cmsOpenProfileFromFile(profilePath.data(), "r");
const char *Descriptor = cmsTakeProductDesc(hIn);
cmsDescriptorName = QString(Descriptor);
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
ScColorProfile hIn = doc->colorEngine.openProfileFromFile( appPrinterProfiles[Opts.PrintProf] );
cmsDescriptorName = hIn.productDescription();
if (static_cast<int>(hIn.colorSpace()) == icSigRgbData)
components = 3;
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
if (static_cast<int>(hIn.colorSpace()) == icSigCmykData)
components = 4;
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmyData)
if (static_cast<int>(hIn.colorSpace()) == icSigCmyData)
components = 3;
cmsCloseProfile(hIn);
Opts.Info = Options->InfoString->text();
Opts.Encrypt = false;
Opts.MirrorH = false;
/trunk/Scribus/scribus/ui/customfdialog.cpp
146,7 → 146,7
{
ScImage im;
//No doc to send data anyway, so no doc to get into scimage.
CMSettings cms(0, "", 0);
CMSettings cms(0, "", Intent_Perceptual);
if (im.LoadPicture(name, 1, cms, false, false, ScImage::Thumbnail, 72, &mode))
{
int ix,iy;
/trunk/Scribus/scribus/ui/vruler.cpp
31,6 → 31,8
#include <QRect>
#include <QRubberBand>
 
#include <cmath>
 
#include "canvasgesture_rulermove.h"
#include "page.h"
#include "prefsmanager.h"
/trunk/Scribus/scribus/ui/preview.cpp
933,7 → 933,7
q++;
}
}
CMSettings cms(doc, "", 0);
CMSettings cms(doc, "", Intent_Perceptual);
if (flagsVisible["Cyan"]->isChecked())
{
if (GsMinor < 54)
1008,7 → 1008,7
}
if (flagsVisible["Black"]->isChecked())
{
CMSettings cms(doc, "", 0);
CMSettings cms(doc, "", Intent_Perceptual);
if (GsMinor < 54)
loaderror = im.LoadPicture(ScPaths::getTempFileDir()+"/sc.tif.Black.tif", 1, cms, false, false, ScImage::RGBData, 72, &mode);
else
1064,11 → 1064,12
{
QRgb alphaFF = qRgba(0,0,0,255);
QRgb alphaOO = qRgba(255,255,255,0);
cmsHTRANSFORM transCMYK = cmsCreateTransform(doc->DocPrinterProf, (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1)), doc->DocOutputProf, TYPE_BGRA_8, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_LOWRESPRECALC);
ScColorMngtEngine engine = doc->colorEngine;
ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocOutputProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
for( int yi=0; yi < h2; ++yi )
{
LPBYTE ptr = image.scanLine( yi );
cmsDoTransform(transCMYK, ptr, ptr, image.width());
transCMYK.apply(ptr, ptr, image.width());
QRgb *q = (QRgb *) ptr;
for (int xi = 0; xi < image.width(); xi++, q++)
{
1086,7 → 1087,6
*q |= alphaFF;
}
}
cmsDeleteTransform (transCMYK);
}
else
{
1126,7 → 1126,8
{
QRgb alphaFF = qRgba(0,0,0,255);
QRgb alphaOO = qRgba(255,255,255,0);
cmsHTRANSFORM transCMYK = cmsCreateTransform(doc->DocPrinterProf, (COLORSPACE_SH(PT_CMYK)|CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1)), doc->DocOutputProf, TYPE_BGRA_8, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_LOWRESPRECALC);
ScColorMngtEngine engine = doc->colorEngine;
ScColorTransform transCMYK = engine.createTransform(doc->DocPrinterProf, Format_YMCK_8, doc->DocOutputProf, Format_BGRA_8, Intent_Relative_Colorimetric, 0);
for (int y=0; y < h2; ++y )
{
LPBYTE ptr = image.scanLine( y );
1149,7 → 1150,7
*p = qRgba(cyan, magenta, yellow, black);
p++;
}
cmsDoTransform(transCMYK, ptr, ptr, image.width());
transCMYK.apply(ptr, ptr, image.width());
QRgb *q = (QRgb *) ptr;
for (int xi = 0; xi < image.width(); xi++, q++)
{
1167,7 → 1168,6
*q |= alphaFF;
}
}
cmsDeleteTransform (transCMYK);
}
else
{
/trunk/Scribus/scribus/ui/hruler.cpp
21,6 → 21,8
* *
***************************************************************************/
 
#include <cmath>
 
#include <QCursor>
#include <QMouseEvent>
// #include <QDebug>
/trunk/Scribus/scribus/ui/effectsdialog.cpp
49,7 → 49,7
doc = docc;
currentOptions = 0;
bool mode = false;
CMSettings cms(docc, "", 0);
CMSettings cms(docc, "", Intent_Perceptual);
image.LoadPicture(currItem->Pfile, currItem->pixm.imgInfo.actualPageNumber, cms, false, false, ScImage::RGBData, 72, &mode);
int ix = image.width();
int iy = image.height();
/trunk/Scribus/scribus/ui/annot.cpp
385,7 → 385,7
{
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "", 0);
CMSettings cms(view->Doc, "", Intent_Perceptual);
if (!item->Pfile.isEmpty())
{
im.LoadPicture(item->Pfile, 1, cms, false, false, ScImage::RGBData, 72);
1309,7 → 1309,7
{
dirs->set("icon", fileName.left(fileName.lastIndexOf("/")));
QPixmap pmI1;
CMSettings cms(view->Doc, "", 0);
CMSettings cms(view->Doc, "", Intent_Perceptual);
item->pixm.LoadPicture(fileName, 1, cms, false, false, ScImage::RGBData, 72);
pmI1=QPixmap::fromImage(item->pixm.qImage());
NiconPrev->setPixmap(pmI1);
1341,7 → 1341,7
dirs->set("icon", fileName.left(fileName.lastIndexOf("/")));
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "",0 );
CMSettings cms(view->Doc, "", Intent_Perceptual);
im.LoadPicture(fileName, 1, cms, false, false, ScImage::RGBData, 72);
pmI1=QPixmap::fromImage(im.qImage());
PiconPrev->setPixmap(pmI1);
1365,7 → 1365,7
dirs->set("icon", fileName.left(fileName.lastIndexOf("/")));
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "", 0);
CMSettings cms(view->Doc, "", Intent_Perceptual);
im.LoadPicture(fileName, 1, cms, false, false, ScImage::RGBData, 72);
pmI1=QPixmap::fromImage(im.qImage());
RiconPrev->setPixmap(pmI1);
/trunk/Scribus/scribus/ui/cmsprefs.cpp
111,8 → 111,8
prefs->DefaultSolidColorCMYKProfile = inputPCMYK->currentText();
prefs->DefaultMonitorProfile = monitorP->currentText();
prefs->DefaultPrinterProfile = printerP->currentText();
prefs->DefaultIntentColors = colorsI->currentIndex();
prefs->DefaultIntentImages = imagesI->currentIndex();
prefs->DefaultIntentColors = (eRenderIntent) colorsI->currentIndex();
prefs->DefaultIntentImages = (eRenderIntent) imagesI->currentIndex();
prefs->SoftProofOn = simulate->isChecked();
prefs->SoftProofFullOn = convertAll->isChecked();
prefs->GamutCheck = gamutC->isChecked();
142,8 → 142,8
doc->CMSSettings.DefaultSolidColorCMYKProfile = inputPCMYK->currentText();
doc->CMSSettings.DefaultMonitorProfile = monitorP->currentText();
doc->CMSSettings.DefaultPrinterProfile = printerP->currentText();
doc->CMSSettings.DefaultIntentColors = colorsI->currentIndex();
doc->CMSSettings.DefaultIntentImages = imagesI->currentIndex();
doc->CMSSettings.DefaultIntentColors = (eRenderIntent) colorsI->currentIndex();
doc->CMSSettings.DefaultIntentImages = (eRenderIntent) imagesI->currentIndex();
doc->CMSSettings.SoftProofOn = simulate->isChecked();
doc->CMSSettings.SoftProofFullOn = convertAll->isChecked();
doc->CMSSettings.GamutCheck = gamutC->isChecked();
/trunk/Scribus/scribus/ui/propertiespalette.cpp
41,7 → 41,9
#include <QValidator>
#include <QWidget>
 
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include "arrowchooser.h"
#include "autoform.h"
/trunk/Scribus/scribus/ui/preferencesdialog.cpp
1,240 → 1,240
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
#include <QDebug>
#include <QPushButton>
#include <QLayout>
#include <QListWidget>
#include <QVBoxLayout>
 
#include "preferencesdialog.h"
 
#include "commonstrings.h"
#include "prefsmanager.h"
#include "scribus.h"
#include "units.h"
#include "util_icon.h"
 
PreferencesDialog::PreferencesDialog( QWidget* parent )
: QDialog(parent),
counter(0)
{
setupUi(this);
setObjectName(QString::fromLocal8Bit("PreferencesDialog"));
setupListWidget();
while (prefsStackWidget->currentWidget()!=0)
prefsStackWidget->removeWidget(prefsStackWidget->currentWidget());
prefs_UserInterface = new Prefs_UserInterface(this);
addItem( tr("User Interface"), loadIcon("scribus.png"), prefs_UserInterface);
prefs_Paths = new Prefs_Paths(this);
addItem( tr("Paths"), loadIcon("tools.png"), prefs_Paths);
prefs_DocumentSetup = new Prefs_DocumentSetup(this);
addItem( tr("Document Setup"), loadIcon("scribusdoc.png"), prefs_DocumentSetup);
prefs_Guides = new Prefs_Guides(this);
addItem( tr("Guides"), loadIcon("guides.png"), prefs_Guides);
prefs_Typography = new Prefs_Typography(this);
addItem( tr("Typography"), loadIcon("typography.png"), prefs_Typography);
prefs_ItemTools = new Prefs_ItemTools(this);
addItem( tr("Item Tools"), loadIcon("tools.png"), prefs_ItemTools);
prefs_OperatorTools = new Prefs_OperatorTools(this);
addItem( tr("Operator Tools"), loadIcon("tools.png"), prefs_OperatorTools);
prefs_Hyphenator = new Prefs_Hyphenator(this);
addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), prefs_Hyphenator);
prefs_Fonts = new Prefs_Fonts(this);
addItem( tr("Fonts"), loadIcon("font.png"), prefs_Fonts);
prefs_Printer = new Prefs_Printer(this);
addItem( tr("Printer"), loadIcon("printer.png"), prefs_Printer);
prefs_ColorManagement = new Prefs_ColorManagement(this);
addItem( tr("Color Management"), loadIcon("blend.png"), prefs_ColorManagement);
prefs_PDFExport = new Prefs_PDFExport(this);
addItem( tr("PDF Export"), loadIcon("acroread32.png"), prefs_PDFExport);
prefs_DocumentItemAttributes = new Prefs_DocumentItemAttributes(this);
addItem( tr("Document Item Attributes"), loadIcon("docattributes.png"), prefs_DocumentItemAttributes);
prefs_TableOfContents = new Prefs_TableOfContents(this);
addItem( tr("Tables of Contents"), loadIcon("tabtocindex.png"), prefs_TableOfContents);
prefs_KeyboardShortcuts = new Prefs_KeyboardShortcuts(this);
addItem( tr("Keyboard Shortcuts"), loadIcon("key_bindings.png"), prefs_KeyboardShortcuts);
prefs_Scrapbook = new Prefs_Scrapbook(this);
addItem( tr("Scrapbook"), loadIcon("scrap.png"), prefs_Scrapbook);
prefs_Display = new Prefs_Display(this);
addItem( tr("Display"), loadIcon("screen.png"), prefs_Display);
prefs_ExternalTools = new Prefs_ExternalTools(this);
addItem( tr("External Tools"), loadIcon("externaltools.png"), prefs_ExternalTools);
prefs_Miscellaneous = new Prefs_Miscellaneous(this);
addItem( tr("Miscellaneous"), loadIcon("misc.png"), prefs_Miscellaneous);
prefs_Plugins = new Prefs_Plugins(this);
addItem( tr("Plugins"), loadIcon("plugins.png"), prefs_Plugins);
prefs_ShortWords = new Prefs_ShortWords(this);
addItem( tr("Short Words"), loadIcon("tools.png"), prefs_ShortWords);
prefs_Scripter = new Prefs_Scripter(this);
addItem( tr("Scripter"), loadIcon("tools.png"), prefs_Scripter);
 
arrangeIcons();
preferencesTypeList->item(0)->setSelected(true);
itemSelected(preferencesTypeList->item(0));
 
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(applyButton, SIGNAL(clicked()), this, SLOT(applyButtonClicked()));
connect(preferencesTypeList, SIGNAL(itemSelectionChanged()), this, SLOT(newItemSelected()));
 
initPreferenceValues();
setupGui();
 
}
 
void PreferencesDialog::restoreDefaults()
{
prefsManager->initDefaults();
setupGui();
}
 
void PreferencesDialog::initPreferenceValues()
{
prefsManager=PrefsManager::instance();
localPrefs=prefsManager->appPrefs;
mainWin = (ScribusMainWindow*)parent();
docUnitIndex = localPrefs.docSetupPrefs.docUnitIndex;
unitRatio = unitGetRatioFromIndex(docUnitIndex);
}
 
void PreferencesDialog::setupGui()
{
prefs_Scrapbook->restoreDefaults(&localPrefs);
prefs_Display->restoreDefaults(&localPrefs);
}
 
PreferencesDialog::~PreferencesDialog()
{
}
 
void PreferencesDialog::accept()
{
saveGuiToPrefs();
QDialog::accept ();
}
 
void PreferencesDialog::setupListWidget()
{
preferencesTypeList->setDragEnabled(false);
preferencesTypeList->setViewMode(QListView::ListMode);
preferencesTypeList->setFlow(QListView::TopToBottom);
preferencesTypeList->setIconSize(QSize(32,32));
preferencesTypeList->setSortingEnabled(false);
preferencesTypeList->setWrapping(false);
preferencesTypeList->setWordWrap(true);
preferencesTypeList->setAcceptDrops(false);
preferencesTypeList->setDropIndicatorShown(false);
preferencesTypeList->setDragDropMode(QAbstractItemView::NoDragDrop);
//preferencesTypeList->setResizeMode(QListView::Adjust);
preferencesTypeList->setSelectionMode(QAbstractItemView::SingleSelection);
 
preferencesTypeList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
preferencesTypeList->clear();
 
}
 
int PreferencesDialog::addItem(QString name, QPixmap icon, QWidget *tab)
{
//TODO: Can we avoid using this name and duplicating strings by getting it from the tab UIs
QListWidgetItem* newItem = new QListWidgetItem(icon, name, preferencesTypeList);
newItem->setTextAlignment(Qt::AlignHCenter);
prefsStackWidget->addWidget(tab);
stackWidgetMap.insert(newItem, counter);
counter++;
return counter-1;
}
 
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
#include <QDebug>
#include <QPushButton>
#include <QLayout>
#include <QListWidget>
#include <QVBoxLayout>
 
#include "preferencesdialog.h"
 
#include "commonstrings.h"
#include "prefsmanager.h"
#include "scribus.h"
#include "units.h"
#include "util_icon.h"
 
PreferencesDialog::PreferencesDialog( QWidget* parent )
: QDialog(parent),
counter(0)
{
setupUi(this);
setObjectName(QString::fromLocal8Bit("PreferencesDialog"));
setupListWidget();
while (prefsStackWidget->currentWidget()!=0)
prefsStackWidget->removeWidget(prefsStackWidget->currentWidget());
prefs_UserInterface = new Prefs_UserInterface(this);
addItem( tr("User Interface"), loadIcon("scribus.png"), prefs_UserInterface);
prefs_Paths = new Prefs_Paths(this);
addItem( tr("Paths"), loadIcon("tools.png"), prefs_Paths);
prefs_DocumentSetup = new Prefs_DocumentSetup(this);
addItem( tr("Document Setup"), loadIcon("scribusdoc.png"), prefs_DocumentSetup);
prefs_Guides = new Prefs_Guides(this);
addItem( tr("Guides"), loadIcon("guides.png"), prefs_Guides);
prefs_Typography = new Prefs_Typography(this);
addItem( tr("Typography"), loadIcon("typography.png"), prefs_Typography);
prefs_ItemTools = new Prefs_ItemTools(this);
addItem( tr("Item Tools"), loadIcon("tools.png"), prefs_ItemTools);
prefs_OperatorTools = new Prefs_OperatorTools(this);
addItem( tr("Operator Tools"), loadIcon("tools.png"), prefs_OperatorTools);
prefs_Hyphenator = new Prefs_Hyphenator(this);
addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), prefs_Hyphenator);
prefs_Fonts = new Prefs_Fonts(this);
addItem( tr("Fonts"), loadIcon("font.png"), prefs_Fonts);
prefs_Printer = new Prefs_Printer(this);
addItem( tr("Printer"), loadIcon("printer.png"), prefs_Printer);
prefs_ColorManagement = new Prefs_ColorManagement(this);
addItem( tr("Color Management"), loadIcon("blend.png"), prefs_ColorManagement);
prefs_PDFExport = new Prefs_PDFExport(this);
addItem( tr("PDF Export"), loadIcon("acroread32.png"), prefs_PDFExport);
prefs_DocumentItemAttributes = new Prefs_DocumentItemAttributes(this);
addItem( tr("Document Item Attributes"), loadIcon("docattributes.png"), prefs_DocumentItemAttributes);
prefs_TableOfContents = new Prefs_TableOfContents(this);
addItem( tr("Tables of Contents"), loadIcon("tabtocindex.png"), prefs_TableOfContents);
prefs_KeyboardShortcuts = new Prefs_KeyboardShortcuts(this);
addItem( tr("Keyboard Shortcuts"), loadIcon("key_bindings.png"), prefs_KeyboardShortcuts);
prefs_Scrapbook = new Prefs_Scrapbook(this);
addItem( tr("Scrapbook"), loadIcon("scrap.png"), prefs_Scrapbook);
prefs_Display = new Prefs_Display(this);
addItem( tr("Display"), loadIcon("screen.png"), prefs_Display);
prefs_ExternalTools = new Prefs_ExternalTools(this);
addItem( tr("External Tools"), loadIcon("externaltools.png"), prefs_ExternalTools);
prefs_Miscellaneous = new Prefs_Miscellaneous(this);
addItem( tr("Miscellaneous"), loadIcon("misc.png"), prefs_Miscellaneous);
prefs_Plugins = new Prefs_Plugins(this);
addItem( tr("Plugins"), loadIcon("plugins.png"), prefs_Plugins);
prefs_ShortWords = new Prefs_ShortWords(this);
addItem( tr("Short Words"), loadIcon("tools.png"), prefs_ShortWords);
prefs_Scripter = new Prefs_Scripter(this);
addItem( tr("Scripter"), loadIcon("tools.png"), prefs_Scripter);
 
arrangeIcons();
preferencesTypeList->item(0)->setSelected(true);
itemSelected(preferencesTypeList->item(0));
 
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(applyButton, SIGNAL(clicked()), this, SLOT(applyButtonClicked()));
connect(preferencesTypeList, SIGNAL(itemSelectionChanged()), this, SLOT(newItemSelected()));
 
initPreferenceValues();
setupGui();
 
}
 
void PreferencesDialog::restoreDefaults()
{
prefsManager->initDefaults();
setupGui();
}
 
void PreferencesDialog::initPreferenceValues()
{
prefsManager=PrefsManager::instance();
localPrefs=prefsManager->appPrefs;
mainWin = (ScribusMainWindow*)parent();
docUnitIndex = localPrefs.docSetupPrefs.docUnitIndex;
unitRatio = unitGetRatioFromIndex(docUnitIndex);
}
 
void PreferencesDialog::setupGui()
{
prefs_Scrapbook->restoreDefaults(&localPrefs);
prefs_Display->restoreDefaults(&localPrefs);
}
 
PreferencesDialog::~PreferencesDialog()
{
}
 
void PreferencesDialog::accept()
{
saveGuiToPrefs();
QDialog::accept ();
}
 
void PreferencesDialog::setupListWidget()
{
preferencesTypeList->setDragEnabled(false);
preferencesTypeList->setViewMode(QListView::ListMode);
preferencesTypeList->setFlow(QListView::TopToBottom);
preferencesTypeList->setIconSize(QSize(32,32));
preferencesTypeList->setSortingEnabled(false);
preferencesTypeList->setWrapping(false);
preferencesTypeList->setWordWrap(true);
preferencesTypeList->setAcceptDrops(false);
preferencesTypeList->setDropIndicatorShown(false);
preferencesTypeList->setDragDropMode(QAbstractItemView::NoDragDrop);
//preferencesTypeList->setResizeMode(QListView::Adjust);
preferencesTypeList->setSelectionMode(QAbstractItemView::SingleSelection);
 
preferencesTypeList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
preferencesTypeList->clear();
 
}
 
int PreferencesDialog::addItem(QString name, QPixmap icon, QWidget *tab)
{
//TODO: Can we avoid using this name and duplicating strings by getting it from the tab UIs
QListWidgetItem* newItem = new QListWidgetItem(icon, name, preferencesTypeList);
newItem->setTextAlignment(Qt::AlignHCenter);
prefsStackWidget->addWidget(tab);
stackWidgetMap.insert(newItem, counter);
counter++;
return counter-1;
}
 
void PreferencesDialog::newItemSelected()
{
QList<QListWidgetItem*> items = preferencesTypeList->selectedItems();
itemSelected((items.count() > 0) ? items.at(0) : NULL);
}
 
void PreferencesDialog::itemSelected(QListWidgetItem* ic)
{
if (ic == 0)
return;
if (stackWidgetMap.contains(ic))
{
//emit aboutToShow(prefsWidgets->widget(itemMap[ic]));
prefsStackWidget->setCurrentIndex(stackWidgetMap[ic]);
}
}
 
void PreferencesDialog::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange)
{
languageChange();
}
else
QWidget::changeEvent(e);
}
 
void PreferencesDialog::languageChange()
{
setWindowTitle( tr( "Preferences" ) );
}
 
void PreferencesDialog::arrangeIcons()
{/*
int maxWidth = 0;
QListWidgetItem* ic;
int startY = 5;
for (int cc = 0; cc < preferencesTypeList->count(); ++cc)
{
ic = preferencesTypeList->item(cc);
QRect ir = preferencesTypeList->visualItemRect(ic);
maxWidth = qMax(ir.width(), maxWidth);
}
preferencesTypeList->setMaximumWidth(maxWidth+16);
preferencesTypeList->setResizeMode(QListView::Fixed);
#ifdef _WIN32
int scrollBarWidth = 0;
QList<QScrollBar*> scrollBars = preferencesTypeList->findChildren<QScrollBar*>();
for (int cc = 0; cc < scrollBars.count(); ++cc)
{
if (scrollBars.at(cc)->orientation() == Qt::Vertical)
{
scrollBarWidth = scrollBars.at(cc)->height();
break;
}
}
#else
int scrollBarWidth = maxWidth;
#endif
int startX = qMax((preferencesTypeList->viewport()->width() - scrollBarWidth) / 2, 0);
for (int cc = 0; cc < preferencesTypeList->count(); ++cc)
{
ic = preferencesTypeList->item(cc);
QRect ir = preferencesTypeList->visualItemRect(ic);
 
#ifdef _WIN32
preferencesTypeList->setPositionForIndex(QPoint(qMax(startX - ir.width() / 2, 0), startY), preferencesTypeList->indexFromItem(ic));
#else
int moveW = (maxWidth - ir.width()) / 2;
preferencesTypeList->setPositionForIndex(QPoint(moveW + startX, startY), preferencesTypeList->indexFromItem(ic));
#endif
 
startY += ir.height()+5;
}*/
}
 
void PreferencesDialog::applyButtonClicked()
{
Prefs_Pane* pp=qobject_cast<Prefs_Pane *>(prefsStackWidget->currentWidget());
if (pp)
pp->saveGuiToPrefs(&localPrefs);
}
 
void PreferencesDialog::saveGuiToPrefs()
{
prefs_Scrapbook->saveGuiToPrefs(&localPrefs);
prefs_Display->saveGuiToPrefs(&localPrefs);
}
 
}
 
void PreferencesDialog::itemSelected(QListWidgetItem* ic)
{
if (ic == 0)
return;
if (stackWidgetMap.contains(ic))
{
//emit aboutToShow(prefsWidgets->widget(itemMap[ic]));
prefsStackWidget->setCurrentIndex(stackWidgetMap[ic]);
}
}
 
void PreferencesDialog::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange)
{
languageChange();
}
else
QWidget::changeEvent(e);
}
 
void PreferencesDialog::languageChange()
{
setWindowTitle( tr( "Preferences" ) );
}
 
void PreferencesDialog::arrangeIcons()
{/*
int maxWidth = 0;
QListWidgetItem* ic;
int startY = 5;
for (int cc = 0; cc < preferencesTypeList->count(); ++cc)
{
ic = preferencesTypeList->item(cc);
QRect ir = preferencesTypeList->visualItemRect(ic);
maxWidth = qMax(ir.width(), maxWidth);
}
preferencesTypeList->setMaximumWidth(maxWidth+16);
preferencesTypeList->setResizeMode(QListView::Fixed);
#ifdef _WIN32
int scrollBarWidth = 0;
QList<QScrollBar*> scrollBars = preferencesTypeList->findChildren<QScrollBar*>();
for (int cc = 0; cc < scrollBars.count(); ++cc)
{
if (scrollBars.at(cc)->orientation() == Qt::Vertical)
{
scrollBarWidth = scrollBars.at(cc)->height();
break;
}
}
#else
int scrollBarWidth = maxWidth;
#endif
int startX = qMax((preferencesTypeList->viewport()->width() - scrollBarWidth) / 2, 0);
for (int cc = 0; cc < preferencesTypeList->count(); ++cc)
{
ic = preferencesTypeList->item(cc);
QRect ir = preferencesTypeList->visualItemRect(ic);
 
#ifdef _WIN32
preferencesTypeList->setPositionForIndex(QPoint(qMax(startX - ir.width() / 2, 0), startY), preferencesTypeList->indexFromItem(ic));
#else
int moveW = (maxWidth - ir.width()) / 2;
preferencesTypeList->setPositionForIndex(QPoint(moveW + startX, startY), preferencesTypeList->indexFromItem(ic));
#endif
 
startY += ir.height()+5;
}*/
}
 
void PreferencesDialog::applyButtonClicked()
{
Prefs_Pane* pp=qobject_cast<Prefs_Pane *>(prefsStackWidget->currentWidget());
if (pp)
pp->saveGuiToPrefs(&localPrefs);
}
 
void PreferencesDialog::saveGuiToPrefs()
{
prefs_Scrapbook->saveGuiToPrefs(&localPrefs);
prefs_Display->saveGuiToPrefs(&localPrefs);
}
 
/trunk/Scribus/scribus/ui/picsearch.cpp
71,7 → 71,7
ext = getImageType(currentImage);
ScImage im;
//No doc to send data anyway, so no doc to get into scimage.
CMSettings cms(0, "", 0);
CMSettings cms(0, "", Intent_Perceptual);
if (im.LoadPicture(currentImage, 1, cms, false, false, ScImage::Thumbnail, 72, &mode))
{
int ix,iy;
/trunk/Scribus/scribus/scribus.cpp
49,10 → 49,8
#include <QTranslator>
#include <QWheelEvent>
 
 
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
 
#include "scconfig.h"
70,9 → 68,6
#include <signal.h>
#include <string>
 
 
 
 
#include "ui/about.h"
#include "ui/aboutplugins.h"
#include "actionmanager.h"
222,6 → 217,7
#include "util_formats.h"
#include "util_ghostscript.h"
#include "util_icon.h"
#include "util_math.h"
#include "ui/vruler.h"
#include "loadsaveplugin.h"
#include "plugins/formatidlist.h"
/trunk/Scribus/scribus/util_color.cpp
37,8 → 37,6
#include "util_formats.h"
#include "util_icon.h"
 
#include CMS_INC
 
using namespace std;
 
void handleOldColorShade(ScribusDoc* doc, QString& colName, int& shade)
115,8 → 113,8
int outheight=out.height();
for (int i=0; i < outheight; ++i)
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(doc->stdProofImg, ptr, ptr, out.width());
uchar* ptr = out.scanLine(i);
doc->stdProofImg.apply(ptr, ptr, out.width());
}
}
else
126,8 → 124,8
int outheight=out.height();
for (int i=0; i < outheight; ++i)
{
LPBYTE ptr = out.scanLine(i);
cmsDoTransform(doc->stdTransImg, ptr, ptr, out.width());
uchar* ptr = out.scanLine(i);
doc->stdTransImg.apply(ptr, ptr, out.width());
}
}
}
/trunk/Scribus/scribus/plugins/picbrowser/imagedialog.cpp
20,7 → 20,7
//no realCMYK
bool mode=false;
//no document needs to be assigned to this
CMSettings cms ( doc, "", 0 );
CMSettings cms ( doc, "", Intent_Perceptual );
 
//load image
if ( image.LoadPicture ( imageFile, 1, cms, true, true, ScImage::RGBProof, 72 , &mode ) )
/trunk/Scribus/scribus/plugins/picbrowser/loadimage.cpp
72,7 → 72,7
//no realCMYK
bool mode=false;
//no document needs to be assigned to this
CMSettings cms ( 0, "", 0 );
CMSettings cms ( 0, "", Intent_Perceptual);
 
ImageInformation *imgInfo = new ImageInformation;
 
/trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
5,13 → 5,14
for which a new license (GPL+exception) is in place.
*/
#include "objpdffile.h"
#include "colormngt/sccolormngtengine.h"
#include "cmdutil.h"
#include "ui/bookmarkpalette.h"
#include "prefsmanager.h"
#include "scribusdoc.h"
#include "scribuscore.h"
#include <structmember.h>
#include "ui/bookmarkpalette.h"
 
#include <structmember.h>
#include <QFileInfo>
#include <QList>
#include <QPixmap>
1105,19 → 1106,15
ScCore->primaryMainWindow()->doc->PDF_Options.PrintProf = PyString_AsString(self->printprofc);
if (ScCore->primaryMainWindow()->doc->PDF_Options.Version == PDFOptions::PDFVersion_X3)
{
// Where does compiler find cms function when I have not included header for it
const char *Descriptor;
cmsHPROFILE hIn;
hIn = cmsOpenProfileFromFile(ScCore->PrinterProfiles[ScCore->primaryMainWindow()->doc->PDF_Options.PrintProf].toLocal8Bit().constData(), "r");
Descriptor = cmsTakeProductDesc(hIn);
nam = QString(Descriptor);
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData)
ScColorProfile profile;
profile = ScCore->defaultEngine.openProfileFromFile(ScCore->PrinterProfiles[ScCore->primaryMainWindow()->doc->PDF_Options.PrintProf]);
nam = profile.productDescription();
if (static_cast<int>(profile.colorSpace()) == icSigRgbData)
Components = 3;
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData)
if (static_cast<int>(profile.colorSpace()) == icSigCmykData)
Components = 4;
if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmyData)
if (static_cast<int>(profile.colorSpace()) == icSigCmyData)
Components = 3;
cmsCloseProfile(hIn);
ScCore->primaryMainWindow()->doc->PDF_Options.Info = PyString_AsString(self->info);
self->bleedt = minmaxd(self->bleedt, 0, ScCore->primaryMainWindow()->view->Doc->pageHeight*ScCore->primaryMainWindow()->view->Doc->unitRatio());
ScCore->primaryMainWindow()->doc->PDF_Options.bleeds.Top = self->bleedt/ScCore->primaryMainWindow()->view->Doc->unitRatio();
/trunk/Scribus/scribus/plugins/cvgimplugin/importcvg.cpp
15,7 → 15,6
#include <QStack>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
 
#include "commonstrings.h"
/trunk/Scribus/scribus/plugins/pctimplugin/importpct.cpp
16,7 → 16,6
#include <QStack>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
 
#include "commonstrings.h"
/trunk/Scribus/scribus/plugins/wmfimplugin/wmfimport.cpp
19,30 → 19,29
#include <QPainterPath>
#include <QRegExp>
 
#include "ui/customfdialog.h"
#include "commonstrings.h"
#include "scribus.h"
#include "scribusXml.h"
#include "ui/propertiespalette.h"
#include "prefsfile.h"
 
#include <cmath>
#include "commonstrings.h"
#include "fonts/scfontmetrics.h"
#include "fpointarray.h"
#include "menumanager.h"
#include "prefsmanager.h"
#include "pageitem.h"
#include "prefsfile.h"
#include "scmimedata.h"
#include "scraction.h"
#include "scribuscore.h"
#include "scribusdoc.h"
#include "selection.h"
#include "ui/customfdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "loadsaveplugin.h"
#include "util.h"
#include "util_icon.h"
#include "util_math.h"
#include "fonts/scfontmetrics.h"
 
 
using namespace std;
 
#include "wmfstruct.h"
/trunk/Scribus/scribus/plugins/aiimplugin/importai.cpp
16,22 → 16,18
#include <QTemporaryFile>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
#include <tiffio.h>
#include <zlib.h>
 
#include "commonstrings.h"
#include "ui/customfdialog.h"
 
#include "importai.h"
#include "loadsaveplugin.h"
#include "ui/missing.h"
#include "ui/multiprogressdialog.h"
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefstable.h"
#include "ui/propertiespalette.h"
#include "rawimage.h"
#include "sccolorengine.h"
#include "scconfig.h"
46,6 → 42,10
#include "sctextstream.h"
#include "selection.h"
#include "text/specialchars.h"
#include "ui/customfdialog.h"
#include "ui/missing.h"
#include "ui/multiprogressdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "util.h"
#include "util_color.h"
/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
25,6 → 25,7
***************************************************************************/
 
#include "lensdialog.h"
#include <cmath>
#include <QRadialGradient>
#include "util_icon.h"
#include "selection.h"
/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
24,6 → 24,10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include "pathstroker.h"
#include "pageitem_polygon.h"
#include "commonstrings.h"
/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.h
31,6 → 31,10
#include "scplugin.h"
#include "selection.h"
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
 
#include "../lib2geom/sbasis.h"
#include "../lib2geom/sbasis-geometric.h"
#include "../lib2geom/bezier-to-sbasis.h"
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.h
38,6 → 38,10
#include "scribusdoc.h"
#include "scribus.h"
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
 
#include "../lib2geom/sbasis.h"
#include "../lib2geom/sbasis-geometric.h"
#include "../lib2geom/bezier-to-sbasis.h"
/trunk/Scribus/scribus/plugins/tools/transform/transformdialog.cpp
25,10 → 25,15
***************************************************************************/
 
#include "transformdialog.h"
#include "util_icon.h"
 
#include "commonstrings.h"
#include "selection.h"
#include "commonstrings.h"
#include "units.h"
#include "util_icon.h"
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
 
TransformItem::TransformItem(QString text, QListWidget* parent, int type, double val1, double val2) : QListWidgetItem(text, parent, type)
/trunk/Scribus/scribus/plugins/xfigimplugin/importxfig.cpp
15,15 → 15,11
#include <QStack>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
 
#include "commonstrings.h"
#include "ui/customfdialog.h"
#include "importxfig.h"
#include "loadsaveplugin.h"
#include "ui/missing.h"
#include "ui/multiprogressdialog.h"
#include "pagesize.h"
#include "pageitem.h"
#include "prefscontext.h"
30,7 → 26,6
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefstable.h"
#include "ui/propertiespalette.h"
#include "rawimage.h"
#include "scclocale.h"
#include "sccolorengine.h"
43,6 → 38,10
#include "scribuscore.h"
#include "sctextstream.h"
#include "selection.h"
#include "ui/customfdialog.h"
#include "ui/missing.h"
#include "ui/multiprogressdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "util.h"
#include "util_formats.h"
/trunk/Scribus/scribus/plugins/wpgimplugin/importwpg.cpp
15,7 → 15,6
#include <QStack>
#include <QDebug>
 
#include <cmath>
#include <cstdlib>
 
#include "commonstrings.h"
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
14,10 → 14,8
#include <QPainterPath>
#include <QRegExp>
#include <QTemporaryFile>
#include <cmath>
#include "color.h"
#include "commonstrings.h"
#include "ui/customfdialog.h"
#include "fonts/scfontmetrics.h"
#include "fpointarray.h"
#include "loadsaveplugin.h"
25,7 → 23,6
#include "pageitem.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "ui/propertiespalette.h"
#include "sccolorengine.h"
#include "scclocale.h"
#include "scconfig.h"
40,6 → 37,8
#include "scribusdoc.h"
#include "selection.h"
#include "svgplugin.h"
#include "ui/customfdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "util.h"
#include "util_formats.h"
/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
340,8 → 340,8
m_Doc->CMSSettings.DefaultSolidColorCMYKProfile = dc.attribute("DPPr",""); // Use DPPr to match 1.2.x behavior
//m_Doc->CMSSettings.DefaultIntentPrinter = dc.attribute("DIPr", "0").toInt();
//m_Doc->CMSSettings.DefaultIntentMonitor = dc.attribute("DIMo", "1").toInt();
m_Doc->CMSSettings.DefaultIntentColors = dc.attribute("DISc", "1").toInt();
m_Doc->CMSSettings.DefaultIntentImages = dc.attribute("DIIm", "0").toInt();
m_Doc->CMSSettings.DefaultIntentColors = (eRenderIntent) dc.attribute("DISc", "1").toInt();
m_Doc->CMSSettings.DefaultIntentImages = (eRenderIntent) dc.attribute("DIIm", "0").toInt();
activeLayer = dc.attribute("ALAYER", "0").toInt();
m_Doc->Language = dc.attribute("LANGUAGE", "");
m_Doc->MinWordLen = dc.attribute("MINWORDLEN", "3").toInt();
956,9 → 956,9
OB->Pfile = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
OB->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
OB->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
OB->IProfile=obj->attribute("PRFILE","");
OB->EmProfile=obj->attribute("EPROF","");
OB->IRender = obj->attribute("IRENDER", "1").toInt();
OB->IProfile = obj->attribute("PRFILE","");
OB->EmProfile= obj->attribute("EPROF","");
OB->IRender = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
OB->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
OB->Locked = static_cast<bool>(obj->attribute("LOCK", "0").toInt());
OB->LockRes = static_cast<bool>(obj->attribute("LOCKR", "0").toInt());
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
313,8 → 313,8
m_Doc->CMSSettings.DefaultSolidColorCMYKProfile = dc.attribute("DPPr","");
//m_Doc->CMSSettings.DefaultIntentPrinter = dc.attribute("DIPr", "0").toInt();
//m_Doc->CMSSettings.DefaultIntentMonitor = dc.attribute("DIMo", "1").toInt();
m_Doc->CMSSettings.DefaultIntentColors = dc.attribute("DISc", "1").toInt();
m_Doc->CMSSettings.DefaultIntentImages = dc.attribute("DIIm", "0").toInt();
m_Doc->CMSSettings.DefaultIntentColors = (eRenderIntent) dc.attribute("DISc", "1").toInt();
m_Doc->CMSSettings.DefaultIntentImages = (eRenderIntent) dc.attribute("DIIm", "0").toInt();
layerToSetActive=dc.attribute("ALAYER", "0").toInt();
m_Doc->Language = dc.attribute("LANGUAGE", "");
m_Doc->MinWordLen = dc.attribute("MINWORDLEN", "3").toInt();
2050,7 → 2050,7
currItem->Pfile = Relative2Path(obj->attribute("PFILE"), baseDir);
currItem->IProfile = obj->attribute("PRFILE","");
currItem->EmProfile = obj->attribute("EPROF","");
currItem->IRender = obj->attribute("IRENDER", "1").toInt();
currItem->IRender = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
currItem->pixm.imgInfo.lowResType = obj->attribute("ImageRes", "1").toInt();
IT = obj->firstChild();
2068,9 → 2068,9
}
if (!currItem->Pfile.isEmpty())
doc->loadPict(currItem->Pfile, currItem, false);
currItem->IProfile = obj->attribute("PRFILE","");
currItem->IProfile = obj->attribute("PRFILE","");
currItem->EmProfile = obj->attribute("EPROF","");
currItem->IRender = obj->attribute("IRENDER", "1").toInt();
currItem->IRender = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
currItem->setImageXYScale(scx, scy);
clPath = obj->attribute("ImageClip", "");
2136,9 → 2136,9
currItem->Pfile = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
currItem->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
currItem->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
currItem->IProfile = obj->attribute("PRFILE","");
currItem->IProfile = obj->attribute("PRFILE","");
currItem->EmProfile = obj->attribute("EPROF","");
currItem->IRender = obj->attribute("IRENDER", "1").toInt();
currItem->IRender = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
2164,9 → 2164,9
currItem->Pfile = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
currItem->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
currItem->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
currItem->IProfile = obj->attribute("PRFILE","");
currItem->IProfile = obj->attribute("PRFILE","");
currItem->EmProfile = obj->attribute("EPROF","");
currItem->IRender = obj->attribute("IRENDER", "1").toInt();
currItem->IRender = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
7,6 → 7,7
#include "scribus150format.h"
#include "scribus150formatimpl.h"
 
#include <ctime>
#include <memory>
 
#include "../../formatidlist.h"
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
803,8 → 803,8
doc->CMSSettings.DefaultSolidColorCMYKProfile = attrs.valueAsString("DPIn3","");
else
doc->CMSSettings.DefaultSolidColorCMYKProfile = attrs.valueAsString("DPPr","");
doc->CMSSettings.DefaultIntentColors = attrs.valueAsInt("DISc", 1);
doc->CMSSettings.DefaultIntentImages = attrs.valueAsInt("DIIm", 0);
doc->CMSSettings.DefaultIntentColors = (eRenderIntent) attrs.valueAsInt("DISc", 1);
doc->CMSSettings.DefaultIntentImages = (eRenderIntent) attrs.valueAsInt("DIIm", 0);
}
 
void Scribus150Format::readDocumentInfo(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
2306,13 → 2306,13
}
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF" , "");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
currItem->pixm.imgInfo.lowResType = attrs.valueAsInt("ImageRes", 1);
currItem->pixm.imgInfo.actualPageNumber = attrs.valueAsInt("Pagenumber", 0);
currItem->IProfile = attrs.valueAsString("PRFILE","");
currItem->EmProfile = attrs.valueAsString("EPROF","");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
if (currItem->asLatexFrame())
{
2362,7 → 2362,7
currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF", "");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
2390,7 → 2390,7
currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF", "");
currItem->IRender = attrs.valueAsInt("IRENDER" , 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
/trunk/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
13,7 → 13,6
#include <QDomElement>
#include <QDrag>
#include <QMimeData>
#include <cmath>
 
#include "oodrawimp.h"
 
21,7 → 20,6
 
#include "color.h"
#include "commonstrings.h"
#include "ui/customfdialog.h"
#include "fileunzip.h"
#include "fpointarray.h"
#include "menumanager.h"
31,7 → 29,6
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefstable.h"
#include "ui/propertiespalette.h"
#include "scclocale.h"
#include "sccolorengine.h"
#include "scmimedata.h"
42,6 → 39,8
#include "selection.h"
#include "serializer.h"
#include "stylestack.h"
#include "ui/customfdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "util.h"
#include "util_icon.h"
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
7,6 → 7,7
#include "scribus134format.h"
#include "scribus134formatimpl.h"
 
#include <ctime>
#include <memory>
 
#include "../../formatidlist.h"
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
800,8 → 800,8
doc->CMSSettings.DefaultSolidColorCMYKProfile = attrs.valueAsString("DPIn3","");
else
doc->CMSSettings.DefaultSolidColorCMYKProfile = attrs.valueAsString("DPPr","");
doc->CMSSettings.DefaultIntentColors = attrs.valueAsInt("DISc", 1);
doc->CMSSettings.DefaultIntentImages = attrs.valueAsInt("DIIm", 0);
doc->CMSSettings.DefaultIntentColors = (eRenderIntent) attrs.valueAsInt("DISc", 1);
doc->CMSSettings.DefaultIntentImages = (eRenderIntent) attrs.valueAsInt("DIIm", 0);
}
 
void Scribus134Format::readDocumentInfo(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
2328,13 → 2328,13
}
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF" , "");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
currItem->pixm.imgInfo.lowResType = attrs.valueAsInt("ImageRes", 1);
currItem->pixm.imgInfo.actualPageNumber = attrs.valueAsInt("Pagenumber", 0);
currItem->IProfile = attrs.valueAsString("PRFILE","");
currItem->EmProfile = attrs.valueAsString("EPROF","");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
if (currItem->asLatexFrame())
{
2384,7 → 2384,7
currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF", "");
currItem->IRender = attrs.valueAsInt("IRENDER", 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
2412,7 → 2412,7
currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
currItem->IProfile = attrs.valueAsString("PRFILE", "");
currItem->EmProfile = attrs.valueAsString("EPROF", "");
currItem->IRender = attrs.valueAsInt("IRENDER" , 1);
currItem->IRender = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
doc->LoadPict(currItem->Pfile, z);
currItem->setImageXYScale(scx, scy);
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
35,21 → 35,21
#include "canvas.h"
#include "cmsettings.h"
#include "commonstrings.h"
#include "ui/customfdialog.h"
#include "scribuscore.h"
#include "page.h"
#include "scgzfile.h"
#include "prefsmanager.h"
#include "prefsfile.h"
#include "prefscontext.h"
#include "ui/scmessagebox.h"
#include "scgzfile.h"
#include "scpattern.h"
#include "scribuscore.h"
#include "sctextstruct.h"
#include "util.h"
#include "ui/customfdialog.h"
#include "sctextstruct.h"
#include "ui/guidemanager.h"
#include "ui/scmessagebox.h"
#include "sccolorengine.h"
#include "util_formats.h"
#include "util_math.h"
 
int svgexplugin_getPluginAPIVersion()
{
/trunk/Scribus/scribus/plugins/psimport/importps.cpp
15,20 → 15,15
#include <QRegExp>
#include <QStack>
 
#include <cmath>
#include <cstdlib>
 
 
#include "commonstrings.h"
#include "ui/customfdialog.h"
#include "importps.h"
#include "loadsaveplugin.h"
#include "ui/multiprogressdialog.h"
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefstable.h"
#include "ui/propertiespalette.h"
#include "scconfig.h"
#include "scclocale.h"
#include "scmimedata.h"
38,6 → 33,9
#include "scribuscore.h"
#include "sctextstream.h"
#include "selection.h"
#include "ui/customfdialog.h"
#include "ui/multiprogressdialog.h"
#include "ui/propertiespalette.h"
#include "undomanager.h"
#include "util.h"
#include "util_color.h"
/trunk/Scribus/scribus/canvasgesture_resize.cpp
13,6 → 13,11
* *
***************************************************************************/
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
 
#include "canvasgesture_resize.h"
 
#include <QMouseEvent>
/trunk/Scribus/scribus/scdocoutput_ps2.h
45,7 → 45,6
 
virtual ScPageOutput* createPageOutputComponent(int pageIndex);
 
void closeTransforms(void);
bool initializeCmsTransforms(void);
 
public:
/trunk/Scribus/scribus/scpreview.cpp
19,7 → 19,6
#include <QPolygon>
#include <QPixmap>
#include <QTemporaryFile>
#include <cmath>
#include <cstdlib>
 
#include "cmsettings.h"
298,7 → 297,7
OB.Pfile3 = pg.attribute("PFILE3","");
OB.IProfile = pg.attribute("PRFILE","");
OB.EmProfile = pg.attribute("EPROF","");
OB.IRender = pg.attribute("IRENDER", "1").toInt();
OB.IRender = (eRenderIntent) pg.attribute("IRENDER", "1").toInt();
OB.UseEmbedded = pg.attribute("EMBEDDED", "1").toInt();
OB.Locked = static_cast<bool>(pg.attribute("LOCK", "0").toInt());
OB.Reverse = static_cast<bool>(pg.attribute("REVERS", "0").toInt());
608,7 → 607,7
pS->scale(1, -1);
}
ScImage pixm;
CMSettings cms(0, "", 0);
CMSettings cms(0, "", Intent_Perceptual);
pixm.LoadPicture(OB.Pfile, 1, cms, false, false, ScImage::RGBData, 72); //FIXME: OB doesnt know about pagenr
pS->scale(OB.LocalScX, OB.LocalScY);
pS->translate(static_cast<int>(OB.LocalX), static_cast<int>(OB.LocalY));
651,7 → 650,7
pS->scale(1, -1);
}
ScImage pixm;
CMSettings cms(0, "", 0);
CMSettings cms(0, "", Intent_Perceptual);
pixm.LoadPicture(fileName, 1, cms, false, false, ScImage::RGBData, 72); //FIXME: OB doesnt know about pagenr
pS->scale(OB.LocalScX, OB.LocalScY);
pS->translate(static_cast<int>(OB.LocalX), static_cast<int>(OB.LocalY));
/trunk/Scribus/scribus/pslib.cpp
1799,7 → 1799,7
PS_setGray();
applyICC = Ic;
if ((Doc->HasCMS) && (ScCore->haveCMS()) && (applyICC))
solidTransform = scCmsCreateTransform(Doc->DocInputCMYKProf, TYPE_CMYK_16, Doc->DocPrinterProf, TYPE_CMYK_16, Doc->IntentColors, 0);
solidTransform = Doc->colorEngine.createTransform(Doc->DocInputCMYKProf, Format_CMYK_16, Doc->DocPrinterProf, Format_CMYK_16, Doc->IntentColors, 0);
else
applyICC = false;
if (usingGUI)
2031,8 → 2031,6
}
PS_close();
if (usingGUI) progressDialog->close();
if ((Doc->HasCMS) && (ScCore->haveCMS()) && (applyICC))
cmsDeleteTransform(solidTransform);
if (errorOccured)
return 1;
else if (abortExport)
3653,7 → 3651,7
inC[1] = s1 * 257;
inC[2] = v1 * 257;
inC[3] = k1 * 257;
cmsDoTransform(solidTransform, inC, outC, 1);
solidTransform.apply(inC, outC, 1);
*h= outC[0] / 257;
*s = outC[1] / 257;
*v = outC[2] / 257;
/trunk/Scribus/scribus/pageitem_desaxe.cpp
29,8 → 29,11
 
using namespace desaxe;
 
eRenderIntent parseIntent(const Xml_string& str)
{
return (eRenderIntent) str.toInt();
}
 
 
FPointArray parseSVG(const Xml_string& str)
{
FPointArray result;
810,7 → 813,7
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setImageFlippedH, "image-flipped-hor", &parseBool ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setImageFlippedV, "image-flipped-vert", &parseBool ));
ruleset.addRule(itemPrefix, SetAttribute<PageItem,QString>( & PageItem::setCmsProfile, "cms-profile" ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setCmsRenderingIntent, "cms-intent", &parseInt ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem, eRenderIntent>( & PageItem::setCmsRenderingIntent, "cms-intent", &parseIntent ));
 
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setControlsGroup, "isGroupControl", &parseBool ));
ruleset.addRule(itemPrefix, PatchIdRefAttribute<PageItem, PageItem>( & PageItem::setGroupsLastItem, "groupsLastItem" ));
/trunk/Scribus/scribus/cmsettings.h
32,18 → 32,18
#include <QString>
class ScribusDoc;
 
#include CMS_INC
#include "colormngt/sccolormngtengine.h"
 
class SCRIBUS_API CMSettings
{
public:
CMSettings(ScribusDoc* doc, const QString& profileName, int intent);
CMSettings(ScribusDoc* doc, const QString& profileName, eRenderIntent intent);
~CMSettings();
ScribusDoc* doc() const {return m_Doc;}
QString profileName() const {return m_ProfileName;}
QString outputProfile() const { return m_outputProfile; }
int intent() const {return m_Intent;}
eRenderIntent intent() const { return m_Intent; }
 
bool useOutputProfile() const { return !m_outputProfile.isEmpty(); }
void setOutputProfile(const QString& prof) { m_outputProfile = prof; }
57,34 → 57,34
QString defaultSolidColorRGBProfile() const;
QString defaultSolidColorCMYKProfile() const;
 
int colorRenderingIntent() const;
int imageRenderingIntent() const;
eRenderIntent colorRenderingIntent() const;
eRenderIntent imageRenderingIntent() const;
 
bool useBlackPoint() const;
bool doSoftProofing() const;
bool doGamutCheck() const;
 
cmsHPROFILE monitorProfile() const;
cmsHPROFILE printerProfile() const;
ScColorProfile monitorProfile() const;
ScColorProfile printerProfile() const;
 
cmsHTRANSFORM rgbColorDisplayTransform() const; // stdTransRGBMonG
cmsHTRANSFORM rgbColorProofingTransform() const; // stdProofG
cmsHTRANSFORM rgbImageDisplayTransform() const; // stdTransImgG
cmsHTRANSFORM rgbImageProofingTransform() const; // stdProofImgG
cmsHTRANSFORM rgbToCymkColorTransform() const; // stdTransCMYKG
cmsHTRANSFORM rgbGamutCheckTransform() const; // stdProofGCG
ScColorTransform rgbColorDisplayTransform() const; // stdTransRGBMonG
ScColorTransform rgbColorProofingTransform() const; // stdProofG
ScColorTransform rgbImageDisplayTransform() const; // stdTransImgG
ScColorTransform rgbImageProofingTransform() const; // stdProofImgG
ScColorTransform rgbToCymkColorTransform() const; // stdTransCMYKG
ScColorTransform rgbGamutCheckTransform() const; // stdProofGCG
 
cmsHTRANSFORM cmykColorDisplayTransform() const; // stdTransCMYKMonG
cmsHTRANSFORM cmykColorProofingTransform() const; // stdProofCMYKG
cmsHTRANSFORM cmykImageProofingTransform() const; // stdProofImgCMYK
cmsHTRANSFORM cmykToRgbColorTransform() const; // stdTransRGBG
cmsHTRANSFORM cmykGamutCheckTransform() const; //stdProofCMYKGCG
ScColorTransform cmykColorDisplayTransform() const; // stdTransCMYKMonG
ScColorTransform cmykColorProofingTransform() const; // stdProofCMYKG
ScColorTransform cmykImageProofingTransform() const; // stdProofImgCMYK
ScColorTransform cmykToRgbColorTransform() const; // stdTransRGBG
ScColorTransform cmykGamutCheckTransform() const; //stdProofCMYKGCG
 
protected:
ScribusDoc* m_Doc;
QString m_ProfileName;
QString m_outputProfile;
int m_Intent;
eRenderIntent m_Intent;
 
};
 
/trunk/Scribus/scribus/CMakeLists.txt
4,10 → 4,11
 
ADD_SUBDIRECTORY(dtd)
ADD_SUBDIRECTORY(manpages)
ADD_SUBDIRECTORY(colormngt)
ADD_SUBDIRECTORY(desaxe)
ADD_SUBDIRECTORY(fonts)
ADD_SUBDIRECTORY(styles)
ADD_SUBDIRECTORY(text)
ADD_SUBDIRECTORY(fonts)
ADD_SUBDIRECTORY(desaxe)
ADD_SUBDIRECTORY(unicodemap)
IF (WANT_DESIGNER)
ADD_SUBDIRECTORY(designer)
806,10 → 807,11
)
 
LINK_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/colormngt
${CMAKE_CURRENT_BINARY_DIR}/desaxe
${CMAKE_CURRENT_BINARY_DIR}/fonts
${CMAKE_CURRENT_BINARY_DIR}/styles
${CMAKE_CURRENT_BINARY_DIR}/text
${CMAKE_CURRENT_BINARY_DIR}/styles
${CMAKE_CURRENT_BINARY_DIR}/fonts
${CMAKE_CURRENT_BINARY_DIR}/plugins/wpgimplugin/wpg
)
 
817,6 → 819,7
LINK_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/prc )
ENDIF (HAVE_OSG)
 
SET(SCRIBUS_COLORMNGT_LIB "scribus_colormngt_lib")
SET(SCRIBUS_TEXT_LIB "scribus_text_lib")
SET(SCRIBUS_STYLES_LIB "scribus_styles_lib")
SET(SCRIBUS_FONTS_LIB "scribus_fonts_lib")
871,6 → 874,7
${SCRIBUS_UI_SOURCES}
${SCRIBUS_TEXT_SOURCES}
${SCRIBUS_STYLES_SOURCES}
${SCRIBUS_COLORMNGT_SOURCES}
${SCRIBUS_FONTS_SOURCES}
${SCRIBUS_DESAXE_SOURCES}
${SCRIBUS_WIN32_ONLY_SOURCES}
885,6 → 889,7
${SCRIBUS_UI_SOURCES}
${SCRIBUS_TEXT_SOURCES}
${SCRIBUS_STYLES_SOURCES}
${SCRIBUS_COLORMNGT_SOURCES}
${SCRIBUS_FONTS_SOURCES}
${SCRIBUS_DESAXE_SOURCES}
${SCRIBUS_WIN32_ONLY_SOURCES}
952,6 → 957,7
ENDIF(APPLE)
 
TARGET_LINK_LIBRARIES(${EXE_NAME}
${SCRIBUS_COLORMNGT_LIB}
${SCRIBUS_DESAXE_LIB}
${SCRIBUS_TEXT_LIB}
${SCRIBUS_STYLES_LIB}
/trunk/Scribus/win32/vc8/Scribus.vcproj
43,7 → 43,7
Optimization="0"
InlineFunctionExpansion="0"
EnableIntrinsicFunctions="false"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\colormngt;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_EDITION=QT_EDITION_DESKTOP;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;HAVE_CAIRO;HAVE_CONFIG_H;AVOID_WIN32_FILEIO;COMPILE_SCRIBUS_MAIN_APP;DOCDIR=\&quot;doc/\&quot;;ICONDIR=\&quot;icons/\&quot;;SAMPLESDIR=\&quot;samples/\&quot;;SCRIPTSDIR=\&quot;scripts/\&quot;;SHAREDIR=\&quot;share/\&quot;;TEMPLATEDIR=\&quot;templates/\&quot;;LIBDIR=\&quot;libs/\&quot;;PLUGINDIR=\&quot;plugins\&quot;"
IgnoreStandardIncludePath="false"
MinimalRebuild="true"
136,7 → 136,7
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\colormngt;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;QT_LARGEFILE_SUPPORT;QT_EDITION=QT_EDITION_DESKTOP;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;;HAVE_CAIRO;HAVE_CONFIG_H;AVOID_WIN32_FILEIO;COMPILE_SCRIBUS_MAIN_APP;DOCDIR=\&quot;doc/\&quot;;ICONDIR=\&quot;icons/\&quot;;SAMPLESDIR=\&quot;samples/\&quot;;SCRIPTSDIR=\&quot;scripts/\&quot;;SHAREDIR=\&quot;share/\&quot;;TEMPLATEDIR=\&quot;templates/\&quot;;LIBDIR=\&quot;libs/\&quot;;PLUGINDIR=\&quot;plugins\&quot;"
StringPooling="true"
RuntimeLibrary="2"
227,7 → 227,7
Optimization="0"
InlineFunctionExpansion="0"
EnableIntrinsicFunctions="false"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\colormngt;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_EDITION=QT_EDITION_DESKTOP;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;HAVE_CONFIG_H;AVOID_WIN32_FILEIO;COMPILE_SCRIBUS_MAIN_APP;DOCDIR=\&quot;doc/\&quot;;ICONDIR=\&quot;icons/\&quot;;SAMPLESDIR=\&quot;samples/\&quot;;SCRIPTSDIR=\&quot;scripts/\&quot;;SHAREDIR=\&quot;share/\&quot;;TEMPLATEDIR=\&quot;templates/\&quot;;LIBDIR=\&quot;libs/\&quot;;PLUGINDIR=\&quot;plugins\&quot;"
IgnoreStandardIncludePath="false"
MinimalRebuild="true"
320,7 → 320,7
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
AdditionalIncludeDirectories="..\vc8;..\..\scribus;..\..\scribus\colormngt;..\..\scribus\fonts;..\..\scribus\text;..\..\scribus\styles;..\..\scribus\simpletreemodel;..\..\scribus\ui;&quot;$(QT4_DIR)\include\QtCore&quot;;&quot;$(QT4_DIR)\include\QtGui&quot;;&quot;$(QT4_DIR)\include\QtNetwork&quot;;&quot;$(QT4_DIR)\include\QtWebKit&quot;;&quot;$(QT4_DIR)\include\QtXml&quot;;&quot;$(QT4_DIR)\include&quot;;&quot;$(QT4_DIR)\src\3rdparty\zlib&quot;;&quot;$(LCMS_DIR)\include&quot;;&quot;$(CAIRO_DIR)\include&quot;;&quot;$(FREETYPE_DIR)\include&quot;;&quot;$(LIBJPEG_DIR)\include&quot;;&quot;$(LIBTIFF_DIR)\include&quot;;&quot;$(PODOFO_DIR)\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;QT_LARGEFILE_SUPPORT;QT_EDITION=QT_EDITION_DESKTOP;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;HAVE_CONFIG_H;AVOID_WIN32_FILEIO;COMPILE_SCRIBUS_MAIN_APP;DOCDIR=\&quot;doc/\&quot;;ICONDIR=\&quot;icons/\&quot;;SAMPLESDIR=\&quot;samples/\&quot;;SCRIPTSDIR=\&quot;scripts/\&quot;;SHAREDIR=\&quot;share/\&quot;;TEMPLATEDIR=\&quot;templates/\&quot;;LIBDIR=\&quot;libs/\&quot;;PLUGINDIR=\&quot;plugins\&quot;"
StringPooling="true"
RuntimeLibrary="2"
5397,7 → 5397,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5408,7 → 5408,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5419,7 → 5419,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5430,7 → 5430,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5493,7 → 5493,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5504,7 → 5504,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5515,7 → 5515,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
5526,7 → 5526,7
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;"
CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
16956,7 → 16956,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
16967,7 → 16967,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
16978,7 → 16978,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
16989,7 → 16989,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
17052,7 → 17052,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
17063,7 → 17063,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
17074,7 → 17074,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
17085,7 → 17085,7
<Tool
Name="VCCustomBuildTool"
Description="Uic&apos;ing $(InputFileName)"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;"
CommandLine="$(QT4_DIR)\bin\uic.exe &quot;$(InputPath)&quot; -o &quot;$(InputDir)\ui_$(InputName).h&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(QT4_DIR)\bin\uic.exe"
Outputs="$(InputDir)\ui_$(InputName).h"
/>
20240,6 → 20240,14
>
</File>
<File
RelativePath="..\..\scribus\colormngt\sccolormngtenginefactory.cpp"
>
</File>
<File
RelativePath="..\..\scribus\colormngt\sccolormngtenginefactory.h"
>
</File>
<File
RelativePath="..\..\scribus\colormngt\sccolormngtimplelem.cpp"
>
</File>