rippleelement.h
4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* Webcamoid, webcam capture application.
* Copyright (C) 2016 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef RIPPLEELEMENT_H
#define RIPPLEELEMENT_H
#include <iak/akelement.h>
class RippleElementPrivate;
class RippleElement: public AkElement
{
Q_OBJECT
Q_PROPERTY(RippleMode mode
READ mode
WRITE setMode
RESET resetMode
NOTIFY modeChanged)
Q_PROPERTY(int amplitude
READ amplitude
WRITE setAmplitude
RESET resetAmplitude
NOTIFY amplitudeChanged)
Q_PROPERTY(int decay
READ decay
WRITE setDecay
RESET resetDecay
NOTIFY decayChanged)
Q_PROPERTY(int threshold
READ threshold
WRITE setThreshold
RESET resetThreshold
NOTIFY thresholdChanged)
Q_PROPERTY(int lumaThreshold
READ lumaThreshold
WRITE setLumaThreshold
RESET resetLumaThreshold
NOTIFY lumaThresholdChanged)
Q_PROPERTY(int minDropSize
READ minDropSize
WRITE setMinDropSize
RESET resetMinDropSize
NOTIFY minDropSizeChanged)
Q_PROPERTY(int maxDropSize
READ maxDropSize
WRITE setMaxDropSize
RESET resetMaxDropSize
NOTIFY maxDropSizeChanged)
Q_PROPERTY(qreal dropSigma
READ dropSigma
WRITE setDropSigma
RESET resetDropSigma
NOTIFY dropSigmaChanged)
Q_PROPERTY(qreal dropProbability
READ dropProbability
WRITE setDropProbability
RESET resetDropProbability
NOTIFY dropProbabilityChanged)
public:
enum RippleMode
{
RippleModeMotionDetect,
RippleModeRain
};
Q_ENUM(RippleMode)
RippleElement();
~RippleElement();
Q_INVOKABLE RippleMode mode() const;
Q_INVOKABLE int amplitude() const;
Q_INVOKABLE int decay() const;
Q_INVOKABLE int threshold() const;
Q_INVOKABLE int lumaThreshold() const;
Q_INVOKABLE int minDropSize() const;
Q_INVOKABLE int maxDropSize() const;
Q_INVOKABLE qreal dropSigma() const;
Q_INVOKABLE qreal dropProbability() const;
private:
RippleElementPrivate *d;
protected:
QString controlInterfaceProvide(const QString &controlId) const override;
void controlInterfaceConfigure(QQmlContext *context,
const QString &controlId) const override;
AkPacket iVideoStream(const AkVideoPacket &packet) override;
signals:
void modeChanged(RippleMode mode);
void amplitudeChanged(int amplitude);
void decayChanged(int decay);
void thresholdChanged(int threshold);
void lumaThresholdChanged(int lumaThreshold);
void minDropSizeChanged(int minDropSize);
void maxDropSizeChanged(int maxDropSize);
void dropSigmaChanged(qreal dropSigma);
void dropProbabilityChanged(qreal dropProbability);
public slots:
void setMode(RippleMode mode);
void setAmplitude(int amplitude);
void setDecay(int decay);
void setThreshold(int threshold);
void setLumaThreshold(int lumaThreshold);
void setMinDropSize(int minDropSize);
void setMaxDropSize(int maxDropSize);
void setDropSigma(qreal dropSigma);
void setDropProbability(qreal dropProbability);
void resetMode();
void resetAmplitude();
void resetDecay();
void resetThreshold();
void resetLumaThreshold();
void resetMinDropSize();
void resetMaxDropSize();
void resetDropSigma();
void resetDropProbability();
};
Q_DECL_EXPORT QDataStream &operator >>(QDataStream &istream, RippleElement::RippleMode &mode);
Q_DECL_EXPORT QDataStream &operator <<(QDataStream &ostream, RippleElement::RippleMode mode);
Q_DECLARE_METATYPE(RippleElement::RippleMode)
#endif // RIPPLEELEMENT_H