X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcolorcorrection%2Fhistogramgenerator.cpp;h=3541d30002360a9a390da3930190e196191df476;hb=29ceabd2afc227e0fb8b586c567eeaf7921b542e;hp=2681c504619ecc9d081a6a4300927a381051fcd4;hpb=d5bbdb443ab800dcc02dd4f9b486f4cec3af5e60;p=kdenlive diff --git a/src/colorcorrection/histogramgenerator.cpp b/src/colorcorrection/histogramgenerator.cpp index 2681c504..3541d300 100644 --- a/src/colorcorrection/histogramgenerator.cpp +++ b/src/colorcorrection/histogramgenerator.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "histogramgenerator.h" HistogramGenerator::HistogramGenerator() @@ -19,7 +20,7 @@ HistogramGenerator::HistogramGenerator() } QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components, - HistogramGenerator::Rec rec, const bool &unscaled, const uint &accelFactor) const + HistogramGenerator::Rec rec, bool unscaled, uint accelFactor) const { if (paradeSize.height() <= 0 || paradeSize.width() <= 0 || image.width() <= 0 || image.height() <= 0) { return QImage(); @@ -44,7 +45,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm const uint ww = paradeSize.width(); const uint wh = paradeSize.height(); const uint byteCount = iw*ih; - const uint stepsize = 4*accelFactor; + const uint stepsize = image.depth() / 8 *accelFactor; const uchar *bits = image.bits(); QRgb *col; @@ -130,7 +131,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm } QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, - const bool &unscaled, const uint &max) const + bool unscaled, uint max) const { QImage component(max, size.height(), QImage::Format_ARGB32); component.fill(qRgba(0, 0, 0, 0)); @@ -159,7 +160,7 @@ QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const } void HistogramGenerator::drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect, - const QColor &color, const int &textSpace, const bool &unscaled, const uint &max) const + const QColor &color, int textSpace, bool unscaled, uint max) const { QImage component = drawComponent(y, rect.size() - QSize(0, textSpace), scaling, color, unscaled, max); davinci->drawImage(rect.topLeft(), component); @@ -183,9 +184,9 @@ void HistogramGenerator::drawComponentFull(QPainter *davinci, const int *y, cons const int dist = 40; const int cw = component.width(); - davinci->drawText(0, textY, "min"); + davinci->drawText(0, textY, i18n("min")); davinci->drawText(dist, textY, QString::number(min, 'f', 0)); - davinci->drawText(cw-dist-30, textY, "max"); + davinci->drawText(cw-dist-30, textY, i18n("max")); davinci->drawText(cw-30, textY, QString::number(maxVal, 'f', 0)); }