]> git.sesse.net Git - kdenlive/commitdiff
Bezier Spline: add support for new modes in frei0r.curves: RGB, Alpha
authorTill Theato <root@ttill.de>
Sun, 2 Jan 2011 22:56:42 +0000 (22:56 +0000)
committerTill Theato <root@ttill.de>
Sun, 2 Jan 2011 22:56:42 +0000 (22:56 +0000)
svn path=/trunk/kdenlive/; revision=5245

effects/frei0r_bezier_curves.xml
src/beziercurve/beziersplinewidget.cpp
src/beziercurve/beziersplinewidget.h
src/effectstackedit.cpp

index dff8396831d2da691373da6f8ff46d862d73a96c..5df3f464a80cba6289beedb33276176dbcfb4703 100644 (file)
@@ -4,7 +4,7 @@
         <description>Color curves adjustment</description>
         <author>Till Theato, Maksim Golovkin</author>
 
-        <parameter type="list" name="Channel" default="0" paramlist="0,1,2,3" paramlistdisplay="Red,Green,Blue,Luma">
+        <parameter type="list" name="Channel" default="0.5" paramlist="0.5,0,0.1,0.2,0.3,0.4" paramlistdisplay="RGB,Red,Green,Blue,Alpha,Luma">
                 <name>Channel</name>
         </parameter>
 
index d6469c71fbe38607c5058efe74937389419ece78..b7f52f0d9c2ef67e9a5b8d247735eaf5e15e2c49 100644 (file)
@@ -26,7 +26,7 @@
 
 BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
         QWidget(parent),
-        m_mode(ModeRed)
+        m_mode(ModeRGB)
 {
     QVBoxLayout *layout = new QVBoxLayout(this);
     layout->addWidget(&m_edit);
@@ -89,8 +89,8 @@ void BezierSplineWidget::slotShowPixmap(bool show)
 {
     m_showPixmap = show;
     KdenliveSettings::setBezier_showpixmap(show);
-    if (show)
-        m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)m_mode), 0.8)));
+    if (show && m_mode != ModeAlpha && m_mode != ModeRGB)
+        m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)(m_mode == ModeLuma ? 3 : m_mode)), 0.8)));
     else
         m_edit.setPixmap(QPixmap());
 }
index cec30f7362d1fb9b71b9fa861c834def7729bc82..e19f387fcf70299de1cb071b978dcc7a8cebc90e 100644 (file)
@@ -35,7 +35,7 @@ public:
 
     QString spline();
 
-    enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeLuma };
+    enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB };
     void setMode(CurveModes mode);
 
 private slots:
index d344e32fe759744c650a5cd7828727dd9efcf3f0..0a629559c91a6c51dd6e555aa8f37ffc87bc1467 100644 (file)
@@ -152,7 +152,7 @@ void EffectStackEdit::meetDependency(const QString& name, QString type, QString
     } else if (type == "bezier_spline") {
         BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems[name];
         if (widget) {
-            widget->setMode((BezierSplineWidget::CurveModes)value.toInt());
+            widget->setMode((BezierSplineWidget::CurveModes)((int)(value.toDouble() * 10)));
         }
     }
 }