How to change saturation and value using slider qcolor?

1.3k Views Asked by At

Can someone help me make two sliders named brightness and saturation for changing both brightness and saturation, I set up a dialog with QLabel for displaying image and two sliders below. I tried converting my image to HSV then change S and V. But that does not work.

void Dialog::sliderchange(QLabel *label,int value){
QImage image=label->pixmap()->toImage();
for(int i=0;i<image.width();i++){
    for(int j=0;j<image.height();j++){
        QColor color=image.pixelColor(i,j);
        color.convertTo(QColor::Hsv);
        value=color.value();
        color.setHsv(color.hue(),color.saturation(),value);

    }
}
}

void Dialog::on_brightness_valueChanged(int value){
  sliderchange(ui->label,value);
}
0

There are 0 best solutions below