1 /* 2 * Copyright (C) 2014,2015 Thundersoft Corporation 3 * All rights Reserved 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef __TS_DETECTFACE_ENGINE_H__ 19 #define __TS_DETECTFACE_ENGINE_H__ 20 #include "ts_makeup_data.h" 21 #include "ts_makeup_image.h" 22 23 typedef void* TSHandle; 24 25 /*=========================================================================== 26 * FUNCTION : ts_detectface_create_context 27 * 28 * DESCRIPTION: create context.The method MUST call at first time. 29 * 30 * 31 * RETURN : TSHandle as the context handle 32 * 33 *==========================================================================*/ 34 TSHandle ts_detectface_create_context(); 35 36 37 /*=========================================================================== 38 * FUNCTION : ts_detectface_destroy_context 39 * 40 * DESCRIPTION: destroy context. The method MUST call at last time. 41 * Before you MUST call ts_detectface_create_context method 42 * to create context and get context handle. 43 * 44 * PARAMETERS : 45 * @param[in] contexTSHandle : The context handle pointer. 46 * 47 * 48 *==========================================================================*/ 49 void ts_detectface_destroy_context(TSHandle* contexTSHandle); 50 51 52 /*=========================================================================== 53 * FUNCTION : ts_detectface_detect 54 * 55 * DESCRIPTION: start detect.Before you MUST call ts_detectface_create_context method 56 * to create context and get context handle. 57 * 58 * PARAMETERS : 59 * @param[in] contexTSHandle : The context handle. 60 * @param[in] pInData : The TSMakeupData pointer.MUST not NULL. 61 * 62 * RETURN : int If less than zero failed, otherwise the number of the detected faces. 63 * 64 *==========================================================================*/ 65 int ts_detectface_detect(TSHandle contexTSHandle, TSMakeupData *pInData); 66 67 /*=========================================================================== 68 * FUNCTION : ts_detectface_detectEx 69 * 70 * DESCRIPTION: start detect.Before you MUST call ts_detectface_create_context method 71 * to create context and get context handle. 72 * 73 * PARAMETERS : 74 * @param[in] contexTSHandle : The context handle. 75 * @param[in] pInData : The TSMakeupDataEx pointer.MUST not NULL. 76 * 77 * RETURN : int If less than zero failed, otherwise the number of the detected faces. 78 * 79 *==========================================================================*/ 80 int ts_detectface_detectEx(TSHandle contexTSHandle, TSMakeupDataEx *pInData); 81 /*=========================================================================== 82 * FUNCTION : ts_detectface_get_face_info 83 * 84 * DESCRIPTION: get detected face information.Before you MUST call ts_detectface_detect method 85 * to detect face. 86 * 87 * PARAMETERS : 88 * @param[in] contexTSHandle : The context handle. 89 * @param[in] index : The face index.MUST > 0. 90 * @param[out] pFaceRect : The face rects.MUST not NULL. 91 * @param[out] leftEye : The left eye rect. 92 * @param[out] rightEye : The right eye rect. 93 * @param[out] pMouth : The mount rect. 94 * 95 * RETURN : TS_OK if success, otherwise failed. 96 * 97 *==========================================================================*/ 98 int ts_detectface_get_face_info(TSHandle contexTSHandle, int index, TSRect *pFaceRect, TSRect *leftEye, TSRect *rightEye, TSRect *pMouth); 99 100 #endif // __TS_DETECTFACE_ENGINE_H__ 101