-
Notifications
You must be signed in to change notification settings - Fork 56
/
mainwindow.h
88 lines (72 loc) · 2.1 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QLabel>
#include <QCheckBox>
#include <QSlider>
#include <QMutex>
#include <vector>
#include "openpnp-capture.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void readCameraSettings();
/** custom logging function to capture all
messages/errors from the library.
Note: this function can be called from _any_ thread,
i.e. protection must be used when this is called from
a non-GUI thread.
*/
void logMessage(uint32_t level, const char *message);
public slots:
void doFrameUpdate();
void updateLogMessages();
void changeCamera();
void onAutoExposure(bool state);
void onAutoWhiteBalance(bool state);
void onAutoGain(bool state);
void onAutoFocus(bool state);
void onExposureSlider(int value);
void onWhiteBalanceSlider(int value);
void onGainSlider(int value);
void onContrastSlider(int value);
void onBrightnessSlider(int value);
void onSaturationSlider(int value);
void onFocusSlider(int value);
void onZoomSlider(int value);
void onGammaSlider(int value);
void onHueSlider(int value);
void onBacklightSlider(int value);
void onSharpnessSlider(int value);
void onColorEnableSlider(int value);
private:
QMutex m_logMutex;
std::vector<std::string> m_logMessages;
CapFormatInfo m_finfo;
std::vector<uint8_t> m_frameData;
bool m_hasBrightness;
bool m_hasExposure;
bool m_hasGamma;
bool m_hasWhiteBalance;
bool m_hasGain;
bool m_hasContrast;
bool m_hasSaturation;
bool m_hasFocus;
bool m_hasZoom;
bool m_hasHue;
bool m_hasSharpness;
bool m_hasBacklightcomp;
bool m_hasColorEnable;
QTimer* m_refreshTimer;
CapContext m_ctx;
int32_t m_streamID;
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H