diff --git a/imageviewer-qt4.cpp b/imageviewer-qt4.cpp index 94bda10..4fc8c19 100644 --- a/imageviewer-qt4.cpp +++ b/imageviewer-qt4.cpp @@ -73,6 +73,12 @@ void ImageViewer::initializeImage() { analyzeImage(); } +/** + * Uses simple weights to calculate intensity of a pixel. + * Using qRound() to reduce the error of the int cast. + * + * @brief ImageViewer::calcIntensity + */ int ImageViewer::calcIntensity(int r, int g, int b) { return (int) qRound(0.299*r + 0.587*g + 0.114*b); }