cropelement.h
4.3 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
/* Webcamoid, webcam capture application.
* Copyright (C) 2022 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 CROPELEMENT_H
#define CROPELEMENT_H
#include <qrgb.h>
#include <iak/akelement.h>
class CropElementPrivate;
class CropElement: public AkElement
{
Q_OBJECT
Q_DISABLE_COPY(CropElement)
Q_PROPERTY(bool editMode
READ editMode
WRITE setEditMode
RESET resetEditMode
NOTIFY editModeChanged)
Q_PROPERTY(bool relative
READ relative
WRITE setRelative
RESET resetRelative
NOTIFY relativeChanged)
Q_PROPERTY(bool keepResolution
READ keepResolution
WRITE setKeepResolution
RESET resetKeepResolution
NOTIFY keepResolutionChanged)
Q_PROPERTY(qreal left
READ left
WRITE setLeft
RESET resetLeft
NOTIFY leftChanged)
Q_PROPERTY(qreal right
READ right
WRITE setRight
RESET resetRight
NOTIFY rightChanged)
Q_PROPERTY(qreal top
READ top
WRITE setTop
RESET resetTop
NOTIFY topChanged)
Q_PROPERTY(qreal bottom
READ bottom
WRITE setBottom
RESET resetBottom
NOTIFY bottomChanged)
Q_PROPERTY(QRgb fillColor
READ fillColor
WRITE setFillColor
RESET resetFillColor
NOTIFY fillColorChanged)
Q_PROPERTY(int frameWidth
READ frameWidth
NOTIFY frameWidthChanged)
Q_PROPERTY(int frameHeight
READ frameHeight
NOTIFY frameHeightChanged)
public:
CropElement();
~CropElement();
Q_INVOKABLE bool editMode() const;
Q_INVOKABLE bool relative() const;
Q_INVOKABLE bool keepResolution() const;
Q_INVOKABLE qreal left() const;
Q_INVOKABLE qreal right() const;
Q_INVOKABLE qreal top() const;
Q_INVOKABLE qreal bottom() const;
Q_INVOKABLE QRgb fillColor() const;
Q_INVOKABLE int frameWidth() const;
Q_INVOKABLE int frameHeight() const;
private:
CropElementPrivate *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 editModeChanged(bool editMode);
void relativeChanged(bool relative);
void keepResolutionChanged(bool keepResolution);
void leftChanged(qreal left);
void rightChanged(qreal right);
void topChanged(qreal top);
void bottomChanged(qreal bottom);
void fillColorChanged(QRgb fillColor);
void frameWidthChanged(int frameWidth);
void frameHeightChanged(int frameHeight);
public slots:
void setEditMode(bool editMode);
void setRelative(bool relative);
void setKeepResolution(bool keepResolution);
void setLeft(qreal left);
void setRight(qreal right);
void setTop(qreal top);
void setBottom(qreal bottom);
void setFillColor(QRgb fillColor);
void resetEditMode();
void resetRelative();
void resetKeepResolution();
void resetLeft();
void resetRight();
void resetTop();
void resetBottom();
void resetFillColor();
void reset();
};
#endif // CROPELEMENT_H