#include <cmath>
#include <QColor>
-#include <QDebug>
#include <QImage>
#include <QPainter>
#include <QSize>
{
Q_ASSERT(accelFactor >= 1);
- QTime time;
- time.start();
+ //QTime time;
+ //time.start();
QImage wave(waveformSize, QImage::Format_ARGB32);
// Must be a float because the acceleration factor can be high, leading to <1 expected px per px.
const float pixelDepth = (float)((byteCount>>2) / accelFactor)/(ww*wh);
const float gain = 255/(8*pixelDepth);
- qDebug() << "Pixel depth: expected " << pixelDepth << "; Gain: using " << gain << " (acceleration: " << accelFactor << "x)";
+ //qDebug() << "Pixel depth: expected " << pixelDepth << "; Gain: using " << gain << " (acceleration: " << accelFactor << "x)";
// Subtract 1 from sizes because we start counting from 0.
const float wPrediv = (float)(ww-1)/(iw-1);
const uchar *bits = image.bits();
- const uchar *bitsStart = bits;
for (uint i = 0, x = 0; i < byteCount; i += 4) {
- Q_ASSERT(bits < bitsStart + byteCount);
+ Q_ASSERT(bits < image.bits() + byteCount);
col = (QRgb *)bits;
}
- uint diff = time.elapsed();
- emit signalCalculationFinished(wave, diff);
+ //uint diff = time.elapsed();
+ //emit signalCalculationFinished(wave, diff);
return wave;
}