common.h
1.15 KB
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
#ifndef COMMON_H_
#define COMMON_H_
#include <functional>
#include "header.h"
#define IMG_CHANNELS 3
struct OBJ_KEY {
int videoID;
int objID;
bool operator< (OBJ_KEY const& _A) const
{
if (videoID < _A.videoID) return true;
if (videoID == _A.videoID) return objID < _A.objID;
return false;
}
bool operator== (OBJ_KEY const& _A) const
{
if (videoID == _A.videoID && objID == _A.objID)
return true;
else
return false;
}
};
struct FRAME_KEY {
int videoID;
unsigned int objID;
bool operator< (FRAME_KEY const& _A) const
{
if (videoID < _A.videoID) return true;
if (videoID == _A.videoID) return objID < _A.objID;
return false;
}
bool operator== (FRAME_KEY const& _A) const
{
if (videoID == _A.videoID && objID == _A.objID)
return true;
else
return false;
}
};
using SNAPSHOT_CALLBACK = std::function<void(video_object_snapshot *)>;
using REALTIME_CALLBACK = std::function<void(unsigned char *img_data, int img_height, int img_width)>;
using FINISH_CALLBACK = std::function<void( const int )>;
using OBJECT_INFO_CALLBACK = std::function<void(video_object_info *)>;
#endif