hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef __RKFACIAL_H__
#define __RKFACIAL_H__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <stdbool.h>
#include <rockface/rockface.h>
 
enum aiq_control_type {
    AIQ_CONTROL_RGB,
    AIQ_CONTROL_IR,
};
 
enum user_state {
    USER_STATE_FAKE,
    USER_STATE_REAL_UNREGISTERED,
    USER_STATE_REAL_REGISTERED_WHITE,
    USER_STATE_REAL_REGISTERED_BLACK,
    USER_STATE_REAL_IDENTITY,
};
 
struct user_info {
    char sIdentityPath[256];
    char has_mask;
    unsigned int id;
    char sPicturePath[256];
    char sRegistrationTime[32];
    unsigned int iAge;
    char sListType[32];
    char sType[32];
    char sName[256];
    char sGender[32];
    char sNation[32];
    char sCertificateType[32];
    char sCertificateNumber[32];
    char sBirthday[32];
    char sTelephoneNumber[32];
    char sHometown[32];
    char sAddress[32];
    unsigned int iAccessCardNumber;
    enum user_state state;
    char snap_path[256];
    rockface_det_t ir_face;
    rockface_det_t rgb_face;
};
 
struct test_result {
    bool en;
    int rgb_detect_total;
    int rgb_detect_ok;
    int rgb_track_total;
    int rgb_track_ok;
    int rgb_landmark_total;
    int rgb_landmark_ok;
    int rgb_align_total;
    int rgb_align_ok;
    int rgb_extract_total;
    int rgb_extract_ok;
    int rgb_search_total;
    int rgb_search_ok;
    int ir_detect_total;
    int ir_detect_ok;
    int ir_liveness_total;
    int ir_liveness_ok;
};
 
void rockface_start_test(void);
typedef void (*get_test_callback)(struct test_result *test);
void register_get_test_callback(get_test_callback cb);
 
typedef void (*display_callback)(void *ptr, int fd, int fmt, int w, int h, int rotation);
 
void set_rgb_param(int width, int height, display_callback cb, bool expo);
void set_ir_param(int width, int height, display_callback cb);
void set_usb_param(int width, int height, display_callback cb);
void set_face_param(int width, int height, int cnt);
void set_rgb_display(display_callback cb);
void set_ir_display(display_callback cb);
void set_usb_display(display_callback cb);
 
void set_rgb_rotation(int angle);
void set_ir_rotation(int angle);
void set_usb_rotation(int angle);
 
int rkfacial_init(void);
void rkfacial_exit(void);
void rkfacial_register(void);
void rkfacial_delete(void);
 
typedef void (*rkfacial_paint_box_callback)(int left, int top, int right, int bottom);
void register_rkfacial_paint_box(rkfacial_paint_box_callback cb);
extern rkfacial_paint_box_callback rkfacial_paint_box_cb;
 
typedef void (*rkfacial_paint_info_callback)(struct user_info *info, bool real);
void register_rkfacial_paint_info(rkfacial_paint_info_callback cb);
extern rkfacial_paint_info_callback rkfacial_paint_info_cb;
 
void save_ir_real(bool flag);
void save_ir_fake(bool flag);
 
typedef void (*rkfacial_paint_face_callback)(void *ptr, int fmt, int width, int height, int x, int y, int w, int h);
void register_rkfacial_paint_face(rkfacial_paint_face_callback cb);
extern rkfacial_paint_face_callback rkfacial_paint_face_cb;
 
typedef void (*get_face_config_region_callback)(int x, int y, int w, int h);
void register_get_face_config_region(get_face_config_region_callback cb);
extern get_face_config_region_callback get_face_config_region_cb;
 
#ifdef __cplusplus
}
#endif
 
#endif