-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcvideolabel.h
executable file
·66 lines (56 loc) · 1.32 KB
/
cvideolabel.h
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
#ifndef VIDEOLABEL_H
#define VIDEOLABEL_H
#include <QLabel>
#include <QWidget>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QThread>
#include "opencvHandle.h"
class cVideoLabel : public QLabel
{
Q_OBJECT
public:
explicit cVideoLabel(QWidget *parent = 0);
enum keyState {
keyReleased,
keyPressed
};
int xCoord;
int yCoord;
signals:
void leftClick(void);
void rightClick(void);
void leftRelease(void);
void rightRelease(void);
void mouseMoving(void);
void forwardKeyPressed(void);
void forwardKeyReleased(void);
void backwardKeyPressed(void);
void backwardKeyReleased(void);
void leftKeyPressed(void);
void leftKeyReleased(void);
void rightKeyPressed(void);
void rightKeyReleased(void);
public slots:
void startStreaming(void);
void stopStreaming(void);
private:
int xInitialCoord;
int yInitialCoord;
Qt::Key moveForwardKey;
Qt::Key moveBackwardKey;
Qt::Key moveLeftKey;
Qt::Key moveRightKey;
QThread* thread;
OPENCV_HANDLER* openCVObj;
private slots:
void updateImage(QPixmap curImage);
void videoError(QString errorStr);
protected:
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void keyPressEvent(QKeyEvent *ev);
void keyReleaseEvent(QKeyEvent *ev);
};
#endif // VIDEOLABEL_H