<parameter type="list" name="Channel" default="0" paramlist="0,1,2,3" paramlistdisplay="Red,Green,Blue,Luma">
<name>Channel</name>
</parameter>
- <parameter type="curve" default="0" number="Curve point number" inpoints="Point %i input value" outpoints="Point %i output value" min="1" max="5">
+ <parameter type="curve" default="0" depends="Channel" number="Curve point number" inpoints="Point %i input value" outpoints="Point %i output value" min="1" max="5">
<name>Curve Widget</name>
</parameter>
<parameter type="fixed" name="Curve point number" default="2" min="2" max="5">
color defines the color to modify on the y axis. The other two components will be increased
in equal terms (linear as well) on the x axis.
*/
- QImage rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color);
+ static QImage rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color);
/**
@brief Draws a YPbPr plane with Pb on the x axis and Pr on the y axis.
Y is the Y value to use.
#include "kis_cubic_curve.h"
#include "choosecolorwidget.h"
#include "geometrywidget.h"
+#include "colortools.h"
#include <KDebug>
#include <KLocale>
}
}
+void EffectStackEdit::meetDependency(const QString& name, QString type, QString value)
+{
+ if (type == "curve") {
+ KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
+ if (curve) {
+ int color = value.toInt();
+ if (color < 3)
+ curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)color)));
+ else
+ curve->setPixmap(QPixmap());
+ }
+ }
+}
+
void EffectStackEdit::updateProjectFormat(MltVideoProfile profile, Timecode t)
{
m_profile = profile;
m_vbox->addWidget(curve);
m_vbox->addWidget(spinin);
m_vbox->addWidget(spinout);
+
connect(curve, SIGNAL(modified()), this, SLOT(collectAllParameters()));
m_valueItems[paramName] = curve;
+
+ QString depends = pa.attribute("depends");
+ if (!depends.isEmpty())
+ meetDependency(paramName, type, EffectsList::parameter(e, depends));
} else if (type == "wipe") {
Wipeval *wpval = new Wipeval;
wpval->setupUi(toFillin);
EffectsList::setParameter(newparam, in, QString::number(points.at(j).x()));
EffectsList::setParameter(newparam, out, QString::number(points.at(j).y()));
}
+ QString depends = pa.attributes().namedItem("depends").nodeValue();
+ if (!depends.isEmpty())
+ meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
} else if (type == "wipe") {
Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
wipeInfo info;
private:
void clearAllItems();
+ void createSliderItem(const QString& name, int val , int min, int max, const QString);
+ wipeInfo getWipeInfo(QString value);
+ QString getWipeString(wipeInfo info);
+ /** @brief Updates parameter @param name according to new value of dependency.
+ * @param name Name of the parameter which will be updated
+ * @param type Type of the parameter which will be updated
+ * @param value Value of the dependency parameter */
+ void meetDependency(const QString& name, QString type, QString value);
+
QVBoxLayout *m_vbox;
QList<QWidget*> m_uiItems;
QWidget *m_baseWidget;
QDomElement m_params;
QMap<QString, QWidget*> m_valueItems;
- void createSliderItem(const QString& name, int val , int min, int max, const QString);
- wipeInfo getWipeInfo(QString value);
- QString getWipeString(wipeInfo info);
MltVideoProfile m_profile;
Timecode m_timecode;
int m_in;