QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, const QImage &image, const float &gain,
const VectorscopeGenerator::PaintMode &paintMode,
const VectorscopeGenerator::ColorSpace &colorSpace,
- const bool &, const uint &accelFactor) const
+ bool, uint accelFactor) const
{
if (vectorscopeSize.width() <= 0 || vectorscopeSize.height() <= 0 || image.width() <= 0 || image.height() <= 0) {
// Invalid size
double /*y,*/ u, v;
QPoint pt;
QRgb px;
- int bpp = image.depth() / 8;
- const int stepsize = bpp * accelFactor;
+ const int stepsize = image.depth() / 8 * 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) bpp*(image.bytesPerLine()*image.height())/scope.size().width()/scope.size().height()/accelFactor;
+ double avgPxPerPx = (double) image.depth() / 8 *(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;
}
return scope;
}
+
+#include "vectorscopegenerator.moc"