DFACE C++  5.0.0
common.h
Go to the documentation of this file.
1 // Hang Zhou Xiao Kong Cheng Xiang Ke Ji You Xian Gong Si is pleased to support DFACE SDK LIBRARY.
2 //
3 // Copyright © 2017-2020, Hang Zhou Xiao Kong Cheng Xiang Ke Ji You Xian Gong Si Holding Limited//
4 
5 #ifndef DFACE_COMMON_H
6 #define DFACE_COMMON_H
7 
8 #ifndef STB_IMAGE_IMPLEMENTATION
9 #define STB_IMAGE_IMPLEMENTATION 1
10 #endif
11 
12 #define DFACE_VERSION 500
13 
14 #if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__)
15 # define DFACE_EXPORTS __declspec(dllexport)
16 #elif defined __GNUC__ && __GNUC__ >= 4
17 # define DFACE_EXPORTS __attribute__ ((visibility ("default")))
18 #else
19 # define DFACE_EXPORTS
20 #endif
21 
22 #ifndef DFACE_EXTERN_C
23 # ifdef __cplusplus
24 # define DFACE_EXTERN_C extern "C"
25 # else
26 # define DFACE_EXTERN_C
27 # endif
28 #endif
29 
30 #include <stdio.h>
31 
32 
33 
34 namespace dface {
35 
39  typedef enum _ACCURACY {
40  V2 = 2,
41  V3 = 3
42  }ACCURACY;
43 
44 
48  typedef enum _DETECT_PRECISION {
52 
53 
57  typedef enum _RGB_LIVENESS_LEVEL {
58  LEVEL_0 = 0,
59  LEVEL_1 = 1,
60  LEVEL_2 = 2,
61  LEVEL_3 = 3,
63 
64 
65  typedef enum _IMG_FORMAT
66  {
67  PIXELS_RGB = 1,
68  PIXELS_BGR = 2,
71  PIXELS_BGRA = 16,
72  PIXELS_NV21 = 32,
74  }IMG_FORMAT;
75 
76 
77 
78  typedef enum _LICENSE_INFO
79  {
81  INFO_SN = 1,
86  } LICENSE_INFO;
87 
88 
92  typedef struct _Box {
93  int x;
94  int y;
95  int w;
96  int h;
97  int id;
98  float score;
99  float point[10];
100  }Box;
101 
102 
106  typedef struct _Point {
107  int x;
108  int y;
109  }Point;
110 
114  typedef struct _Rect {
115  int x;
116  int y;
117  int w;
118  int h;
119  }Rect;
120 
124  struct Size {
125  int w;
126  int h;
127  };
128 
129 
136  static inline dface::Rect Box2Rect(dface::Box in_box){
137  dface::Rect ret;
138  ret.x = in_box.x;
139  ret.y = in_box.y;
140  ret.w = in_box.w;
141  ret.h = in_box.h;
142  return ret;
143  }
144 
145 
146 
153  static inline Box Rect2Box(dface::Rect &in_rect){
154  dface::Box ret;
155  ret.x = in_rect.x;
156  ret.y = in_rect.y;
157  ret.w = in_rect.w;
158  ret.h = in_rect.h;
159  return ret;
160  }
161 
162 
163 }
164 
165 #endif //DFACE_COMMON_H
Definition: common.h:82
int x
Definition: common.h:115
Definition: common.h:72
int w
Definition: common.h:117
int y
Definition: common.h:94
enum dface::_IMG_FORMAT IMG_FORMAT
Definition: common.h:34
Definition: common.h:41
int w
Definition: common.h:125
int w
Definition: common.h:95
Definition: common.h:49
_IMG_FORMAT
Definition: common.h:65
int y
Definition: common.h:108
int x
Definition: common.h:93
enum dface::_LICENSE_INFO LICENSE_INFO
_RGB_LIVENESS_LEVEL
RGBLiveness Level.
Definition: common.h:57
_LICENSE_INFO
Definition: common.h:78
struct dface::_Box Box
Face Box.
Definition: common.h:71
enum dface::_RGB_LIVENESS_LEVEL RGB_LIVENESS_LEVEL
RGBLiveness Level.
Definition: common.h:80
struct dface::_Point Point
Point.
Definition: common.h:69
Face Box.
Definition: common.h:92
int h
Definition: common.h:96
Definition: common.h:85
Definition: common.h:59
Size.
Definition: common.h:124
int x
Definition: common.h:107
Definition: common.h:58
int h
Definition: common.h:118
struct dface::_Rect Rect
Rect.
Definition: common.h:83
Definition: common.h:61
Rect.
Definition: common.h:114
_DETECT_PRECISION
Face detect precision.
Definition: common.h:48
Definition: common.h:73
Definition: common.h:40
_ACCURACY
Recognize feature precision.
Definition: common.h:39
float score
Definition: common.h:98
Definition: common.h:67
Definition: common.h:50
Point.
Definition: common.h:106
Definition: common.h:60
float point[10]
Definition: common.h:99
int id
Definition: common.h:97
int y
Definition: common.h:116
int h
Definition: common.h:126
Definition: common.h:70
Definition: common.h:68
Definition: common.h:84
enum dface::_DETECT_PRECISION DETECT_PRECISION
Face detect precision.
Definition: common.h:81
enum dface::_ACCURACY ACCURACY
Recognize feature precision.