]> git.sesse.net Git - kdenlive/blobdiff - src/colorplaneexport.cpp
Fix resize box in geometry widget
[kdenlive] / src / colorplaneexport.cpp
index ef13db43ecf6d4eaadf9e9b6cc7877c893a6b339..b37efd76355a2ef2ab25123db953c93e14af977a 100644 (file)
@@ -25,10 +25,11 @@ ColorPlaneExport::ColorPlaneExport(QWidget *parent) :
     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);
 
@@ -47,7 +48,7 @@ ColorPlaneExport::ColorPlaneExport(QWidget *parent) :
     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();
@@ -141,7 +142,7 @@ void ColorPlaneExport::slotExportPlane()
     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;
@@ -159,6 +160,9 @@ void ColorPlaneExport::slotExportPlane()
     case CPE_RGB_CURVE:
         img = m_colorTools->rgbCurvePlane(size, (ColorTools::ColorsRGB) (cbVariant->itemData(cbVariant->currentIndex()).toInt()));
         break;
+    case CPE_YPbPr:
+        img = m_colorTools->yPbPrColorWheel(size, sliderColor->value(), m_scaling, false);
+        break;
     }
     img.save(kurlrequester->text());
 }
@@ -169,6 +173,7 @@ void ColorPlaneExport::slotColormodeChanged()
     switch (cbColorspace->itemData(cbColorspace->currentIndex()).toInt()) {
     case CPE_YUV:
     case CPE_YUV_MOD:
+    case CPE_YPbPr:
         enableSliderScaling(true);
         enableSliderColor(true);
         enableCbVariant(false);