From: Jean-Baptiste Mardelle Date: Tue, 6 Mar 2012 13:35:29 +0000 (+0100) Subject: Fix broken color scopes X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=dbff55fc72cba76efa95a25425a09eabd924bedd;p=kdenlive Fix broken color scopes --- diff --git a/src/colorcorrection/vectorscopegenerator.cpp b/src/colorcorrection/vectorscopegenerator.cpp index 05202250..1c8e08db 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 = 4 * 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) 4*(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;