tResX->setText("800");
tResY->setText("800");
- cbColorspace->addItem(i18n("YUV UV plane"), QVariant(CPE_YUV));
- cbColorspace->addItem(i18n("YUV Y plane"), QVariant(CPE_YUV_Y));
- cbColorspace->addItem(i18n("Modified YUV (Chroma)"), QVariant(CPE_YUV_MOD));
- cbColorspace->addItem(i18n("RGB plane, one component varying"), QVariant(CPE_RGB_CURVE));
+ cbColorspace->addItem(i18n("YUV UV plane"), QVariant(ColorPlaneExport::CPE_YUV));
+ cbColorspace->addItem(i18n("YUV Y plane"), QVariant(ColorPlaneExport::CPE_YUV_Y));
+ cbColorspace->addItem(i18n("Modified YUV (Chroma)"), QVariant(ColorPlaneExport::CPE_YUV_MOD));
+ cbColorspace->addItem(i18n("YCbCr CbCr plane"), QVariant(ColorPlaneExport::CPE_YPbPr));
+ cbColorspace->addItem(i18n("RGB plane, one component varying"), QVariant(ColorPlaneExport::CPE_RGB_CURVE));
sliderColor->setSliderPosition(128);
connect(sliderScaling, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateDisplays()));
connect(cbColorspace, SIGNAL(currentIndexChanged(int)), this, SLOT(slotColormodeChanged()));
- kurlrequester->setText("/tmp/yuv-plane.png");
+ kurlrequester->setUrl(KUrl("/tmp/yuv-plane.png"));
slotColormodeChanged();
slotValidate();
{
m_scaling = 1 - (float)sliderScaling->value()/100;
- lblScaleNr->setText("0..." + QString::number(m_scaling, 'f', 2));
+ switch(cbColorspace->itemData(cbColorspace->currentIndex()).toInt()){
+ case CPE_RGB_CURVE:
+ lblScaleNr->setText(QChar(0xb1) + QString::number(sliderScaling->value(), 'f', 2));;
+ break;
+ default:
+ lblScaleNr->setText("0..." + QString::number(m_scaling, 'f', 2));
+ break;
+ }
switch (cbColorspace->itemData(cbColorspace->currentIndex()).toInt()) {
case CPE_YUV_Y:
- lblColNr->setText(i18n("%1 °", QString::number(sliderColor->value())));
+ lblColNr->setText(i18n("%1°", QString::number(sliderColor->value())));
break;
default:
lblColNr->setText(QString::number(sliderColor->value()));
qDebug() << "Lower: " << lower;
if (!lower.endsWith(".png") && !lower.endsWith(".jpg") && !lower.endsWith(".tif") && !lower.endsWith(".tiff")) {
if (KMessageBox::questionYesNo(this, i18n("File has no extension. Add extension (%1)?", EXTENSION_PNG)) == KMessageBox::Yes) {
- kurlrequester->setText(kurlrequester->text() + ".png");
+ kurlrequester->setUrl(KUrl(kurlrequester->text() + ".png"));
}
}
QImage img;
img = m_colorTools->yuvColorWheel(size, sliderColor->value(), m_scaling, true, false);
break;
case CPE_RGB_CURVE:
- img = m_colorTools->rgbCurvePlane(size, (ColorTools::ColorsRGB) (cbVariant->itemData(cbVariant->currentIndex()).toInt()));
+ img = m_colorTools->rgbCurvePlane(size, (ColorTools::ColorsRGB) (cbVariant->itemData(cbVariant->currentIndex()).toInt()),
+ (double)sliderScaling->value()/255);
+ break;
+ case CPE_YPbPr:
+ img = m_colorTools->yPbPrColorWheel(size, sliderColor->value(), m_scaling, false);
break;
}
img.save(kurlrequester->text());
switch (cbColorspace->itemData(cbColorspace->currentIndex()).toInt()) {
case CPE_YUV:
case CPE_YUV_MOD:
+ case CPE_YPbPr:
enableSliderScaling(true);
enableSliderColor(true);
enableCbVariant(false);
lblSliderName->setToolTip(i18n("Angle through the UV plane, with all possible Y values."));
break;
case CPE_RGB_CURVE:
- // deliberately fall through
+ enableSliderScaling(true);
+ enableSliderColor(false);
+ enableCbVariant(true);
+ sliderScaling->setRange(1,255);
+ sliderScaling->setValue(255);
+ cbVariant->addItem(i18n("Red"), QVariant(ColorTools::COL_R));
+ cbVariant->addItem(i18n("Green"), QVariant(ColorTools::COL_G));
+ cbVariant->addItem(i18n("Blue"), QVariant(ColorTools::COL_B));
+ cbVariant->addItem(i18n("Luma"), QVariant(ColorTools::COL_Luma));
+ break;
default:
enableSliderScaling(false);
enableSliderColor(false);
cbVariant->addItem(i18n("Red"), QVariant(ColorTools::COL_R));
cbVariant->addItem(i18n("Green"), QVariant(ColorTools::COL_G));
cbVariant->addItem(i18n("Blue"), QVariant(ColorTools::COL_B));
+ cbVariant->addItem(i18n("Luma"), QVariant(ColorTools::COL_Luma));
break;
}
this->update();