wx_human_seg 3.0.0
wx_idphoto_c_api.h
Go to the documentation of this file.
1
6#ifndef WX_IDPHOTO_C_API_H_
7#define WX_IDPHOTO_C_API_H_
8
9#include "wx_api.h"
10#include "wx_image_c_api.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
21typedef struct WXIDPhotoConfig_t {
26
30 int width;
31
35 int height;
36
42 float faceRatio;
43
49 float eyesTop;
50
58 float topEmpty[2];
59
66
71 unsigned short dpi;
72
74
79
82
85
87WX_API void WXIDPhotoSettings_SetInt(WXIDPhotoSettings_t *settings, const char *key, int value);
88
90WX_API void WXIDPhotoSettings_SetFloat(WXIDPhotoSettings_t *settings, const char *key, float value);
91
93WX_API void WXIDPhotoSettings_SetBool(WXIDPhotoSettings_t *settings, const char *key, uint8_t value);
94
96WX_API void WXIDPhotoSettings_SetString(WXIDPhotoSettings_t *settings, const char *key, const char *str);
97
99WX_API void WXIDPhotoSettings_SetIntArray(WXIDPhotoSettings_t *settings, const char *key, const int *arr, int size);
100
102WX_API void WXIDPhotoSettings_SetFloatArray(WXIDPhotoSettings_t *settings, const char *key, const float *arr, int size);
103
105WX_API int WXIDPhotoSettings_GetInt(WXIDPhotoSettings_t *settings, const char *key, int defValue);
106
108WX_API float WXIDPhotoSettings_GetFloat(WXIDPhotoSettings_t *settings, const char *key, float defValue);
109
111WX_API uint8_t WXIDPhotoSettings_GetBool(WXIDPhotoSettings_t *settings, const char *key, uint8_t defValue);
112
116WX_API const char *WXIDPhotoSettings_GetString(WXIDPhotoSettings_t *settings, const char *key);
117
121WX_API const int *WXIDPhotoSettings_GetIntArray(WXIDPhotoSettings_t *settings, const char *key, int *size_p);
122
126WX_API const float *WXIDPhotoSettings_GetFloatArray(WXIDPhotoSettings_t *settings, const char *key, int *size_p);
127
129WX_API int WXIDPhotoSettings_HasKey(WXIDPhotoSettings_t *settings, const char *key);
130
133typedef enum WXGlassesType_e {
139 DarkGlasses = 2
141
165
168
172WX_API int WXIDPhotoPreDetectResult_GetInt(WXIDPhotoPreDetectResult_t *result, const char *key, int defValue);
173
177WX_API const float *WXIDPhotoPreDetectResult_GetFloatArray(WXIDPhotoPreDetectResult_t *result, const char *key);
178
182
190WX_API int WXIDPhoto_Create(WXDeviceType deviceType, WXIDPhoto_t **idphoto_p);
191
194
210 const WXImage_t *inImg,
211 const WXIDPhotoConfig_t *config,
212 const WXIDPhotoPreDetectResult_t *preResult,
213 WXImage_t **result_img_p);
214
229 const WXImage_t *inImg,
230 WXIDPhotoPreDetectResult_t **result_p);
231
236WX_API void WXIDPhoto_SetSettings(WXIDPhoto_t *idphoto, const WXIDPhotoSettings_t *settings);
237
238#ifdef __cplusplus
239}
240#endif
241
242#endif // WX_IDPHOTO_C_API_H_
Definition: wx_idphoto_c_api.h:21
WXImage_t * bgImage
背景图 背景图,从WXImage创建, nullptr,表示使用透明背景
Definition: wx_idphoto_c_api.h:65
int height
证件照高度
Definition: wx_idphoto_c_api.h:35
float topEmpty[2]
头顶空隙范围 人像头顶与证件照图片顶部的留空距离,取值范围0-1.0, 这是一个长度为2的数据,分别定义[最小值,最大值] 比如证件照高度为300像素,这里值设定为[0....
Definition: wx_idphoto_c_api.h:58
unsigned short dpi
分辨率dpi 证件照分辨率dpi, 默认为300
Definition: wx_idphoto_c_api.h:71
int width
证件照宽度
Definition: wx_idphoto_c_api.h:30
float eyesTop
人眼位于Y轴的位置 证件照中,人眼位于Y轴的位置,取值范围0-1.0,这个值决定人像高度 比如证件照高度为300像素,这里值设定为0.45, 则表示证件照中,人眼在Y轴中的位置位于 300*0....
Definition: wx_idphoto_c_api.h:49
float faceRatio
脸部宽度占比, 浮点型,取值范围0-1.0 比如证件照宽度为200像素,这里值设定为0.5, 则表示人脸宽度为100像素
Definition: wx_idphoto_c_api.h:42
int version
版本号,必须设置为:0
Definition: wx_idphoto_c_api.h:25
WXDeviceType
Definition: wx_api.h:21
WX_API void WXIDPhotoSettings_SetFloatArray(WXIDPhotoSettings_t *settings, const char *key, const float *arr, int size)
WX_API float WXIDPhotoSettings_GetFloat(WXIDPhotoSettings_t *settings, const char *key, float defValue)
WXGlassesType_e
Definition: wx_idphoto_c_api.h:133
@ NoGlasses
Definition: wx_idphoto_c_api.h:135
@ DarkGlasses
Definition: wx_idphoto_c_api.h:139
@ NormalGlasses
Definition: wx_idphoto_c_api.h:137
WX_API int WXIDPhoto_PreDetect(WXIDPhoto_t *idphoto, const WXImage_t *inImg, WXIDPhotoPreDetectResult_t **result_p)
struct WXIDPhotoSettings_t WXIDPhotoSettings_t
Definition: wx_idphoto_c_api.h:78
WX_API void WXIDPhotoSettings_Release(WXIDPhotoSettings_t *settings)
WX_API void WXIDPhotoSettings_SetBool(WXIDPhotoSettings_t *settings, const char *key, uint8_t value)
WX_API void WXIDPhoto_SetSettings(WXIDPhoto_t *idphoto, const WXIDPhotoSettings_t *settings)
WX_API int WXIDPhotoSettings_GetInt(WXIDPhotoSettings_t *settings, const char *key, int defValue)
WX_API int WXIDPhotoSettings_Create(WXIDPhotoSettings_t **settings_p)
WX_API void WXIDPhotoPreDetectResult_Release(WXIDPhotoPreDetectResult_t *result)
WX_API void WXIDPhotoSettings_SetInt(WXIDPhotoSettings_t *settings, const char *key, int value)
WX_API void WXIDPhotoSettings_SetFloat(WXIDPhotoSettings_t *settings, const char *key, float value)
WX_API const char * WXIDPhotoSettings_GetString(WXIDPhotoSettings_t *settings, const char *key)
WX_API const int * WXIDPhotoSettings_GetIntArray(WXIDPhotoSettings_t *settings, const char *key, int *size_p)
WX_API const float * WXIDPhotoSettings_GetFloatArray(WXIDPhotoSettings_t *settings, const char *key, int *size_p)
WX_API uint8_t WXIDPhotoSettings_GetBool(WXIDPhotoSettings_t *settings, const char *key, uint8_t defValue)
WX_API int WXIDPhoto_MakeIDPhoto(WXIDPhoto_t *idphoto, const WXImage_t *inImg, const WXIDPhotoConfig_t *config, const WXIDPhotoPreDetectResult_t *preResult, WXImage_t **result_img_p)
WX_API void WXIDPhotoSettings_SetIntArray(WXIDPhotoSettings_t *settings, const char *key, const int *arr, int size)
WX_API void WXIDPhoto_Release(WXIDPhoto_t *p)
WX_API void WXIDPhotoSettings_SetString(WXIDPhotoSettings_t *settings, const char *key, const char *str)
struct WXIDPhotoPreDetectResult_t WXIDPhotoPreDetectResult_t
Definition: wx_idphoto_c_api.h:164
struct WXIDPhoto_t WXIDPhoto_t
Definition: wx_idphoto_c_api.h:181
WX_API int WXIDPhotoPreDetectResult_GetInt(WXIDPhotoPreDetectResult_t *result, const char *key, int defValue)
WX_API int WXIDPhoto_Create(WXDeviceType deviceType, WXIDPhoto_t **idphoto_p)
WX_API const float * WXIDPhotoPreDetectResult_GetFloatArray(WXIDPhotoPreDetectResult_t *result, const char *key)
struct WXIDPhotoConfig_t WXIDPhotoConfig_t
WX_API int WXIDPhotoSettings_HasKey(WXIDPhotoSettings_t *settings, const char *key)
struct WXImage_t WXImage_t
Definition: wx_image_c_api.h:38