[TASK] Add comment to calcIntensity()

This commit is contained in:
Jan Philipp Timme 2015-11-10 12:56:39 +01:00
parent 3fe80df7f9
commit 8e3070a4b4

View File

@ -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);
}