mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:13:41 +02:00
put averageColor init closer to where it is used
This commit is contained in:
parent
3ad9797607
commit
8057071c12
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,6 @@ void ImageReader::run() {
|
|||
|
||||
const int EIGHT_BIT_MAXIMUM = 255;
|
||||
if (!image.hasAlphaChannel()) {
|
||||
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
||||
if (image.format() != QImage::Format_RGB888) {
|
||||
image = image.convertToFormat(QImage::Format_RGB888);
|
||||
}
|
||||
|
@ -417,6 +416,7 @@ void ImageReader::run() {
|
|||
blueTotal += qBlue(rgb);
|
||||
}
|
||||
}
|
||||
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
||||
if (imageArea > 0) {
|
||||
averageColor.setRgb(redTotal / imageArea, greenTotal / imageArea, blueTotal / imageArea);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue