]> git.sesse.net Git - kdenlive/commitdiff
Merge branch 'master' of git://anongit.kde.org/kdenlive
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Jan 2012 09:05:04 +0000 (10:05 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Jan 2012 09:05:04 +0000 (10:05 +0100)
src/colorcorrection/vectorscopegenerator.cpp
src/utils/resourcewidget.cpp
src/utils/resourcewidget.h

index 4ee5eccc1c41b71434b101fa19d0f11a9a8e51b2..052022500894eb19f80fed91965b4439a421effe 100644 (file)
@@ -137,12 +137,13 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
     double /*y,*/ u, v;
     QPoint pt;
     QRgb px;
+    int bpp = image.depth() / 8;
 
-    const int stepsize = 4*accelFactor;
+    const int stepsize = bpp * accelFactor;
 
     // Just an average for the number of image pixels per scope pixel.
     // 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*(image.bytesPerLine()*image.height())/scope.size().width()/scope.size().height()/accelFactor;
+    double avgPxPerPx = (double) bpp*(image.bytesPerLine()*image.height())/scope.size().width()/scope.size().height()/accelFactor;
 
     for (int i = 0; i < (image.bytesPerLine()*image.height()); i+= stepsize) {
         QRgb *col = (QRgb *) bits;
index 39c8ec5263eec0f17f8c59c06725ea870ad98233..80fbc18ebef50334bae34a15b0eb5690c381cc3d 100644 (file)
@@ -42,7 +42,7 @@
 #include <KRun>
 #include <KPixmapSequence>
 #include <KPixmapSequenceOverlayPainter>
-
+#include <KFileItem>
 
 #ifdef USE_NEPOMUK
 #if KDE_IS_VERSION(4,6,0)
@@ -52,7 +52,6 @@
 #include <Nepomuk/Vocabulary/NIE>
 #include <Nepomuk/Vocabulary/NCO>
 #include <Nepomuk/Vocabulary/NDO>
-#include <kfileitem.h>
 #endif
 #endif
 
@@ -206,25 +205,6 @@ void ResourceWidget::slotPlaySound()
 }
 
 
-void ResourceWidget::slotForcePlaySound(bool play)
-{
-    /*
-    if (m_service != FREESOUND) return;
-    m_previewProcess->close();
-    if (m_currentPreview.isEmpty()) return;
-    if (play)
-        m_previewProcess->start("ffplay", QStringList() << m_currentPreview << "-nodisp");
-    */
-}
-
-void ResourceWidget::slotPreviewStatusChanged(QProcess::ProcessState state)
-{
-    /*if (state == QProcess::NotRunning)
-        button_preview->setText(i18n("Preview"));
-    else 
-        button_preview->setText(i18n("Stop"));*/
-}
-
 void ResourceWidget::slotSaveItem(const QString originalUrl)
 {
     //if (m_currentUrl.isEmpty()) return;
index 71253c763a57d077df8a204e826f5f14d850dedc..b2021e0c175d19692302d17ef3b548acd7af07a4 100644 (file)
@@ -46,8 +46,6 @@ private slots:
     void slotStartSearch(int page = 0);
     void slotUpdateCurrentSound();
     void slotPlaySound();
-    void slotForcePlaySound(bool play);
-    void slotPreviewStatusChanged(QProcess::ProcessState state);
     void slotDisplayMetaInfo(QMap <QString, QString> metaInfo);
     void slotSaveItem(const QString originalUrl = QString());
     void slotOpenUrl(const QString &url);