Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5958 → Rev 5959

/branches/Version13x/Scribus/scribus/cmsettings.cpp
27,9 → 27,10
#include "cmsettings.h"
#include "scribusdoc.h"
 
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName) :
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, int intent) :
m_Doc(doc),
m_ProfileName(profileName)
m_ProfileName(profileName),
m_Intent(intent)
{
}
 
/branches/Version13x/Scribus/scribus/scpageoutput.cpp
685,7 → 685,7
useCmyk = true;
QFileInfo fInfo(item->Pfile);
QString ext = fInfo.extension(false);
CMSettings cmsSettings(item->doc(), item->IProfile);
CMSettings cmsSettings(item->doc(), item->IProfile, item->IRender);
scImg.imgInfo.valid = false;
scImg.imgInfo.clipPath = "";
scImg.imgInfo.PDSpathData.clear();
692,7 → 692,7
scImg.imgInfo.layerInfo.clear();
scImg.imgInfo.RequestProps = item->pixm.imgInfo.RequestProps;
scImg.imgInfo.isRequest = item->pixm.imgInfo.isRequest;
scImg.LoadPicture(item->Pfile, cmsSettings, 0, item->UseEmbedded, m_useProfiles, translateImageModeToRequest(imageMode), m_imageRes, &dummy);
scImg.LoadPicture(item->Pfile, cmsSettings, item->UseEmbedded, m_useProfiles, translateImageModeToRequest(imageMode), m_imageRes, &dummy);
if( ext == "eps" || ext == "pdf" || ext == "ps" )
{
imScaleX *= (72.0 / (double) m_imageRes);
/branches/Version13x/Scribus/scribus/pageitem.cpp
3126,8 → 3126,8
if (gsResolution==-1) //If it wasn't supplied, get it from PrefsManager.
gsRes=PrefsManager::instance()->gsResolution();
bool dummy;
CMSettings cms(m_Doc, IProfile);
if (!pixm.LoadPicture(filename, cms, IRender, UseEmbedded, true, ScImage::RGBProof, gsRes, &dummy))
CMSettings cms(m_Doc, IProfile, IRender);
if (!pixm.LoadPicture(filename, cms, UseEmbedded, true, ScImage::RGBProof, gsRes, &dummy))
{
Pfile = fi.absFilePath();
PicAvail = false;
/branches/Version13x/Scribus/scribus/cmsettings.h
39,11 → 39,12
class SCRIBUS_API CMSettings
{
public:
CMSettings(ScribusDoc* doc, const QString& profileName);
CMSettings(ScribusDoc* doc, const QString& profileName, int intent);
~CMSettings();
ScribusDoc* doc() const {return m_Doc;}
QString profileName() const {return m_ProfileName;}
int intent() const {return m_Intent;}
 
bool useColorManagement() const;
 
81,6 → 82,7
protected:
ScribusDoc* m_Doc;
QString m_ProfileName;
int m_Intent;
 
};
 
/branches/Version13x/Scribus/scribus/scimage.h
112,7 → 112,7
 
// Load an image into this ScImage instance
// TODO: document params, split into smaller functions
bool LoadPicture(const QString & fn, const CMSettings& cmSettings, int rend, bool useEmbedded, bool useProf, RequestType requestType, int gsRes, bool *realCMYK = 0);
bool LoadPicture(const QString & fn, const CMSettings& cmSettings, bool useEmbedded, bool useProf, RequestType requestType, int gsRes, bool *realCMYK = 0);
 
ImageInfoRecord imgInfo;
 
/branches/Version13x/Scribus/scribus/customfdialog.cpp
135,8 → 135,8
{
ScImage im;
//No doc to send data anyway, so no doc to get into scimage.
CMSettings cms(0, "");
if (im.LoadPicture(name, cms, 0, false, false, ScImage::Thumbnail, 72, &mode))
CMSettings cms(0, "", 0);
if (im.LoadPicture(name, cms, false, false, ScImage::Thumbnail, 72, &mode))
{
int ix,iy;
if ((im.imgInfo.exifDataValid) && (!im.imgInfo.exifInfo.thumbnail.isNull()))
/branches/Version13x/Scribus/scribus/preview.cpp
701,29 → 701,29
q++;
}
}
CMSettings cms(doc, "");
CMSettings cms(doc, "", 0);
if (flagsVisible["Cyan"]->isChecked())
{
if (GsMinor < 54)
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Cyan.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Cyan.tif", cms, false, false, ScImage::RGBData, 72, &mode);
else
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Cyan.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Cyan.tif", cms, false, false, ScImage::RGBData, 72, &mode);
blendImages(image, im, ScColor(255, 0, 0, 0));
}
if (flagsVisible["Magenta"]->isChecked())
{
if (GsMinor < 54)
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Magenta.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Magenta.tif", cms, false, false, ScImage::RGBData, 72, &mode);
else
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Magenta.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Magenta.tif", cms, false, false, ScImage::RGBData, 72, &mode);
blendImages(image, im, ScColor(0, 255, 0, 0));
}
if (flagsVisible["Yellow"]->isChecked())
{
if (GsMinor < 54)
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Yellow.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Yellow.tif", cms, false, false, ScImage::RGBData, 72, &mode);
else
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Yellow.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Yellow.tif", cms, false, false, ScImage::RGBData, 72, &mode);
blendImages(image, im, ScColor(0, 0, 255, 0));
}
QMap<QString, int>::Iterator sepit;
736,17 → 736,17
fnam = QString(prefsManager->preferencesLocation()+"/sc.tif.s%1.tif").arg(sepit.data());
else
fnam = QString(prefsManager->preferencesLocation()+"/sc.s%1.tif").arg(sepit.data());
im.LoadPicture(fnam, cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(fnam, cms, false, false, ScImage::RGBData, 72, &mode);
blendImages(image, im, doc->PageColors[sepit.key()]);
}
}
if (flagsVisible["Black"]->isChecked())
{
CMSettings cms(doc, "");
CMSettings cms(doc, "", 0);
if (GsMinor < 54)
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Black.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.tif.Black.tif", cms, false, false, ScImage::RGBData, 72, &mode);
else
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Black.tif", cms, 0, false, false, ScImage::RGBData, 72, &mode);
im.LoadPicture(prefsManager->preferencesLocation()+"/sc.Black.tif", cms, false, false, ScImage::RGBData, 72, &mode);
blendImages(image, im, ScColor(0, 0, 0, 255));
}
for( int yi=0; yi < h2; ++yi )
/branches/Version13x/Scribus/scribus/effectsdialog.cpp
37,8 → 37,8
doc = docc;
currentOptions = 0;
bool mode = false;
CMSettings cms(docc, "");
image.LoadPicture(currItem->Pfile, cms, 0, false, false, ScImage::RGBData, 72, &mode);
CMSettings cms(docc, "", 0);
image.LoadPicture(currItem->Pfile, cms, false, false, ScImage::RGBData, 72, &mode);
int ix = image.width();
int iy = image.height();
if ((ix > 220) || (iy > 220))
/branches/Version13x/Scribus/scribus/annot.cpp
355,10 → 355,10
{
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "");
CMSettings cms(view->Doc, "", 0);
if (!item->Pfile.isEmpty())
{
im.LoadPicture(item->Pfile, cms, 0, false, false, ScImage::RGBData, 72);
im.LoadPicture(item->Pfile, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im.qImage());
NiconPrev->setPixmap(pmI1);
IconNR->setEnabled(true);
365,7 → 365,7
}
if (!item->Pfile2.isEmpty())
{
im.LoadPicture(item->Pfile2, cms, 0, false, false, ScImage::RGBData, 72);
im.LoadPicture(item->Pfile2, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im.qImage());
PiconPrev->setPixmap(pmI1);
IconPR->setEnabled(true);
372,7 → 372,7
}
if (!item->Pfile3.isEmpty())
{
im.LoadPicture(item->Pfile3, cms, 0, false, false, ScImage::RGBData, 72);
im.LoadPicture(item->Pfile3, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im.qImage());
RiconPrev->setPixmap(pmI1);
IconRR->setEnabled(true);
1207,8 → 1207,8
{
dirs->set("icon", fileName.left(fileName.findRev("/")));
QPixmap pmI1;
CMSettings cms(view->Doc, "");
item->pixm.LoadPicture(fileName, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(view->Doc, "", 0);
item->pixm.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(item->pixm.qImage());
NiconPrev->setPixmap(pmI1);
item->Pfile = fileName;
1239,8 → 1239,8
dirs->set("icon", fileName.left(fileName.findRev("/")));
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "");
im.LoadPicture(fileName, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(view->Doc, "",0 );
im.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im.qImage());
PiconPrev->setPixmap(pmI1);
item->Pfile2 = fileName;
1263,8 → 1263,8
dirs->set("icon", fileName.left(fileName.findRev("/")));
QPixmap pmI1;
ScImage im;
CMSettings cms(view->Doc, "");
im.LoadPicture(fileName, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(view->Doc, "", 0);
im.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im.qImage());
RiconPrev->setPixmap(pmI1);
item->Pfile3 = fileName;
/branches/Version13x/Scribus/scribus/pdflib.cpp
4286,8 → 4286,8
}
if (!ite->Pfile2.isEmpty())
{
CMSettings cms(ite->doc(), "");
img.LoadPicture(ite->Pfile2, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(ite->doc(), "", 0);
img.LoadPicture(ite->Pfile2, cms, false, false, ScImage::RGBData, 72);
QByteArray im;
im = img3.getAlpha(ite->Pfile2, true, false);
IconOb += !im.isEmpty() ? 3 : 2;
4296,8 → 4296,8
}
if (!ite->Pfile3.isEmpty())
{
CMSettings cms(ite->doc(), "");
img2.LoadPicture(ite->Pfile3, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(ite->doc(), "", 0);
img2.LoadPicture(ite->Pfile3, cms, false, false, ScImage::RGBData, 72);
QByteArray im;
im = img3.getAlpha(ite->Pfile3, true, false);
IconOb += !im.isEmpty() ? 3 : 2;
4751,21 → 4751,21
afl = Options.Resolution;
if (ext == "pdf")
{
CMSettings cms(c->doc(), Profil);
CMSettings cms(c->doc(), Profil, Intent);
if (Options.UseRGB)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBProof, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBProof, afl);
else
{
#ifdef HAVE_CMS
if ((doc.HasCMS) && (Options.UseProfiles2))
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBData, afl);
else
{
#endif
if (Options.isGrayscale)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBData, afl);
else
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::CMYKData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::CMYKData, afl);
#ifdef HAVE_CMS
}
#endif
4806,21 → 4806,21
f.close();
if (found)
{
CMSettings cms(c->doc(), Profil);
CMSettings cms(c->doc(), Profil, Intent);
if (Options.UseRGB)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBProof, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBProof, afl);
else
{
#ifdef HAVE_CMS
if ((doc.HasCMS) && (Options.UseProfiles2))
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBData, afl);
else
{
#endif
if (Options.isGrayscale)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBData, afl);
else
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::CMYKData, afl);
img.LoadPicture(fn, cms, Embedded, true, ScImage::CMYKData, afl);
#ifdef HAVE_CMS
}
#endif
4842,21 → 4842,21
img.imgInfo.layerInfo.clear();
img.imgInfo.RequestProps = c->pixm.imgInfo.RequestProps;
img.imgInfo.isRequest = c->pixm.imgInfo.isRequest;
CMSettings cms(c->doc(), Profil);
CMSettings cms(c->doc(), Profil, Intent);
if (Options.UseRGB)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBProof, 72, &realCMYK);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBProof, 72, &realCMYK);
else
{
#ifdef HAVE_CMS
if ((doc.HasCMS) && (Options.UseProfiles2))
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RawData, 72, &realCMYK);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RawData, 72, &realCMYK);
else
{
#endif
if (Options.isGrayscale)
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::RGBData, 72, &realCMYK);
img.LoadPicture(fn, cms, Embedded, true, ScImage::RGBData, 72, &realCMYK);
else
img.LoadPicture(fn, cms, Intent, Embedded, true, ScImage::CMYKData, 72, &realCMYK);
img.LoadPicture(fn, cms, Embedded, true, ScImage::CMYKData, 72, &realCMYK);
#ifdef HAVE_CMS
}
#endif
/branches/Version13x/Scribus/scribus/scimage.cpp
1374,7 → 1374,7
}
 
bool ScImage::LoadPicture(const QString & fn, const CMSettings& cmSettings,
int rend, bool useEmbedded, bool useProf,
bool useEmbedded, bool useProf,
RequestType requestType, int gsRes, bool *realCMYK)
{
// requestType - 0: CMYK, 1: RGB, 2: RGB Proof 3 : RawData, 4: Thumbnail
1508,7 → 1508,7
break;
case RGBData: // RGB
if (isCMYK)
xform = cmsCreateTransform(inputProf, inputProfFormat, cmSettings.monitorProfile(), TYPE_RGBA_8, rend, 0);
xform = cmsCreateTransform(inputProf, inputProfFormat, cmSettings.monitorProfile(), TYPE_RGBA_8, cmSettings.intent(), 0);
break;
case RGBProof: // RGB Proof
{
1519,10 → 1519,10
if (cmSettings.doSoftProofing())
xform = cmsCreateProofingTransform(inputProf, inputProfFormat,
cmSettings.monitorProfile(), TYPE_BGRA_8, cmSettings.printerProfile(),
rend, INTENT_RELATIVE_COLORIMETRIC, cmsFlags);
cmSettings.intent(), INTENT_RELATIVE_COLORIMETRIC, cmsFlags);
else
xform = cmsCreateTransform(inputProf, inputProfFormat,
cmSettings.monitorProfile(), TYPE_BGRA_8, rend, cmsFlags);
cmSettings.monitorProfile(), TYPE_BGRA_8, cmSettings.intent(), cmsFlags);
}
break;
case RawData: // no Conversion just raw Data
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
496,8 → 496,8
ob.appendChild(cl);
gr.appendChild(ob);
ScImage img;
CMSettings cms(m_Doc, Item->IProfile);
img.LoadPicture(Item->Pfile, cms, Item->IRender, Item->UseEmbedded, true, ScImage::RGBProof, 72);
CMSettings cms(m_Doc, Item->IProfile, Item->IRender);
img.LoadPicture(Item->Pfile, cms, Item->UseEmbedded, true, ScImage::RGBProof, 72);
img.applyEffect(Item->effectsInUse, m_Doc->PageColors, true);
QFileInfo fi = QFileInfo(Item->Pfile);
img.qImage().save(fi.baseName()+".png", "PNG");
/branches/Version13x/Scribus/scribus/scpreview.cpp
554,8 → 554,8
pS->scale(1, -1);
}
ScImage pixm;
CMSettings cms(0, "");
pixm.LoadPicture(OB.Pfile, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(0, "", 0);
pixm.LoadPicture(OB.Pfile, cms, false, false, ScImage::RGBData, 72);
pS->scale(OB.LocalScX, OB.LocalScY);
pS->translate(static_cast<int>(OB.LocalX), static_cast<int>(OB.LocalY));
QImage img(pixm.qImage());
/branches/Version13x/Scribus/scribus/pslib.cpp
799,8 → 799,8
image.imgInfo.layerInfo.clear();
image.imgInfo.RequestProps = c->pixm.imgInfo.RequestProps;
image.imgInfo.isRequest = c->pixm.imgInfo.isRequest;
CMSettings cms(c->doc(), Prof);
image.LoadPicture(fn, cms, 0, UseEmbedded, UseProf, ScImage::CMYKData, 300, &dummy);
CMSettings cms(c->doc(), Prof, c->IRender);
image.LoadPicture(fn, cms, UseEmbedded, UseProf, ScImage::CMYKData, 300, &dummy);
image.applyEffect(c->effectsInUse, colorsToUse, true);
imgArray = image.ImageToCMYK_PS(-1, true);
if (CompAvail)
876,8 → 876,8
image.imgInfo.layerInfo.clear();
image.imgInfo.RequestProps = c->pixm.imgInfo.RequestProps;
image.imgInfo.isRequest = c->pixm.imgInfo.isRequest;
CMSettings cms(c->doc(), Prof);
image.LoadPicture(fn, cms, 0, UseEmbedded, UseProf, ScImage::CMYKData, 300, &dummy);
CMSettings cms(c->doc(), Prof, c->IRender);
image.LoadPicture(fn, cms, UseEmbedded, UseProf, ScImage::CMYKData, 300, &dummy);
image.applyEffect(c->effectsInUse, colorsToUse, true);
int w = image.width();
int h = image.height();
/branches/Version13x/Scribus/scribus/picsearch.cpp
120,8 → 120,8
{
QPixmap pm;
ScImage im;
CMSettings cms(0, "");
im.LoadPicture(Bild, cms, 0, false, false, ScImage::RGBData, 72);
CMSettings cms(0, "", 0);
im.LoadPicture(Bild, cms, false, false, ScImage::RGBData, 72);
QImage im2;
if ((im.width() > 200) || (im.height() > 200))
{