Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 5592 → Rev 5593

/branches/Version13x/Scribus/scribus/scimage.h
45,11 → 45,12
#include <tiffio.h>
#endif
 
class SCRIBUS_API ScImage : public QImage
class SCRIBUS_API ScImage : private QImage
{
public:
ScImage();
ScImage(const QImage & image);
ScImage(const ScImage & image);
ScImage( int width, int height );
~ScImage();
 
93,6 → 94,14
};
void initialize();
 
const QImage& qImage();
QImage smoothScale(int h, int w, QImage::ScaleMode mode = ScaleFree) const;
int height() const { return QImage::height(); }
int width() const { return QImage::width(); }
bool hasAlpha() const { return QImage::hasAlphaBuffer(); }
// Routines for PDF/PS output of images
QByteArray ImageToArray();
QByteArray ImageToGray();
/branches/Version13x/Scribus/scribus/customfdialog.cpp
158,7 → 158,7
im.smoothScale(qRound(im.width() / sy), qRound(im.height() / sy));
}
else
im2 = im.copy();
im2 = im.qImage(); // no need to copy
QPainter p;
pixmap()->fill(white);
p.begin(pixmap());
/branches/Version13x/Scribus/scribus/preview.cpp
617,8 → 617,11
return ret;
}
 
void PPreview::blendImages(QImage &target, ScImage &source, ScColor col)
// this should move to scimage.cpp!
void PPreview::blendImages(QImage &target, ScImage &scsource, ScColor col)
{
QImage source = scsource.qImage(); // FIXME: this will not work once qImage always returns ARGB!
//FIXME: if source and target have different sizesomething went wrong.
// eg. loadPicture() failed and returned a 1x1 image
int h = QMIN(target.height(),source.height());
/branches/Version13x/Scribus/scribus/effectsdialog.cpp
373,10 → 373,10
{
if (tim.elapsed() < 50)
return;
ScImage im = image.copy();
ScImage im(image);
saveValues();
im.applyEffect(effectsList, doc->PageColors, false);
pixmapLabel1->setPixmap( im );
pixmapLabel1->setPixmap( im.qImage() );
tim.start();
}
 
/branches/Version13x/Scribus/scribus/annot.cpp
356,7 → 356,7
if (!item->Pfile.isEmpty())
{
im.LoadPicture(item->Pfile, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
pmI1.convertFromImage(im.qImage());
NiconPrev->setPixmap(pmI1);
IconNR->setEnabled(true);
}
363,7 → 363,7
if (!item->Pfile2.isEmpty())
{
im.LoadPicture(item->Pfile2, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
pmI1.convertFromImage(im.qImage());
PiconPrev->setPixmap(pmI1);
IconPR->setEnabled(true);
}
370,7 → 370,7
if (!item->Pfile3.isEmpty())
{
im.LoadPicture(item->Pfile3, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
pmI1.convertFromImage(im.qImage());
RiconPrev->setPixmap(pmI1);
IconRR->setEnabled(true);
}
1204,15 → 1204,13
{
dirs->set("icon", fileName.left(fileName.findRev("/")));
QPixmap pmI1;
ScImage im;
im.LoadPicture(fileName, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
item->pixm.LoadPicture(fileName, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(item->pixm.qImage());
NiconPrev->setPixmap(pmI1);
item->Pfile = fileName;
item->PicAvail = true;
item->pixm = im.copy();
int w = im.width();
int h = im.height();
int w = item->pixm.width();
int h = item->pixm.height();
double sw = item->width() / w;
double sh = item->height() / h;
double sc = QMIN(sw,sh);
1238,7 → 1236,7
QPixmap pmI1;
ScImage im;
im.LoadPicture(fileName, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
pmI1.convertFromImage(im.qImage());
PiconPrev->setPixmap(pmI1);
item->Pfile2 = fileName;
IconPR->setEnabled(true);
1261,7 → 1259,7
QPixmap pmI1;
ScImage im;
im.LoadPicture(fileName, "", 0, false, false, ScImage::RGBData, 72);
pmI1.convertFromImage(im);
pmI1.convertFromImage(im.qImage());
RiconPrev->setPixmap(pmI1);
item->Pfile3 = fileName;
IconRR->setEnabled(true);
/branches/Version13x/Scribus/scribus/pdflib.cpp
1620,7 → 1620,7
Seite.AObjects.clear();
if (Options.Thumbnails)
{
ScImage img = pm.convertToImage();
ScImage img(pm.convertToImage());
QByteArray array = img.ImageToArray();
if ((Options.Compress) && (CompAvail))
array = CompressArray(&array);
4117,7 → 4117,7
{
if (!ite->Pfile.isEmpty())
{
IconOb += ite->pixm.hasAlphaBuffer() ? 3 : 2;
IconOb += ite->pixm.hasAlpha() ? 3 : 2;
PutDoc("/I "+QString::number(ObjCounter+IconOb-1)+" 0 R ");
}
if (!ite->Pfile2.isEmpty())
/branches/Version13x/Scribus/scribus/scimage.cpp
60,11 → 60,20
return s;
}
 
 
ScImage::ScImage(const QImage & image) : QImage(image)
{
initialize();
}
 
 
// ScImage will use implicit sharing:
ScImage::ScImage(const ScImage & image) : QImage(image.copy())
{
initialize();
}
 
 
ScImage::ScImage() : QImage()
{
initialize();
75,6 → 84,17
initialize();
}
 
const QImage& ScImage::qImage()
{
return *this;
}
 
QImage ScImage::smoothScale(int h, int w, QImage::ScaleMode mode) const
{
return QImage::smoothScale(h,w,mode);
}
 
 
void ScImage::initialize()
{
imgInfo.xres = 72;
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
1726,8 → 1726,8
p->save();
p->scale(LocalScX, LocalScY);
p->translate(static_cast<int>(LocalX*LocalScX), static_cast<int>(LocalY*LocalScY));
if (!pixm.isNull())
p->drawImage(&pixm);
if (pixm.width() > 0 && pixm.height() > 0)
p->drawImage(&pixm.qImage());
p->restore();
}
if (itemText.count() != 0)
/branches/Version13x/Scribus/scribus/pageitem_imageframe.cpp
130,7 → 130,7
p->scale(LocalScX, LocalScY);
if (pixm.imgInfo.lowResType != 0)
p->scale(pixm.imgInfo.lowResScale, pixm.imgInfo.lowResScale);
p->drawImage(&pixm);
p->drawImage(&pixm.qImage());
}
}
p->restore();
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
507,7 → 507,7
img.LoadPicture(Item->Pfile, Item->IProfile, Item->IRender, Item->UseEmbedded, true, ScImage::RGBProof, 72);
img.applyEffect(Item->effectsInUse, Item->document()->PageColors, true);
QFileInfo fi = QFileInfo(Item->Pfile);
img.save(fi.baseName()+".png", "PNG");
img.qImage().save(fi.baseName()+".png", "PNG");
ob = docu->createElement("image");
ob.setAttribute("clip-path", "url(#"+Clipi+IToStr(ClipCount)+")");
ob.setAttribute("xlink:href", fi.baseName()+".png");
/branches/Version13x/Scribus/scribus/scpreview.cpp
549,7 → 549,7
pixm.LoadPicture(OB.Pfile, "", 0, false, false, ScImage::RGBData, 72);
pS->scale(OB.LocalScX, OB.LocalScY);
pS->translate(static_cast<int>(OB.LocalX), static_cast<int>(OB.LocalY));
pS->drawImage(&pixm);
pS->drawImage(&pixm.qImage());
pS->restore();
}
}
/branches/Version13x/Scribus/scribus/picsearch.cpp
121,17 → 121,18
QPixmap pm;
ScImage im;
im.LoadPicture(Bild, "", 0, false, false, ScImage::RGBData, 72);
QImage im2;
if ((im.width() > 200) || (im.height() > 200))
{
QImage im2;
double sx = im.width() / 200.0;
double sy = im.height() / 200.0;
im2 = sy < sx ?
im2 = im.smoothScale(qRound(im.width() / sx), qRound(im.height() / sx)) :
im2 = im.smoothScale(qRound(im.width() / sy), qRound(im.height() / sy));
im = im2;
im2.detach();
}
pm.convertFromImage(im);
else {
im2 = im.qImage();
}
pm.convertFromImage(im2);
PixmapLabel1->setPixmap(pm);
}