MCPcopy Create free account
hub / github.com/KDE/kdiff3 / pixCombiner

Function pixCombiner

src/PixMapUtils.cpp:61–72  ·  view source on GitHub ↗

Copy pm2 onto pm1, but preserve the alpha value from pm1 where pm2 is transparent. Opactiy controls wheather or not pm1 will show through. */

Source from the content-addressed store, hash-verified

59 Opactiy controls wheather or not pm1 will show through.
60*/
61QPixmap pixCombiner(const QPixmap* pm1, const QPixmap* pm2, const qreal inOpacity = 1)
62{
63 QImage img1 = pm1->toImage().convertToFormat(QImage::Format_ARGB32);
64 QImage img2 = pm2->toImage().convertToFormat(QImage::Format_ARGB32);
65 QPainter painter(&img1);
66
67 painter.setOpacity(inOpacity);
68 painter.drawImage(0, 0, img2);
69 painter.end();
70
71 return QPixmap::fromImage(img1);
72}
73
74void initPixmaps(const QColor& newest, const QColor& oldest, const QColor& middle, const QColor& notThere)
75{

Callers 1

initPixmapsFunction · 0.85

Calls 1

endMethod · 0.80

Tested by

no test coverage detected