* keyframe: a list widget with a list of entries (position and value)
* color: a color chooser button
* position: a slider representing the position of a frame in the current clip
+ * curve: a single curve representing multiple points
* wipe: a widget designed for the wipe transition, allowing to choose a position (left, right, top,...)
*/
connect(posedit, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
} else if (type == "curve") {
KisCurveWidget *curve = new KisCurveWidget(this);
+ curve->setMaxPoints(pa.attribute("max").toInt());
QList<QPointF> points;
int number = EffectsList::parameter(e, pa.attribute("number")).toInt();
QString inName = pa.attribute("inpoints");
points << QPointF(EffectsList::parameter(e, in).toDouble(), EffectsList::parameter(e, out).toDouble());
}
if (!points.isEmpty()) curve->setCurve(KisCubicCurve(points));
+ QSpinBox *spinin = new QSpinBox();
+ spinin->setRange(0, 1000);
+ QSpinBox *spinout = new QSpinBox();
+ spinout->setRange(0, 1000);
+ curve->setupInOutControls(spinin, spinout, 0, 1000);
m_vbox->addWidget(curve);
+ m_vbox->addWidget(spinin);
+ m_vbox->addWidget(spinout);
connect(curve, SIGNAL(modified()), this, SLOT(collectAllParameters()));
m_valueItems[paramName] = curve;
} else if (type == "wipe") {
d->m_intIn = NULL;
d->m_intOut = NULL;
+
+ d->m_maxPoints = -1;
setMouseTracking(true);
setAutoFillBackground(false);
if (e->button() != Qt::LeftButton)
return;
-
+
double x = e->pos().x() / (double)(width() - 1);
double y = 1.0 - e->pos().y() / (double)(height() - 1);
int closest_point_index = d->nearestPointInRange(QPointF(x, y), width(), height());
if (closest_point_index < 0) {
+ if (d->m_maxPoints > 0 && d->m_curve.points().count() >= d->m_maxPoints)
+ return;
QPointF newPoint(x, y);
if (!d->jumpOverExistingPoints(newPoint, -1))
return;
{
}
+void KisCurveWidget::setMaxPoints(int max)
+{
+ d->m_maxPoints = max;
+}
+
#include "kis_curve_widget.moc"