diff --git a/imageviewer-qt4.cpp b/imageviewer-qt4.cpp index 4fc8c19..be1cd0e 100644 --- a/imageviewer-qt4.cpp +++ b/imageviewer-qt4.cpp @@ -108,7 +108,6 @@ void ImageViewer::convertToMonochrome() { } } - /** * Draws a simple, black line. * @brief ImageViewer::drawBlackLine @@ -245,7 +244,7 @@ int ImageViewer::getAverageIntensity() { for(int i=0; i<256;i++) { sumIntensity += (i*grayscale_relative_histogramm[i]); } - return (int)sumIntensity; + return (int) qRound(sumIntensity); } /** @@ -287,7 +286,7 @@ void ImageViewer::updateHistogramm() { histogramm->fill(QColor::fromRgb(200,200,200)); int black = QColor::fromRgb(0,0,0).rgba(); for(int x=0; x<256; x++) { - int k_max = (int)((100*grayscale_relative_histogramm[x])/max); + int k_max = (int) qRound((100*grayscale_relative_histogramm[x])/max); for(int y=0; ysetPixel(x, (100-y)-1, black); } @@ -342,7 +341,7 @@ void ImageViewer::adjustContrast(int c) { } } updateImageDisplay(); - logFile << "[TODO!] Contrast adjusted to: " << old_l << " * " << alpha << " -> (" << h << ", " << s << ", " << new_l << ")" << std::endl; + logFile << "Contrast adjusted to: " << old_l << " * " << alpha << " -> (" << h << ", " << s << ", " << new_l << ")" << std::endl; renewLogging(); }