]> git.sesse.net Git - kdenlive/commitdiff
fix Qt 4.5 compile
authorTill Theato <root@ttill.de>
Sat, 17 Jul 2010 18:18:58 +0000 (18:18 +0000)
committerTill Theato <root@ttill.de>
Sat, 17 Jul 2010 18:18:58 +0000 (18:18 +0000)
svn path=/trunk/kdenlive/; revision=4589

src/vectorscope.cpp

index 1e028c2103b246ef640a8b25bfa0ac3369ee3a47..6c6e0aab590f2457744ebcc65b947d8fb85f6a57 100644 (file)
@@ -252,12 +252,13 @@ void Vectorscope::calculateScope()
     QRgb px;
 
     // Just an average for the number of image pixels per scope pixel.
-    double avgPxPerPx = (double) 4*img.byteCount()/scope.size().width()/scope.size().height()/skipPixels;
+    // NOTE: byteCount() has to be replaced by (img.bytesPerLine()*img.height()) for Qt 4.5 to compile, see: http://doc.trolltech.org/4.6/qimage.html#bytesPerLine
+    double avgPxPerPx = (double) 4*(img.bytesPerLine()*img.height())/scope.size().width()/scope.size().height()/skipPixels;
     qDebug() << "Expecting " << avgPxPerPx << " pixels per pixel.";
 
     const QRect scopeRect(QPoint(0,0), scope.size());
 
-    for (int i = 0; i < img.byteCount(); i+= stepsize) {
+    for (int i = 0; i < (img.bytesPerLine()*img.height()); i+= stepsize) {
         QRgb *col = (QRgb *) bits;
 
         r = qRed(*col);