[TASK] Add comment to calcIntensity()
This commit is contained in:
parent
3fe80df7f9
commit
8e3070a4b4
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue