1 /* Webcamoid, webcam capture application.
2  * Copyright (C) 2016  Gonzalo Exequiel Pedone
3  *
4  * Webcamoid is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Webcamoid is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Web-Site: http://webcamoid.github.io/
18  */
19 
20 #ifndef DISTORTELEMENT_H
21 #define DISTORTELEMENT_H
22 
23 #include <akelement.h>
24 
25 class DistortElementPrivate;
26 
27 class DistortElement: public AkElement
28 {
29     Q_OBJECT
30     Q_PROPERTY(qreal amplitude
31                READ amplitude
32                WRITE setAmplitude
33                RESET resetAmplitude
34                NOTIFY amplitudeChanged)
35     Q_PROPERTY(qreal frequency
36                READ frequency
37                WRITE setFrequency
38                RESET resetFrequency
39                NOTIFY frequencyChanged)
40     Q_PROPERTY(int gridSizeLog
41                READ gridSizeLog
42                WRITE setGridSizeLog
43                RESET resetGridSizeLog
44                NOTIFY gridSizeLogChanged)
45 
46     public:
47         DistortElement();
48         ~DistortElement();
49 
50         Q_INVOKABLE qreal amplitude() const;
51         Q_INVOKABLE qreal frequency() const;
52         Q_INVOKABLE int gridSizeLog() const;
53 
54     private:
55         DistortElementPrivate *d;
56 
57     protected:
58         QString controlInterfaceProvide(const QString &controlId) const;
59         void controlInterfaceConfigure(QQmlContext *context,
60                                        const QString &controlId) const;
61         AkPacket iVideoStream(const AkVideoPacket &packet);
62 
63     signals:
64         void amplitudeChanged(qreal amplitude);
65         void frequencyChanged(qreal frequency);
66         void gridSizeLogChanged(int gridSizeLog);
67 
68     public slots:
69         void setAmplitude(qreal amplitude);
70         void setFrequency(qreal frequency);
71         void setGridSizeLog(int gridSizeLog);
72         void resetAmplitude();
73         void resetFrequency();
74         void resetGridSizeLog();
75 };
76 
77 #endif // DISTORTELEMENT_H
78