-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtianmoucv.h
77 lines (55 loc) · 1.59 KB
/
tianmoucv.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
#ifndef _TIANMOUC_H
#define _TIANMOUC_H 1
#include <iostream>
#include <fstream>
#include <chrono>
#include <time.h>
#include <vector>
#include <cstdint>
#include <chrono>
#include "tmc_proc.h"
#include "lyn_cam.h"
using namespace std;
#define ROD_W 160
#define ROD_H 160
#define CONE_W 320
#define CONE_H 320
#ifndef WARNING
#define WARNING true
#endif
#ifndef DEBUG
#define DEBUG false
#endif
class TimeRecorder {
private:
std::chrono::steady_clock::time_point startTime;
public:
void start() {
startTime = std::chrono::steady_clock::now();
}
void stop(string NOTE) {
auto endTime = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count();
std::cout << NOTE << duration << " ms." << std::endl;
}
};
extern "C"{
struct tianmoucData{
int isRod;
uint64_t timestamp;
uchar * sdl_p;
uchar * sdr_p;
uchar * td_p;
float * rgb_p;
};
unsigned long long tmOpenCamera(int device_id =0);
void tmStartTransfer(unsigned long long cameraHandle);
bool tmGetFrame(unsigned long long cameraHandle,tianmoucData* metadata);
void tmCameraUninit(unsigned long long cameraHandle);
void tmExposureSet(unsigned long long cameraHandle, int rodAEtime, int coneAEtime, int rodGainV=1, int coneGainV=1,int RODADCprecision = 8,int RODINTmode=1,int CONEINTmode=1);
/************************************
void freeTianmoucData(tianmoucData* metadata);
************************************/
void IICconfig_download(unsigned long long cameraHandle, const char* IICconfigPath);
}
#endif