From: Jean-Baptiste Mardelle Date: Sun, 26 Sep 2010 13:06:17 +0000 (+0000) Subject: Use ARGB32_Premultiplied for QImages, slightly faster X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c4484387e43ce477e4bbdb9f9b7c2b2bc6d61876;p=kdenlive Use ARGB32_Premultiplied for QImages, slightly faster svn path=/trunk/kdenlive/; revision=4936 --- diff --git a/src/kthumb.cpp b/src/kthumb.cpp index e67425d2..32673492 100644 --- a/src/kthumb.cpp +++ b/src/kthumb.cpp @@ -237,7 +237,7 @@ QPixmap KThumb::getImage(KUrl url, int frame, int width, int height) //static QImage KThumb::getFrame(Mlt::Producer *producer, int framepos, int width, int height) { - QImage p(width, height, QImage::Format_ARGB32); + QImage p(width, height, QImage::Format_ARGB32_Premultiplied); if (producer == NULL) { p.fill(Qt::red); return p; @@ -263,7 +263,7 @@ QImage KThumb::getFrame(Mlt::Producer *producer, int framepos, int width, int he int oh = height; mlt_image_format format = mlt_image_rgb24a; uint8_t *data = frame->get_image(format, ow, oh, 0); - QImage image((uchar *)data, ow, oh, QImage::Format_ARGB32); + QImage image((uchar *)data, ow, oh, QImage::Format_ARGB32_Premultiplied); //mlt_service_unlock(service.get_service()); if (!image.isNull()) { diff --git a/src/renderer.cpp b/src/renderer.cpp index 392189bd..0063d245 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -789,7 +789,7 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int int frame_width = width; int frame_height = imageHeight; uint8_t *data = frame->get_image(format, frame_width, frame_height, 0); - QImage image((uchar *)data, frame_width, frame_height, QImage::Format_ARGB32); + QImage image((uchar *)data, frame_width, frame_height, QImage::Format_ARGB32_Premultiplied); QPixmap pix; if (!image.isNull()) { @@ -1546,7 +1546,7 @@ void Render::showFrame(Mlt::Frame& frame) int width = 0; int height = 0; const uchar* image = frame.get_image(format, width, height); - QImage qimage(width, height, QImage::Format_ARGB32); + QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied); memcpy(qimage.scanLine(0), image, width * height * 4); emit showImageSignal(qimage); }