Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 14407 → Rev 14408

/trunk/Scribus/scribus/util.cpp
451,7 → 451,7
double savScale = view->scale();
view->setScale(1.0);
currentDoc->RePos = true;
QImage pgPix(10, 10, QImage::Format_ARGB32);
QImage pgPix(10, 10, QImage::Format_ARGB32_Premultiplied);
QRect rd; // = QRect(0,0,9,9);
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
for (int azz=0; azz<currentDoc->MasterItems.count(); ++azz)
/trunk/Scribus/scribus/chartablemodel.cpp
70,7 → 70,7
int size = baseSize + qRound(-face.descent() * baseSize) + 1;
double ww = baseSize - face.glyphWidth(gl, baseSize);
 
QImage pix(baseSize, size, QImage::Format_ARGB32);
QImage pix(baseSize, size, QImage::Format_ARGB32_Premultiplied);
ScPainter *p = new ScPainter(&pix, baseSize, size);
p->clear();
FPointArray gly = face.glyphOutline(gl, 1);
/trunk/Scribus/scribus/scprintengine_gdi.cpp
160,7 → 160,7
// Setup image
imagew = clipw * scale;
imageh = cliph * scale;
*image = QImage( imagew, imageh, QImage::Format_ARGB32 );
*image = QImage( imagew, imageh, QImage::Format_ARGB32_Premultiplied );
if (image->width() <= 0 || image->height() <= 0)
return false;
 
/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
250,7 → 250,7
w = s * (ts.length()+1);
if (h < 1)
h = s;
QImage pm(w, h, QImage::Format_ARGB32);
QImage pm(w, h, QImage::Format_ARGB32_Premultiplied);
pen_x = 0;
ymax = 0.0;
ScPainter *p = new ScPainter(&pm, pm.width(), pm.height());
/trunk/Scribus/scribus/stencilreader.cpp
1110,7 → 1110,7
GrW = ScCLocale::toDoubleC(dims.attribute("w"), 50.0) + 10;
GrH = ScCLocale::toDoubleC(dims.attribute("h"), 50.0) + 10;
pmmax = 60 / qMax(GrW, GrH);
tmp = QImage(static_cast<int>(GrW), static_cast<int>(GrH), QImage::Format_ARGB32);
tmp = QImage(static_cast<int>(GrW), static_cast<int>(GrH), QImage::Format_ARGB32_Premultiplied);
pS = new ScPainter(&tmp, tmp.width(), tmp.height());
pS->clear();
pS->translate(5, 5);
/trunk/Scribus/scribus/scribusXml.cpp
2114,7 → 2114,7
writer.writeAttribute("Version", QString(VERSION));
 
double scaleI = 50.0 / qMax(selectionWidth, selectionHeight);
QImage retImg = QImage(50, 50, QImage::Format_ARGB32);
QImage retImg = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
retImg.fill( qRgba(0, 0, 0, 0) );
ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
painter->setZoomFactor(scaleI);
/trunk/Scribus/scribus/canvas.cpp
882,7 → 882,7
// qDebug() << "Canvas::drawContents" << clipx << clipy << clipw << cliph<<m_viewMode.forceRedraw<<m_viewMode.operItemSelecting;
uint docPagesCount=m_doc->Pages->count();
ScPainter *painter=0;
QImage img = QImage(clipw, cliph, QImage::Format_ARGB32);
QImage img = QImage(clipw, cliph, QImage::Format_ARGB32_Premultiplied);
painter = new ScPainter(&img, img.width(), img.height(), 1.0, 0);
painter->clear(palette().color(QPalette::Window));
painter->newPath();
/trunk/Scribus/scribus/pageitem_pathtext.cpp
60,7 → 60,7
 
void PageItem_PathText::layout()
{
QImage pgPix(10, 10, QImage::Format_ARGB32);
QImage pgPix(10, 10, QImage::Format_ARGB32_Premultiplied);
QRectF rd; // = QRect(0,0,9,9);
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
DrawObj(painter, rd);
/trunk/Scribus/scribus/scpainter.cpp
678,7 → 678,7
brushm = QBrush(*m_maskPattern->getPattern());
brushm.setTransform(qmatrix);
}
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterM;
painterM.begin(&tmpImgM);
painterM.setWorldTransform(painter.worldTransform());
686,7 → 686,7
painterM.setRenderHint(QPainter::SmoothPixmapTransform, true);
painterM.fillPath(painter.clipPath(), brushm);
painterM.end();
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterO;
painterO.begin(&tmpImgO);
painterO.setWorldTransform(painter.worldTransform());
1614,7 → 1614,7
brushm = QBrush(*m_maskPattern->getPattern());
brushm.setTransform(qmatrix);
}
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterM;
painterM.begin(&tmpImgM);
painterM.setWorldTransform(painter.worldTransform());
1622,7 → 1622,7
painterM.setRenderHint(QPainter::SmoothPixmapTransform, true);
painterM.fillPath(m_path, brushm);
painterM.end();
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterO;
painterO.begin(&tmpImgO);
painterO.setWorldTransform(painter.worldTransform());
1769,7 → 1769,7
brushm = QBrush(*m_maskPattern->getPattern());
brushm.setTransform(qmatrix);
}
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterM;
painterM.begin(&tmpImgM);
painterM.setWorldTransform(painter.worldTransform());
1777,7 → 1777,7
painterM.setRenderHint(QPainter::SmoothPixmapTransform, true);
painterM.fillPath(m_path, brushm);
painterM.end();
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterO;
painterO.begin(&tmpImgO);
painterO.setWorldTransform(painter.worldTransform());
1890,7 → 1890,7
brushm = QBrush(*m_maskPattern->getPattern());
brush.setTransform(qmatrix);
}
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterM;
painterM.begin(&tmpImgM);
painterM.setWorldTransform(painter.worldTransform());
1898,7 → 1898,7
painterM.setRenderHint(QPainter::SmoothPixmapTransform, true);
painterM.fillPath(m_path, brushm);
painterM.end();
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterO;
painterO.begin(&tmpImgO);
painterO.setWorldTransform(painter.worldTransform());
2167,7 → 2167,7
qmatrix.shear(-mask_gradientSkew, 0);
qmatrix.translate(-x1, -y1);
}
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgM = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterM;
painterM.begin(&tmpImgM);
painterM.setWorldTransform(painter.worldTransform());
2177,7 → 2177,7
brushm.setTransform(qmatrix);
painterM.fillPath(painter.clipPath(), brushm);
painterM.end();
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32);
QImage tmpImgO = QImage(m_image->width(), m_image->height(), QImage::Format_ARGB32_Premultiplied);
QPainter painterO;
painterO.begin(&tmpImgO);
painterO.setWorldTransform(painter.worldTransform());
/trunk/Scribus/scribus/pageitem.cpp
1911,7 → 1911,7
 
QImage PageItem::DrawObj_toImage(QList<PageItem*> &emG)
{
QImage retImg = QImage(qRound(gWidth), qRound(gHeight), QImage::Format_ARGB32);
QImage retImg = QImage(qRound(gWidth), qRound(gHeight), QImage::Format_ARGB32_Premultiplied);
// retImg.fill( qRgba(255, 255, 255, 0) );
retImg.fill( qRgba(0, 0, 0, 0) );
ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
/trunk/Scribus/scribus/scribusview.cpp
2939,7 → 2939,7
setScale(1.0);
m_canvas->m_viewMode.previewMode = true;
m_canvas->m_viewMode.forceRedraw = true;
pm = QImage(clipw, cliph, QImage::Format_ARGB32);
pm = QImage(clipw, cliph, QImage::Format_ARGB32_Premultiplied);
ScPainter *painter = new ScPainter(&pm, pm.width(), pm.height(), 1.0, 0);
painter->clear(Doc->papColor);
painter->translate(-clipx, -clipy);
2991,7 → 2991,7
int cliph = qRound(Doc->DocPages.at(Nr)->height() * sc);
if ((clipw > 0) && (cliph > 0))
{
im = QImage(clipw, cliph, QImage::Format_ARGB32);
im = QImage(clipw, cliph, QImage::Format_ARGB32_Premultiplied);
if (!im.isNull())
{
double oldScale = m_canvas->scale();
/trunk/Scribus/scribus/ui/cpalette.cpp
332,7 → 332,7
namedGradientStroke->addItem( tr("Custom"));
for (QMap<QString, VGradient>::Iterator it = gradientList->begin(); it != gradientList->end(); ++it)
{
QImage pixm(48, 12, QImage::Format_ARGB32);
QImage pixm(48, 12, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
pb.begin(&pixm);
/trunk/Scribus/scribus/ui/colorchart.cpp
59,7 → 59,7
QPainter p2;
p.begin(this);
p.setClipRect(e->rect());
QImage tmp = QImage(width(), height(), QImage::Format_ARGB32);
QImage tmp = QImage(width(), height(), QImage::Format_ARGB32_Premultiplied);
p2.begin(&tmp);
p2.drawPixmap(0, 0, pmx);
if (doDrawMark)
93,7 → 93,7
{
int xSize = width();
int ySize = height();
QImage image(xSize, ySize, QImage::Format_ARGB32);
QImage image(xSize, ySize, QImage::Format_ARGB32_Premultiplied);
QColor color;
int x;
int y;
/trunk/Scribus/scribus/ui/arrowchooser.cpp
35,9 → 35,10
addItem(CommonStrings::tr_None);
for (int a = 0; a < arrowStyles->count(); ++a)
{
QImage image(22, 22, QImage::Format_ARGB32);
QImage image(22, 22, QImage::Format_ARGB32_Premultiplied);
image.fill(0);
ScPainter *painter = new ScPainter(&image, 22, 22);
painter->clear();
// painter->clear();
painter->setBrush(qRgb(0, 0, 0));
painter->setPen(qRgb(0, 0, 0));
painter->setFillMode(1);
62,7 → 63,7
painter->drawPolyLine();
painter->end();
delete painter;
int wi = image.width();
/* int wi = image.width();
int hi = image.height();
for( int yi=0; yi < hi; ++yi )
{
73,7 → 74,7
(*s) &= 0x00ffffff;
s++;
}
}
} */
QPixmap Ico;
Ico=QPixmap::fromImage(image);
addItem(Ico, arrowStyles->at(a).name);
/trunk/Scribus/scribus/ui/dasheditor.cpp
60,7 → 60,7
if (onlyselect)
StopM.clear();
int pWidth = width()-20;
QImage pixm(pWidth, 10, QImage::Format_ARGB32);
QImage pixm(pWidth, 10, QImage::Format_ARGB32_Premultiplied);
ScPainter *p = new ScPainter(&pixm, pWidth, 10);
p->clear(QColor(128, 128, 128));
double startX = 0.0;
/trunk/Scribus/scribus/ui/extimageprops.cpp
225,7 → 225,7
{
for (it = info->PDSpathData.begin(); it != info->PDSpathData.end(); ++it)
{
QImage pixm(40, 40, QImage::Format_ARGB32);
QImage pixm(40, 40, QImage::Format_ARGB32_Premultiplied);
ScPainter *p = new ScPainter(&pixm, 40, 40);
p->clear();
p->translate(3.0, 3.0);
/trunk/Scribus/scribus/ui/gradientpreview.cpp
81,7 → 81,7
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
StopM.append(center);
}
QImage pixm(width()-20, 37, QImage::Format_ARGB32);
QImage pixm(width()-20, 37, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
pb.begin(&pixm);
/trunk/Scribus/scribus/ui/autoformbuttongroup.cpp
1231,7 → 1231,7
}
}
}
QImage Ico(32, 32, QImage::Format_ARGB32);
QImage Ico(32, 32, QImage::Format_ARGB32_Premultiplied);
Ico.fill(0);
int count = 0;
qreal* AutoShapes;
/trunk/Scribus/scribus/ui/transparencypalette.cpp
141,7 → 141,7
namedGradient->addItem( tr("Custom"));
for (QMap<QString, VGradient>::Iterator it = gradientList->begin(); it != gradientList->end(); ++it)
{
QImage pixm(48, 12, QImage::Format_ARGB32);
QImage pixm(48, 12, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
pb.begin(&pixm);
/trunk/Scribus/scribus/ui/charzoom.cpp
21,7 → 21,7
setMaximumSize(sizex, sizey);
pixm = QPixmap(size, size);
QImage pix(size, size, QImage::Format_ARGB32);
QImage pix(size, size, QImage::Format_ARGB32_Premultiplied);
ScPainter *p = new ScPainter(&pix, size, size);
p->clear();
pixm.fill(Qt::white);
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
2118,7 → 2118,7
currItem->AutoName = false;
m_Doc->DoDrawing = true;
QImage tmpImg = currItem->DrawObj_toImage();
QImage retImg = QImage(qRound(patternX2 - patternX1), qRound(patternY2 - patternY1), QImage::Format_ARGB32);
QImage retImg = QImage(qRound(patternX2 - patternX1), qRound(patternY2 - patternY1), QImage::Format_ARGB32_Premultiplied);
retImg.fill( qRgba(255, 255, 255, 0) );
QPainter p;
p.begin(&retImg);
/trunk/Scribus/scribus/scpreview.cpp
93,7 → 93,7
double GrW = ScCLocale::toDoubleC(elem.attribute("W"));
double GrH = ScCLocale::toDoubleC(elem.attribute("H"));
double pmmax = 60 / qMax(GrW+50, GrH+50);
QImage tmp = QImage(static_cast<int>(GrW)+50, static_cast<int>(GrH)+50, QImage::Format_ARGB32);
QImage tmp = QImage(static_cast<int>(GrW)+50, static_cast<int>(GrH)+50, QImage::Format_ARGB32_Premultiplied);
tmp.fill( qRgba(255, 255, 255, 0) );
ScPainter *pS = new ScPainter(&tmp, tmp.width(), tmp.height(), 1.0, 0);
pS->beginLayer(1.0, 0);