cbColorspace->addItem(i18n("YCbCr CbCr plane"), QVariant(ColorPlaneExport::CPE_YPbPr));
cbColorspace->addItem(i18n("RGB plane, one component varying"), QVariant(ColorPlaneExport::CPE_RGB_CURVE));
cbColorspace->addItem(i18n("HSV Hue Shift"), QVariant(ColorPlaneExport::CPE_HSV_HUESHIFT));
+ cbColorspace->addItem(i18n("HSV Saturation"), QVariant(ColorPlaneExport::CPE_HSV_SATURATION));
sliderColor->setSliderPosition(128);
///// Helper functions /////
-void ColorPlaneExport::enableSliderScaling(const bool &enable)
+void ColorPlaneExport::enableSliderScaling(bool enable)
{
sliderScaling->setEnabled(enable);
lblScaling->setEnabled(enable);
lblScaleNr->setEnabled(enable);
}
-void ColorPlaneExport::enableSliderColor(const bool &enable)
+void ColorPlaneExport::enableSliderColor(bool enable)
{
sliderColor->setEnabled(enable);
lblSliderName->setEnabled(enable);
lblColNr->setEnabled(enable);
}
-void ColorPlaneExport::enableCbVariant(const bool &enable)
+void ColorPlaneExport::enableCbVariant(bool enable)
{
cbVariant->setEnabled(enable);
lblVariant->setEnabled(enable);
break;
}
- lblSize->setText(i18n("%1 px", QVariant(tResX->text()).toInt()*QVariant(tResY->text()).toInt()));
+ lblSize->setText(i18n("%1 px", tResX->text().toInt()*tResY->text().toInt()));
}
void ColorPlaneExport::slotValidate()
}
}
QImage img;
+ QColor col;
QSize size(QVariant(tResX->text()).toInt(), QVariant(tResY->text()).toInt());
switch (cbColorspace->itemData(cbColorspace->currentIndex()).toInt()) {
case CPE_YUV:
case CPE_HSV_HUESHIFT:
img = m_colorTools->hsvHueShiftPlane(size, sliderColor->value(), sliderScaling->value(), -180, 180);
break;
+ case CPE_HSV_SATURATION:
+ col.setHsv(0, 0, sliderColor->value());
+ img = m_colorTools->hsvCurvePlane(size, col, ColorTools::COM_H, ColorTools::COM_S);
+ break;
+ default:
+ Q_ASSERT(false);
}
img.save(kurlrequester->text());
}
lblSliderName->setText(i18n("HSV Saturation"));
lblScaling->setText(i18n("HSV Value"));
break;
+ case CPE_HSV_SATURATION:
+ enableSliderScaling(false);
+ enableSliderColor(true);
+ sliderColor->setRange(0, 255);
+ sliderColor->setValue(200);
+ lblSliderName->setText(i18n("HSV Value"));
+ break;
default:
enableSliderScaling(false);
enableSliderColor(false);
this->update();
slotUpdateDisplays();
}
+
+#include "colorplaneexport.moc"