1 /*
2 SPDX-FileCopyrightText: 2018 Jean-Baptiste Mardelle <jb@kdenlive.org>
3 This file is part of Kdenlive. See www.kdenlive.org.
4 
5 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
6 */
7 
8 #ifndef ROTOHELPER_H
9 #define ROTOHELPER_H
10 
11 #include "assets/keyframes/model/keyframemonitorhelper.hpp"
12 #include "bpoint.h"
13 #include <QPersistentModelIndex>
14 #include <QVariant>
15 
16 class Monitor;
17 
18 /** @class RotoHelper
19     @brief \@todo Describe class RotoHelper
20     @todo Describe class RotoHelper
21  */
22 class RotoHelper : public KeyframeMonitorHelper
23 {
24     Q_OBJECT
25 
26 public:
27     /** @brief Construct a keyframe list bound to the given effect
28        @param init_value is the value taken by the param at time 0.
29        @param model is the asset this parameter belong to
30        @param index is the index of this parameter in its model
31      */
32     explicit RotoHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent = nullptr);
33     /** @brief Send signals to the monitor to update the qml overlay.
34        @param returns : true if the monitor's connection was changed to active.
35     */
36     static QVariant getSpline(const QVariant &value, const QSize frame);
37     /** @brief Returns a list of spline control points, based on its string definition and frame size
38        @param value : the spline's string definition
39        @param frame: the frame size
40     */
41     static QList<BPoint> getPoints(const QVariant &value, const QSize frame);
42     void refreshParams(int pos) override;
43 
44 private slots:
45     void slotUpdateFromMonitorData(const QVariantList &v) override;
46 };
47 
48 #endif
49