]> git.sesse.net Git - kdenlive/blobdiff - src/colorcorrection/waveformgenerator.cpp
Fix includes
[kdenlive] / src / colorcorrection / waveformgenerator.cpp
index a1d2162f8dcf38fd985fdf6186222a16e660a261..4c60518de93752b52ba0252f2ca970461e8cb776 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <cmath>
 
-#include <QColor>
 #include <QImage>
 #include <QPainter>
 #include <QSize>
@@ -29,7 +28,7 @@ WaveformGenerator::~WaveformGenerator()
 }
 
 QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QImage &image, WaveformGenerator::PaintMode paintMode,
-                                            const bool &drawAxis, WaveformGenerator::Rec rec, const uint &accelFactor)
+                                            bool drawAxis, WaveformGenerator::Rec rec, uint accelFactor)
 {
     Q_ASSERT(accelFactor >= 1);
 
@@ -57,7 +56,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
         const uint byteCount = iw*ih;
 
         uint waveValues[waveformSize.width()][waveformSize.height()];
-        for (int i = 0; i < waveformSize.width(); i++) {
+        for (int i = 0; i < waveformSize.width(); ++i) {
             for (int j = 0; j < waveformSize.height(); j++) {
                 waveValues[i][j] = 0;
             }
@@ -110,7 +109,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
 
         switch (paintMode) {
         case PaintMode_Green:
-            for (int i = 0; i < waveformSize.width(); i++) {
+            for (int i = 0; i < waveformSize.width(); ++i) {
                 for (int j = 0; j < waveformSize.height(); j++) {
                     // Logarithmic scale. Needs fine tuning by hand, but looks great.
                     wave.setPixel(i, waveformSize.height()-j-1, qRgba(CHOP255(52*log(0.1*gain*waveValues[i][j])),
@@ -121,14 +120,14 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
             }
             break;
         case PaintMode_Yellow:
-            for (int i = 0; i < waveformSize.width(); i++) {
+            for (int i = 0; i < waveformSize.width(); ++i) {
                 for (int j = 0; j < waveformSize.height(); j++) {
                     wave.setPixel(i, waveformSize.height()-j-1, qRgba(255,242,0,   CHOP255(gain*waveValues[i][j])));
                 }
             }
             break;
         default:
-            for (int i = 0; i < waveformSize.width(); i++) {
+            for (int i = 0; i < waveformSize.width(); ++i) {
                 for (int j = 0; j < waveformSize.height(); j++) {
                     wave.setPixel(i, waveformSize.height()-j-1, qRgba(255,255,255, CHOP255(2*gain*waveValues[i][j])));
                 }
@@ -141,7 +140,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
             QRgb opx;
             davinci.setPen(qRgba(150,255,200,32));
             davinci.setCompositionMode(QPainter::CompositionMode_Overlay);
-            for (uint i = 0; i <= 10; i++) {
+            for (uint i = 0; i <= 10; ++i) {
                 dy = (float)i/10 * (wh-1);
                 for (uint x = 0; x < ww; x++) {
                     opx = wave.pixel(x, dy);
@@ -159,3 +158,5 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
     return wave;
 }
 #undef CHOP255
+
+#include "waveformgenerator.moc"