void adjustImageHSL(QImage& image,qreal hue,qreal saturation,qreal lightness)
{
unsigned int* data = (unsigned int*)image.bits();
int size = image.width()*image.height();
QColor color;
for(int i = 0; i < size; i++)
{
int red = qRed(data[i]);
int green = qGreen(data[i]);
int blue = qBlue(data[i]);
color.setRed(red);
color.setGreen(green);
color.setBlue(blue);
qreal h = color.hueF() + hue;
qreal s = color.saturationF() + saturation;
qreal l = color.lightnessF() + lightness;
h = qBound<qreal>(0,h,1);
s = qBound<qreal>(0,s,1);
l = qBound<qreal>(0,l,1);
color.setHslF(h,s,l);
color.setAlpha(qAlpha(data[i]));
data[i] = qRgba(color.red(),color.green(),color.blue(),color.alpha());
}
return;
}