bef_effect_ai_public_define.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. #ifndef EFFECT_SDK_BEF_EFFECT_AI_PUBLIC_DEFINE_H
  2. #define EFFECT_SDK_BEF_EFFECT_AI_PUBLIC_DEFINE_H
  3. #define BEF_INTENSITY_TYPE_NONE 0
  4. #define BEF_INTENSITY_TYPE_BEAUTY_WHITEN 1 // 美白
  5. #define BEF_INTENSITY_TYPE_BEAUTY_SMOOTH 2 // 磨平
  6. #define BEF_INTENSITY_TYPE_FACE_SHAPE 3 // 大眼/瘦脸
  7. #define BEF_INTENSITY_TYPE_BEAUTY_SHARP 9 // 锐化
  8. #define BEF_INTENSITY_TYPE_GLOBAL_FILTER_V2 12 // 滤镜
  9. #define BEF_INTENSITY_TYPE_BUILDIN_LIP 17 // 唇色
  10. #define BEF_INTENSITY_TYPE_BUILDIN_BLUSHER 18 // 腮红
  11. #ifdef BEF_SDK_API
  12. #undef BEF_SDK_API
  13. #endif
  14. //bef_framework_public_base_define
  15. # ifdef __cplusplus
  16. # ifdef _EFFECT_SDK_EXPORTS_
  17. # define BEF_SDK_API extern "C" __attribute__((visibility ("default")))
  18. # else
  19. # define BEF_SDK_API extern "C"
  20. # endif
  21. # else
  22. # ifdef _EFFECT_SDK_EXPORTS_
  23. # define BEF_SDK_API __attribute__((visibility ("default")))
  24. # else
  25. # define BEF_SDK_API
  26. # endif
  27. # endif
  28. typedef short int16_t;
  29. typedef int int32_t;
  30. typedef unsigned long long UINT64;
  31. // def effect handle
  32. typedef void *bef_effect_handle_t;
  33. // def effect result
  34. typedef int bef_effect_result_t;
  35. typedef int effect_result;
  36. // define bef_intensity_type
  37. typedef int bef_intensity_type;
  38. // start error code
  39. #define BEF_RESULT_SUC 0 // {zh} 成功返回 {en} Successful return
  40. #define BEF_RESULT_SUC_EMPTY_DRAW 1 // {zh} 成功返回 {en} Successful return
  41. #define BEF_RESULT_FAIL -1 // {zh} 内部错误,检查是否初始化,初始化是否成功 {en} Internal error, check whether initialization is successful
  42. #define BEF_RESULT_FILE_NOT_FIND -2 // {zh} 文件没找到,检查代码中的文件路径与实际路径是否匹配 {en} File not found, check whether the file path in the code matches the actual path
  43. #define BEF_RESULT_INVALID_INTERFACE -3 // {zh} 接口未实现,检查SDK是否具备该功能 {en} The interface is not implemented, check whether the SDK has this function
  44. #define BEF_RESULT_FILE_OPEN_FAILED -4 // {zh} 文件打开失败,检查文件是否存在,检查对目标文件是否有读写权限 {en} File opening failed, check whether the file exists, check whether there are read and write permissions on the target file
  45. #define BEF_RESULT_INVALID_EFFECT_HANDLE -5 // {zh} 无效的Effect句柄,检查是否初始化,初始化是否成功 {en} Invalid Effect handle to check whether initialization is successful
  46. #define BEF_RESULT_INVALID_EFFECT_MANAGER -6 // {zh} 无效的EffectManager,检查是否初始化,初始化是否成功 {en} Invalid EffectManager, check whether initialization is successful
  47. #define BEF_RESULT_INVALID_FEATURE_HANDLE -7 // {zh} 无效的Feature句柄,检查是否初始化,初始化是否成功 {en} Invalid Feature handle to check whether initialization is successful
  48. #define BEF_RESULT_INVALID_FEATURE -8 // {zh} 无效的Feature,检查是否初始化,初始化是否成功 {en} Invalid Feature, check whether initialization is successful
  49. #define BEF_RESULT_INVALID_RENDER_MANAGER -9 // {zh} 无效的RenderManager,检查是否初始化,初始化是否成功 {en} Invalid RenderManager, check whether initialization is successful
  50. #define BEF_RESULT_INVALID_ALG_RES -11 // {zh} 无效的算法结果,没有设置美颜等特效可能会有这个报错,大部分情况下可忽略 {en} Invalid algorithm results, no special effects such as beauty setting may have this error, which can be ignored in most cases
  51. #define BEF_RESULT_INVALID_ALG_FACE_RES -12 // {zh} 无效的人脸检测结果 {en} Invalid face detection results
  52. #define BEF_RESULT_INVALID_ALG_CAT_FACE_RES -13 // {zh} 无效的猫脸检测结果 {en} Invalid cat face test results
  53. #define BEF_RESULT_INVALID_ALG_HAND_RES -14 // {zh} 无效的手势检测结果 {en} Invalid gesture detection result
  54. #define BEF_RESULT_INVALID_ALG_BODY_RES -15 // {zh} 无效的人体检测结果 {en} Invalid human test results
  55. #define BEF_RESULT_ALG_INIT_FAIL -17 // {zh} 算法初始化失败 {en} Algorithm initialization failed
  56. #define BEF_RESULT_ALG_FACE_INIT_FAIL -21 // {zh} 人脸检测初始化失败 {en} Face detection initialization failed
  57. #define BEF_RESULT_ALG_FACE_106_CREATE_FAIL -22 // {zh} 人脸检测106算法创建失败,检查 license 是否有效,检查模型是否有效 {en} Face detection 106 algorithm creation failed, check whether the license is valid, check whether the model is valid
  58. #define BEF_RESULT_ALG_FACE_280_CREATE_FAIL -23 // {zh} 人脸检测280算法创建失败,检查 license 是否有效,检查模型是否有效 {en} Face detection 280 algorithm creation failed, check whether the license is valid, check whether the model is valid
  59. #define BEF_RESULT_ALG_FACE_PREDICT_FAIL -24 // {zh} 人脸检测预测失败,检查传入图像是否正确 {en} Face detection prediction failed, check whether the incoming image is correct
  60. #define BEF_RESULT_ALG_EXP_CREATE_FAIL -25 // {zh} 表情检测初始化失败,检查 license 是否有效,检查模型是否有效 {en} Expression detection initialization failed, check whether the license is valid, check whether the model is valid
  61. #define BEF_RESULT_ALG_HAND_CREATE_FAIL -26 // {zh} 创建手势算法失败,检查 license 是否有效,检查模型是否有效 {en} Failed to create gesture algorithm, check whether the license is valid, check whether the model is valid
  62. #define BEF_RESULT_ALG_HAND_PREDICT_FAIL -27 // {zh} 手势算法预测失败,检查传入图像是否正确 {en} Gesture algorithm failed to predict, check whether the incoming image is correct
  63. #define BEF_RESULT_INVALID_TEXTURE -36 // {zh} 无效的texture,检查传入 texture 是否正确 {en} Invalid texture, check whether the incoming texture is correct
  64. #define BEF_RESULT_INVALID_IMAGE_DATA -37 // {zh} 无效的图像数据,检查传入 buffer 是否正确 {en} Invalid image data, check whether the incoming buffer is correct
  65. #define BEF_RESULT_INVALID_IMAGE_FORMAT -38 // {zh} 无效的图片格式,检查传入的图像格式是否符合要求 {en} Invalid image format, check whether the incoming image format meets the requirements
  66. #define BEF_RESULT_INVALID_PARAM_TYPE -39 // {zh} 无效的参数类型,检查传入的参数是否符合要求 {en} Invalid parameter type, check whether the passed parameter meets the requirements
  67. #define BEF_RESULT_INVALID_RESOURCE_VERSION -40 // {zh} 资源文件指定sdk版本过高,检查资源文件是否正确 {en} The resource file specifies that the sdk version is too high, check whether the resource file is correct
  68. #define BEF_RESULT_INVALID_PARAM_VALUE -47 // {zh} 无效的参数值,检查传入的参数是否符合要求 {en} Invalid parameter value, check whether the passed parameter meets the requirements
  69. #define BEF_RESULT_SMASH_E_INTERNAL -101 // {zh} 未定义内部错误,请联系技术支持 {en} No internal error defined, please contact technical support
  70. #define BEF_RESULT_SMASH_E_NOT_INITED -102 // {zh} 未初始化相关资源,请联系技术支持 {en} Not initializing related resources, please contact technical support
  71. #define BEF_RESULT_SMASH_E_MALLOC -103 // {zh} 申请内存失败,请联系技术支持 {en} Failed to request memory, please contact technical support
  72. #define BEF_RESULT_SMASH_E_INVALID_PARAM -104 // {zh} 无效的参数,检查传入的参数是否符合要求 {en} Invalid parameter, check whether the passed parameter meets the requirements
  73. #define BEF_RESULT_SMASH_E_ESPRESSO -105 // {zh} ESPRESSO错误,请联系技术支持 {en} ESPRESSO error, please contact technical support
  74. #define BEF_RESULT_SMASH_E_MOBILECV -106 // {zh} MOBILECV错误,请联系技术支持 {en} MOBILECV error, please contact technical support
  75. #define BEF_RESULT_SMASH_E_INVALID_CONFIG -107 // {zh} 无效的配置,请检查传入授权文件路径是否正确,授权文件是否受损 {en} Invalid configuration, please check whether the path of the incoming authorization file is correct and whether the authorization file is damaged
  76. #define BEF_RESULT_SMASH_E_INVALID_HANDLE -108 // {zh} 无效的句柄,请检查传入授权文件路径是否正确,授权文件是否受损 {en} Invalid handle, please check whether the path of the incoming authorization file is correct and whether the authorization file is damaged
  77. #define BEF_RESULT_SMASH_E_INVALID_MODEL -109 // {zh} 无效的模型,请检查传入授权文件路径是否正确,授权文件是否受损 {en} Invalid model, please check whether the path of the incoming authorization file is correct and whether the authorization file is damaged
  78. #define BEF_RESULT_SMASH_E_INVALID_PIXEL_FORMAT -110 // {zh} 无效的图像格式,请检查传入图像格式是否在SDK支持的范围内 {en} Invalid image format, please check whether the incoming image format is within the scope supported by the SDK
  79. #define BEF_RESULT_SMASH_E_INVALID_POINT -111 // {zh} 无效的点,请检查传入接口的输入或输出变量是否为null {en} Invalid point, please check whether the input or output variable of the incoming interface is null
  80. #define BEF_RESULT_SMASH_E_REQUIRE_FEATURE_NOT_INIT -112 // {zh} 依赖模块没有初始化,请联系技术支持 {en} The dependency module is not initialized, please contact technical support
  81. #define BEF_RESULT_SMASH_E_NOT_IMPL -113 // {zh} 未实现的接口,请检查调用函数名和参数是否正确 {en} Unimplemented interface, please check whether the calling function name and parameters are correct
  82. #define BEF_RESULT_INVALID_LICENSE -114 // {zh} 无效的license,请检查授权文件路径是否正确,模型文件是否受损 {en} Invalid license, please check whether the authorization file path is correct and whether the model file is damaged
  83. #define BEF_RESULT_NULL_BUNDLEID -115 // {zh} Application/Bundle ID 为空,请检查传入bundle Id或ApplicationId是否为空 {en} Application/Bundle ID is empty, please check whether the incoming bundle Id or ApplicationId is empty
  84. #define BEF_RESULT_LICENSE_STATUS_INVALID -116 // {zh} 非法授权文件,请检查授权文件是否正确 {en} Illegal authorization file, please check whether the authorization file is correct
  85. #define BEF_RESULT_LICENSE_STATUS_EXPIRED -117 // {zh} 授权文件过期,请检查授权文件是否正确,是否需要更新 {en} The authorization file has expired, please check whether the authorization file is correct and whether it needs to be updated
  86. #define BEF_RESULT_LICENSE_STATUS_NO_FUNC -118 // {zh} 请求功能不匹配,请检查是否购买对应功能 {en} The request function does not match, please check whether to purchase the corresponding function
  87. #define BEF_RESULT_LICENSE_STATUS_ID_NOT_MATCH -119 // {zh} Application/Bundle ID 不匹配,请检查申请授权文件和应用的Application/BundleId是否一致 {en} Application/Bundle IDs do not match, please check whether the application authorization file is consistent with the application/BundleId of the application
  88. #define BEF_RESULT_LICENSE_BAG_NULL_PATH -120 // {zh} 授权包路径为空,请检查授权文件路径是否正确 {en} The path of the authorization package is empty, please check whether the path of the authorization file is correct
  89. #define BEF_RESULT_LICENSE_BAG_INVALID_PATH -121 // {zh} 错误的授权包路径,请检查传入sdk的路径是否正确 {en} Wrong authorization package path, please check whether the path passed into sdk is correct
  90. #define BEF_RESULT_LICENSE_BAG_TYPE_NOT_MATCH -122 // {zh} 授权包类型不匹配,请检查授权文件是否正确,是否损坏 {en} Authorization package type does not match, please check whether the authorization file is correct and damaged
  91. #define BEF_RESULT_LICENSE_BAG_INVALID_VERSION -123 // {zh} 无效的版本,请检查是否用了旧版本的授权文件 {en} Invalid version, please check whether the old version of the authorization file is used
  92. #define BEF_RESULT_LICENSE_BAG_INVALID_BLOCK_COUNT -124 // {zh} 无效的数据块,请检查授权文件是否正确,是否损坏 {en} Invalid data block, please check whether the authorization file is correct and damaged
  93. #define BEF_RESULT_LICENSE_BAG_INVALID_BLOCK_LEN -125 // {zh} 无效的数据块长度,请检查授权文件是否正确,是否损坏 {en} Invalid data block length, please check whether the authorization file is correct and damaged
  94. #define BEF_RESULT_LICENSE_BAG_INCOMPLETE_BLOCK -126 // {zh} 数据块不完整,请检查授权文件是否正确,是否损坏 {en} The data block is incomplete, please check whether the authorization file is correct and damaged
  95. #define BEF_RESULT_LICENSE_BAG_UNAUTHORIZED_FUNC -127 // {zh} license未授权的功能,请检查是否购买对应功能 {en} License unauthorized functions, please check whether to purchase corresponding functions
  96. #define BEF_RESULT_SDK_FUNC_NOT_INCLUDE -128 // {zh} SDK 未包含功能 {en} SDK does not include features
  97. #define BEF_RESULT_LICENSE_BAG_INVALID_SUB_FUNC -129 // {zh} 无效的subFunction,证书存在问题,请联系技术支持 {en} Invalid subFunction, there is a problem with the certificate, please contact technical support
  98. #define BEF_RESULT_GL_ERROR_OCCUR -150 // {zh} opengl发生错误,请检查是否在opengl线程调用接口 {en} An error occurred in opengl, please check whether the interface is called in the opengl thread
  99. #define BEF_RESULT_GL_CONTECT -151 // {zh} 无效的glcontext,请检查gl上下文是否正确 {en} Invalid glcontext, please check if the gl context is correct
  100. #define BEF_RESULT_GL_TEXTURE -152 // {zh} 无效的gltexture,请检查纹理号是否有效 {en} Invalid gltexture, please check whether the texture number is valid
  101. // Be Used in bach algorithm module
  102. #define BEF_RESULT_BACH_E_INVALID_RES_FINDER -153 // {zh} Bach算法模块错误,无效的ResourceFinder,请检查资源文件名或者路径是否正确 {en} Bach algorithm module error, invalid ResourceFinder, please check whether resource path or name is correct
  103. #define BEF_RESULT_BACH_E_NOT_INIT -154 // {zh} Bach算法模块错误,检查是否初始化,初始化是否成功 {en} Bach algorithm module error, check whether initialization is successful
  104. #define BEF_RESULT_BACH_E_INVALID_CONFIG -155 // {zh} Bach算法模块错误,无效的算法配置或参数,请检查配置文件或参数是否正确 {en} Bach algorithm module error, invalid algorithm config or param, please check whether input config or param is correct
  105. #define BEF_RESULT_BACH_E_INVALID_GRAPH -156 // {zh} Bach算法模块错误,无效的Graph定义,请检查初始化输入的Graph是否正确 {en} Bach algorithm module error, invalid Graph define, please check whether input Graph is correct
  106. #define BEF_RESULT_BACH_E_INVALID_MODEL -157 // {zh} Bach算法模块错误,无效的算法模型,请检查给定的模型或路径是否正确 {en} Bach algorithm module error, invalid algorith model, please check whether input model or path is correct
  107. #define BEF_RESULT_BACH_E_INVALID_TYPE -158 // {zh} Bach算法模块错误,无效的参数类型,请检查给定的参数类型是否正确 {en} Bach algorithm module error, invalid parameter type, please check whether input parameter type is correct
  108. #define BEF_RESULT_BACH_E_INVALID_NODE -159 // {zh} Bach算法模块错误,无效的算法结点,请检查算法的配置是否正确 {en} Bach algorithm module error, invalid algorithm node, please check whether algorithm config is correct
  109. #define BEF_RESULT_BACH_E_INVALID_FORMAT -160 // {zh} Bach算法模块错误,无效的图像格式,请检查输入图像格式是否正确 {en} Bach algorithm module error, invalid input picture format, please check whether input picture format is correct
  110. #define BEF_RESULT_BACH_E_INTERNAL_ERROR -161 // {zh} Bach算法模块错误,内部错误 {en} Bach algorithm module error, internal error
  111. /* {zh}
  112. ** 画质增强的错误码都放在这里
  113. */
  114. /* {en}
  115. ** The enhanced image error codes are all here
  116. */
  117. #define BEF_RESULT_IMAGE_QUALITY_CREATE_ENGINE_FAILED -64 // {zh} 画质增强引擎创建失败 {en} Image quality enhancement engine creation failed
  118. #define BEF_RESULT_IMAGE_QUALITY_CREATE_VIDEO_SR_FAILED -65 // {zh} 视频超分算法创建失败 {en} Video super-segmentation algorithm creation failed
  119. #define BEF_RESULT_IMAGE_QUALITY_CREATE_NIGHT_SCENE_FAILED -66 // {zh} 画质算法失败 {en} Image quality algorithm failed
  120. #define BEF_RESULT_INVALID_HANDLE -67 // {zh} 无效的画质算法handle {en} Invalid image quality algorithm handling
  121. #define BEF_RESULT_IMAGE_QUALITY_CREATE_ADAPTIVE_SHARPEN_FAILED -68 // {zh} 画质算法失败 {en} Image quality algorithm failed
  122. #define BEF_RESULT_IMAGE_QUALITY_ASP_UNDER_INIT -69 // {zh} 画质自适应锐化异步处理,设置完成会继续处理 {en} Image quality adaptive sharpening asynchronous processing, processing will continue after setting
  123. #define BEF_RESULT_IMAGE_QUALITY_VFI_NO_EXECUTION -70 // {zh} 插帧算法判断不需要插帧 {en} video frame insertion algorithm thinks no need to do execute
  124. #define BEF_RESULT_IMAGE_QUALITY_CREATE_ONEKEY_ENHANCE_FAILED -71 // {zh} 创建一键画质增强算法失败 {en} Image quality algorithm failed
  125. #define BEF_RESULT_IMAGE_QUALITY_ONEKEY_ENHANCE_NO_EXECUTION -72 // {zh} 画质增强算法判断不需要执行 {en} Image enhancement algorithm thinks as no need to execute
  126. #define BEF_RESULT_IMAGE_QUALITY_CREATE_VIDA_FAILED -73 // {zh} vida画质算法失败 {en} Image quality algorithm failed
  127. /*
  128. ** END
  129. */
  130. // end error code
  131. #define BEF_EFFECT_FEATURE_LEN 128 //feature name 默认长度
  132. typedef enum
  133. {
  134. BEF_AI_LOG_LEVEL_NONE = 0,
  135. BEF_AI_LOG_LEVEL_DEFAULT = 1,
  136. BEF_AI_LOG_LEVEL_VERBOSE = 2,
  137. BEF_AI_LOG_LEVEL_DEBUG = 3,
  138. BEF_AI_LOG_LEVEL_INFO = 4,
  139. BEF_AI_LOG_LEVEL_WARN = 5,
  140. BEF_AI_LOG_LEVEL_ERROR = 6,
  141. BEF_AI_LOG_LEVEL_FATAL = 7,
  142. BEF_AI_LOG_LEVEL_SILENT = 8,
  143. } bef_ai_log_level;
  144. typedef enum {
  145. BEF_AI_PREVIEW_MODE = 0, // 预览模式集成SDK
  146. BEF_AI_PICTURE_MODE = 1 //拍照模式下集成SDK
  147. } bef_ai_process_type;
  148. // bef_framework_public_geometry_define
  149. // @brief image rotate type definition
  150. typedef enum {
  151. BEF_AI_CLOCKWISE_ROTATE_0 = 0, // 图像不需要旋转,图像中的人脸为正脸
  152. BEF_AI_CLOCKWISE_ROTATE_90 = 1, // 图像需要顺时针旋转90度,使图像中的人脸为正
  153. BEF_AI_CLOCKWISE_ROTATE_180 = 2, // 图像需要顺时针旋转180度,使图像中的人脸为正
  154. BEF_AI_CLOCKWISE_ROTATE_270 = 3 // 图像需要顺时针旋转270度,使图像中的人脸为正
  155. } bef_ai_rotate_type;
  156. // ORDER!!!
  157. typedef enum {
  158. BEF_AI_PIX_FMT_RGBA8888, // RGBA 8:8:8:8 32bpp ( 4通道32bit RGBA 像素 )
  159. BEF_AI_PIX_FMT_BGRA8888, // BGRA 8:8:8:8 32bpp ( 4通道32bit RGBA 像素 )
  160. BEF_AI_PIX_FMT_BGR888, // BGR 8:8:8 24bpp ( 3通道32bit RGB 像素 )
  161. BEF_AI_PIX_FMT_RGB888, // RGB 8:8:8 24bpp ( 3通道32bit RGB 像素 )
  162. BEF_AI_PIX_FMT_GRAY8, // GRAY 8bpp ( 1通道8bit 灰度像素 ). 目前还不支持
  163. BEF_AI_PIX_FMT_YUV420P, // YUV 4:2:0 12bpp ( 3通道, 一个亮度通道, 另两个为U分量和V分量通道, 所有通道都是连续的 ). 目前还不支持
  164. BEF_AI_PIX_FMT_NV12, // YUV 4:2:0 12bpp ( 3通道, 一个亮度通道, 另一道为UV分量交错 ). 目前还不支持
  165. BEF_AI_PIX_FMT_NV21 // YUV 4:2:0 12bpp ( 3通道, 一个亮度通道, 另一道为VU分量交错 ). 目前还不支持
  166. } bef_ai_pixel_format;
  167. typedef struct bef_ai_fpoint_t {
  168. float x;
  169. float y;
  170. } bef_ai_fpoint;
  171. typedef struct bef_ai_fpoint3d_t {
  172. float x;
  173. float y;
  174. float z;
  175. } bef_ai_fpoint3d;
  176. typedef struct bef_ai_rect_t {
  177. int left; // Left most coordinate in rectangle. 矩形最左边的坐标
  178. int top; // Top coordinate in rectangle. 矩形最上边的坐标
  179. int right; // Right most coordinate in rectangle. 矩形最右边的坐标
  180. int bottom; // Bottom coordinate in rectangle. 矩形最下边的坐标
  181. } bef_ai_rect;
  182. // Same definiation as bef_rect, but in float type
  183. // 和bef_rect一样的定义,类型为单精度浮点
  184. typedef struct bef_ai_rectf_t {
  185. float left;
  186. float top;
  187. float right;
  188. float bottom;
  189. } bef_ai_rectf;
  190. typedef enum bef_ai_camera_position_t {
  191. bef_ai_camera_position_front,
  192. bef_ai_camera_position_back
  193. } bef_ai_camera_position;
  194. typedef struct bef_ai_frect_st {
  195. float left; ///< 矩形最左边的坐标
  196. float top; ///< 矩形最上边的坐标
  197. float right; ///< 矩形最右边的坐标
  198. float bottom; ///< 矩形最下边的坐标
  199. } bef_ai_frect;
  200. typedef struct bef_ai_image_t {
  201. const unsigned char *data;
  202. int width;
  203. int height;
  204. int stride;
  205. int format;
  206. bef_ai_rotate_type rotate;
  207. } bef_ai_image;
  208. typedef struct bef_ai_tt_key_point_st {
  209. float x; // 对应 cols, 范围在 [0, width] 之间
  210. float y; // 对应 rows, 范围在 [0, height] 之间
  211. bool is_detect; // 如果该值为 false, 则 x,y 无意义
  212. } bef_ai_tt_key_point;
  213. typedef struct {
  214. const unsigned char* image; ///< 图像帧数据地址
  215. bef_ai_pixel_format pixel_fmt; ///< 图像格式
  216. int image_width; ///< 图像的宽度
  217. int image_height; ///< 图像的高度
  218. int image_stride; ///< 图像的步长(每行的字节数,可能存在padding)
  219. bef_ai_rotate_type orient; ///< 图像的方向
  220. } bef_ai_base_args;
  221. typedef enum {
  222. bef_ai_render_api_gles20 = 0,
  223. bef_ai_render_api_gles30,
  224. } bef_ai_render_api_type;
  225. typedef enum {
  226. BEF_AI_TOUCH_EVENT_BEGAN, ///< 触摸开始事件
  227. BEF_AI_TOUCH_EVENT_MOVED, ///< 触摸移动事件
  228. BEF_AI_TOUCH_EVENT_STATIONARY, ///< 触摸驻停事件
  229. BEF_AI_TOUCH_EVENT_ENDED, ///< 触摸结束事件
  230. BEF_AI_TOUCH_EVENT_CANCELLED, ///< 触摸取消事件
  231. } bef_ai_touch_event_code;
  232. typedef enum {
  233. BEF_AI_GESTURE_TAP, ///< 单击手势
  234. BEF_AI_GESTURE_PAN, ///< 滑动手势
  235. BEF_AI_GESTURE_ROTATE, ///< 旋转手势
  236. BEF_AI_GESTURE_SCALE, ///< 缩放手势
  237. BEF_AI_GESTURE_LONG_PRESS, ///< 长按手势
  238. BEF_AI_GESTURE_DOUBLE_CLICK ///< 双击手势
  239. } bef_ai_gesture_event_code;
  240. typedef enum {
  241. BEF_EFFECT = 0,
  242. BEF_FACE,
  243. BEF_C1,
  244. BEF_C2,
  245. BEF_CAR_DETECT,
  246. BEF_FACE_ATTR,
  247. BEF_FACE_CLUSTERING,
  248. BEF_FACE_VERIFY,
  249. BEF_GAZE_ESTIMATION,
  250. BEF_HAIR_PARSE,
  251. BEF_HAND_DETECT,
  252. BEF_HEAD_SEG,
  253. BEF_LIGHT_CLS,
  254. BEF_SKENETON,
  255. BEF_AVATAR_DRIVE,
  256. BEF_ACTION_RECOGNETION,
  257. BEF_SKY_SEG,
  258. BEF_VIDEO_CLS,
  259. BEF_STUDENT_ID_OCR,
  260. BEF_HUMAN_DISTANCE,
  261. BEF_PET_FACE,
  262. BEF_PORTRAIT_MATTING,
  263. BEF_ADAPTIVE_SHARPEN,
  264. BEF_VFI,
  265. BEF_ONEKEY_ENHANCE,
  266. BEF_LENS_VIDA,
  267. BEF_TAINT_DETECT,
  268. BEF_SKELETON_3D,
  269. BEF_SALIENCY_MATTING,
  270. BEF_VIDEO_DEFLICKER,
  271. BEF_VIDEO_SR,
  272. BEF_NIGHT_SCENE,
  273. BEF_PHOTO_NIGHT_SCENE,
  274. BEF_DYNAMIC_GESTURE,
  275. BEF_LICENSE_CAKE,
  276. BEF_BACH_SKELETON,
  277. BEF_CHROMA_KEYING,
  278. BEF_SKIN_SEGMENTATION,
  279. BEF_SLAM,
  280. BEF_FACEFITTING,
  281. BEF_CINE_MOVE,
  282. BEF_AVABOOST,
  283. BEF_OBJECT_TRACKING,
  284. BEF_VIDEO_HDR_LITE,
  285. BEF_VIDEO_STAB
  286. } bef_ai_license_function_type;
  287. typedef char*(*bef_ai_resource_finder)(bef_effect_handle_t, const char *, const char *);
  288. typedef int(*bef_ai_log_callback)(int logLevel, const char* msg);
  289. #define EFFECT_HAND_DETECT_DELAY_FRAME_COUNT 4
  290. ///部分贴纸需要与客户端通过消息交互
  291. #define BEF_EFFECT_MESSAGE_TRIGGER_CAPUTURE_IMAGE 2200 /// <触发贴纸截图 客户端发给sdk
  292. #define BEF_EFFECT_MESSAGE_RECEIVE_CAPUTURE_IMAGE 0x45 /// <获取贴纸截图 sdk发给客户端
  293. #define BEF_EFFECT_MESSAGE_OPERATE_CLIENT_UI 0x30 /// <客户端接收sdk消息来控制UI sdk发给客户端
  294. #define ALGORITHM_DETECT_MIN_SIZE 720
  295. #define FORCE_ALGORITM_IMAGE_POSITIVE false
  296. #endif