-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathImperxStream.hpp
86 lines (77 loc) · 2.02 KB
/
ImperxStream.hpp
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
#include <PvSampleUtils.h>
#include <PvSystem.h>
#include <PvInterface.h>
#include <PvDevice.h>
#include <PvPipeline.h>
#include <PvBuffer.h>
#include <PvStream.h>
#include <PvStreamRaw.h>
#include <string>
#include <opencv.hpp>
#include <stdint.h>
struct CameraSettings
{
CameraSettings(): exposure(10000),
size(1296, 966),
offset(0,0),
analogGain(400),
preampGain(-3),
blackLevel(0) {};
uint16_t exposure;
cv::Size size;
cv::Point offset;
uint16_t analogGain;
int16_t preampGain;
int blackLevel;
};
class ImperxStream
{
public:
ImperxStream();
~ImperxStream();
int Connect();
int Connect(const std::string &IP);
//get/set parameters(name, value);
int Initialize();
void ConfigureSnap();
int Snap(cv::Mat &frame, timespec timeout);
int Snap(cv::Mat &frame, int timeout);
int Snap(cv::Mat &frame);
void Stop();
void Disconnect();
/* Set-functions for camera values
returns 0 for a successful set,
returns -1 otherwise
*/
int SetExposure(int exposureTime);
int SetROISize(cv::Size size);
int SetROISize(int width, int height);
int SetROIOffset(cv::Point offset);
int SetROIOffset(int x, int y);
int SetROIOffsetX(int x);
int SetROIOffsetY(int y);
int SetROIHeight(int height);
int SetROIWidth(int width);
int SetAnalogGain(int gain);
int SetBlackLevel(int black);
int SetPreAmpGain(int gain);
int GetExposure();
cv::Size GetROISize();
cv::Point GetROIOffset();
int GetROIHeight();
int GetROIWidth();
int GetROIOffsetX();
int GetROIOffsetY();
int GetAnalogGain();
int GetBlackLevel();
int GetPreAmpGain();
float getTemperature( void );
private:
PvSystem lSystem;
PvDevice lDevice;
PvDeviceInfo *lDeviceInfo;
PvGenParameterArray *lDeviceParams;
PvStream lStream;
PvGenParameterArray *lStreamParams;
PvPipeline lPipeline;
};