Changeset View
Changeset View
Standalone View
Standalone View
src/assets/keyframes/model/rotoscoping/rotowidget.hpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2018 Jean-Baptiste Mardelle <jb@kdenlive.org> | ||||
3 | This file is part of Kdenlive. See www.kdenlive.org. | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public License as | ||||
7 | published by the Free Software Foundation; either version 2 of | ||||
8 | the License or (at your option) version 3 or any later version | ||||
9 | accepted by the membership of KDE e.V. (or its successor approved | ||||
10 | by the membership of KDE e.V.), which shall act as a proxy | ||||
11 | defined in Section 14 of version 3 of the license. | ||||
12 | | ||||
13 | This program is distributed in the hope that it will be useful, | ||||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
16 | GNU General Public License for more details. | ||||
17 | | ||||
18 | You should have received a copy of the GNU General Public License | ||||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
20 | */ | ||||
21 | | ||||
22 | #ifndef ROTOHELPER_H | ||||
23 | #define ROTOHELPER_H | ||||
24 | | ||||
25 | #include "bpoint.h" | ||||
26 | | ||||
27 | #include <QVariant> | ||||
28 | #include <QWidget> | ||||
29 | #include <QPersistentModelIndex> | ||||
30 | | ||||
31 | class Monitor; | ||||
32 | | ||||
33 | class RotoWidget : public QWidget | ||||
34 | { | ||||
35 | Q_OBJECT | ||||
36 | | ||||
37 | public: | ||||
38 | /* @brief Construct a keyframe list bound to the given effect | ||||
39 | @param init_value is the value taken by the param at time 0. | ||||
40 | @param model is the asset this parameter belong to | ||||
41 | @param index is the index of this parameter in its model | ||||
42 | */ | ||||
43 | explicit RotoWidget(Monitor *monitor, QPersistentModelIndex index, QWidget *parent = nullptr); | ||||
44 | /** @brief Send signals to the monitor to update the qml overlay. | ||||
45 | @param returns : true if the monitor's connection was changed to active. | ||||
46 | */ | ||||
47 | bool connectMonitor(bool activate); | ||||
48 | /** @brief Returns a spline defined as string, based on its control points and frame size | ||||
49 | @param value : the control points | ||||
50 | @param frame: the frame size | ||||
51 | */ | ||||
52 | static QVariant getSpline(QVariant value, const QSize frame); | ||||
53 | /** @brief Returns a list of spline control points, based on its string definition and frame size | ||||
54 | @param value : the spline's string definition | ||||
55 | @param frame: the frame size | ||||
56 | */ | ||||
57 | static QList<BPoint> getPoints(QVariant value, const QSize frame); | ||||
58 | | ||||
59 | private: | ||||
60 | Monitor *m_monitor; | ||||
61 | QPersistentModelIndex m_index; | ||||
62 | bool m_active; | ||||
63 | | ||||
64 | private slots: | ||||
65 | void slotUpdateRotoMonitor(const QVariantList &v); | ||||
66 | | ||||
67 | signals: | ||||
68 | void updateRotoKeyframe(QPersistentModelIndex, const QVariantList&); | ||||
69 | }; | ||||
70 | | ||||
71 | #endif | ||||
72 | |