调整亮度bright,一般是这样做吧。
int width = image.width();
int height = image.height();
uchar *line = image.bits();
uchar *pixel = 0;
for (int y = 0; y < height; y++) {
pixel = line;
for (int x = 0; x < width; x++) {
*pixel = qBound(0, *pixel + bright, 255);
*(pixel + 1) = qBound(0, *(pixel + 1) + bright, 255);
*(pixel + 2) = qBound(0, *(pixel + 2) + bright, 255);;
pixel += 4;
}
line += image.bytesPerLine();
}
应该是很快的呀。