-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadviewer.h
94 lines (76 loc) · 1.92 KB
/
adviewer.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
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
#ifndef ADVIEWER_H
#define ADVIEWER_H
#include <QOpenGLFunctions>
#include <QOpenGLWidget>
#include <pvobject.h>
#include <QAtomicInteger>
typedef struct {
int width;
int height;
int color;
int bayer;
GLenum type;
GLenum format;
unsigned int size;
QAtomicInteger<bool> updated;
} ImgInfo;
class ADViewer : public QOpenGLWidget
{
Q_OBJECT
Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
Q_PROPERTY(int period READ period WRITE setPeriod)
Q_PROPERTY(int imageRate READ imageRate)
public:
ADViewer(QWidget *parent = 0);
~ADViewer();
QString prefix() {return _prefix;}
void setPrefix(QString prefix) {_prefix = prefix;}
int period() {return _period;}
void setPeriod(int);
int imageRate() { return _imagerate;}
void setMonitor(bool);
void connectChannels();
void start();
void stop();
public slots:
void updateImage();
protected:
void initializeGL();
void resizeGL(int, int);
void paintGL();
void keyReleaseEvent(QKeyEvent *);
void wheelEvent(QWheelEvent*);
void mouseDoubleClickEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void timerEvent(QTimerEvent *);
void zoom(double factor, const QPointF=QPointF());
QPointF mapToGL(const QPointF) const;
ImgInfo getImageInfo();
private:
QString _prefix;
int _period;
PvObject pvData;
PvObject pvDims;
PvObject pvSize0;
PvObject pvSize1;
PvObject pvSize2;
PvObject pvColor;
PvObject pvBayer;
PvObject pvUniqueId;
PvObject pvArrayRate;
int _imagerate;
int _imagecounter;
GLuint _tex;
int _timerUpdate;
int _timerCounter;
QRectF _rect;
QRect _rectView;
QPointF _ptLast;
ImgInfo _imginfo;
std::vector<uint8_t> _img;
int _xp;
int _yp;
};
#endif // ADVIEWER_H