X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcolorcorrection%2Fvectorscopegenerator.cpp;h=480286f800bc4f4148d3e39870a682df60ea0a04;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=4ee5eccc1c41b71434b101fa19d0f11a9a8e51b2;hpb=4e2125a93b533b2d29232d9072a5a757ce2616e1;p=kdenlive diff --git a/src/colorcorrection/vectorscopegenerator.cpp b/src/colorcorrection/vectorscopegenerator.cpp index 4ee5eccc..480286f8 100644 --- a/src/colorcorrection/vectorscopegenerator.cpp +++ b/src/colorcorrection/vectorscopegenerator.cpp @@ -118,7 +118,7 @@ QPoint VectorscopeGenerator::mapToCircle(const QSize &targetSize, const QPointF 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 @@ -138,11 +138,11 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, QPoint pt; QRgb px; - const int stepsize = 4*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) 4*(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; @@ -260,3 +260,5 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, } return scope; } + +#include "vectorscopegenerator.moc"