X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcolorcorrection%2Fvectorscopegenerator.cpp;h=f398e64834dee9384d52b82ac04c59fd4aed2a23;hb=fe41177675e1419318d6af81885ab725e6903307;hp=052022500894eb19f80fed91965b4439a421effe;hpb=05f4fad9a19434399f43ff76e06d1e1a5f74c0f6;p=kdenlive diff --git a/src/colorcorrection/vectorscopegenerator.cpp b/src/colorcorrection/vectorscopegenerator.cpp index 05202250..f398e648 100644 --- a/src/colorcorrection/vectorscopegenerator.cpp +++ b/src/colorcorrection/vectorscopegenerator.cpp @@ -137,13 +137,12 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, 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;