From dbff55fc72cba76efa95a25425a09eabd924bedd Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 6 Mar 2012 14:35:29 +0100 Subject: [PATCH] Fix broken color scopes --- src/colorcorrection/vectorscopegenerator.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.39.2