]> git.sesse.net Git - kdenlive/commitdiff
Use ARGB32_Premultiplied for QImages, slightly faster
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 26 Sep 2010 13:06:17 +0000 (13:06 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 26 Sep 2010 13:06:17 +0000 (13:06 +0000)
svn path=/trunk/kdenlive/; revision=4936

src/kthumb.cpp
src/renderer.cpp

index e67425d2321081fa96a5aeed5776d7bbaa7de0b1..32673492150cef5835fdb4721637fe0e091ff741 100644 (file)
@@ -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()) {
index 392189bd69bac2da3a8a97a14de4ae99ea3b7d87..0063d245c2ae036679e5a6dc555ac9e7b0b7cd17 100644 (file)
@@ -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);
 }