1 /***************************************************************************
2 * Copyright (C) 2010 by Till Theato (root@ttill.de) *
3 * This file is part of Kdenlive (www.kdenlive.org). *
5 * Kdenlive is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * Kdenlive is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with Kdenlive. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
19 #ifndef BEZIERSPLINEWIDGET_H
20 #define BEZIERSPLINEWIDGET_H
22 #include "cubicbezierspline.h"
23 #include "beziersplineeditor.h"
24 #include "ui_bezierspline_ui.h"
29 class BezierSplineWidget : public QWidget
34 /** @brief Sets up the UI and sets the spline to @param spline. */
35 BezierSplineWidget(const QString &spline, QWidget* parent = 0);
37 /** @brief Returns the current spline. */
40 /** The curvemodes refer to the usage of the spline.
41 * As this widget is currently only used for frei0r.curves the modes are the channels this filter accepts. */
42 enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB, ModeHue, ModeSaturation };
44 /** @brief Sets the mode to @param mode and updates the editors background pixmap if necessary. */
45 void setMode(CurveModes mode);
48 /** @brief Sets the spinboxes for modifing the selected point to @param p. */
49 void slotUpdatePointEntries(const BPoint &p);
51 /** @brief Updates the editor and thus the spline if the current point's p was modified using the spinboxes. */
52 void slotUpdatePointP();
53 /** @brief Updates the editor and thus the spline if the current point's h1 was modified using the spinboxes. */
54 void slotUpdatePointH1();
55 /** @brief Updates the editor and thus the spline if the current point's h2 was modified using the spinboxes. */
56 void slotUpdatePointH2();
58 /** @brief Increases the number of lines in the editor's grid. If there are already 8 lines the number is set to 0. */
59 void slotGridChange();
60 /** @brief Turns showing the background pixmap in the editor on/off. */
61 void slotShowPixmap(bool show = true);
62 /** @brief Resets the current spline. */
63 void slotResetSpline();
64 /** @brief Linkes the handles. This will always make them stay in one line through p. */
65 void slotSetHandlesLinked(bool linked);
67 void slotShowAllHandles(bool show);
70 Ui::BezierSpline_UI m_ui;
71 BezierSplineEditor m_edit;