From 6616278131edd80a12545085e06ee6b0e0a0a788 Mon Sep 17 00:00:00 2001 From: Prateek Chaubey Date: Sun, 7 Jan 2018 20:55:14 +0530 Subject: msm8996-common: zuk: Import OSS Camera HAL Tag: LA.HB.1.3.2-32600-8x96.0 Signed-off-by: Davide Garberi --- .../HAL/tsMakeuplib/include/ts_detectface_engine.h | 100 +++++++++++++++++++++ .../HAL/tsMakeuplib/include/ts_makeup_data.h | 49 ++++++++++ .../HAL/tsMakeuplib/include/ts_makeup_engine.h | 95 ++++++++++++++++++++ .../HAL/tsMakeuplib/include/ts_makeup_image.h | 46 ++++++++++ 4 files changed, 290 insertions(+) create mode 100644 camera/QCamera2/HAL/tsMakeuplib/include/ts_detectface_engine.h create mode 100644 camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_data.h create mode 100644 camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_engine.h create mode 100644 camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_image.h (limited to 'camera/QCamera2/HAL/tsMakeuplib/include') diff --git a/camera/QCamera2/HAL/tsMakeuplib/include/ts_detectface_engine.h b/camera/QCamera2/HAL/tsMakeuplib/include/ts_detectface_engine.h new file mode 100644 index 0000000..5197447 --- /dev/null +++ b/camera/QCamera2/HAL/tsMakeuplib/include/ts_detectface_engine.h @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2014,2015 Thundersoft Corporation + * All rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TS_DETECTFACE_ENGINE_H__ +#define __TS_DETECTFACE_ENGINE_H__ +#include "ts_makeup_data.h" +#include "ts_makeup_image.h" + + typedef void* TSHandle; + + /*=========================================================================== + * FUNCTION : ts_detectface_create_context + * + * DESCRIPTION: create context.The method MUST call at first time. + * + * + * RETURN : TSHandle as the context handle + * + *==========================================================================*/ + TSHandle ts_detectface_create_context(); + + + /*=========================================================================== + * FUNCTION : ts_detectface_destroy_context + * + * DESCRIPTION: destroy context. The method MUST call at last time. + * Before you MUST call ts_detectface_create_context method + * to create context and get context handle. + * + * PARAMETERS : + * @param[in] contexTSHandle : The context handle pointer. + * + * + *==========================================================================*/ + void ts_detectface_destroy_context(TSHandle* contexTSHandle); + + + /*=========================================================================== + * FUNCTION : ts_detectface_detect + * + * DESCRIPTION: start detect.Before you MUST call ts_detectface_create_context method + * to create context and get context handle. + * + * PARAMETERS : + * @param[in] contexTSHandle : The context handle. + * @param[in] pInData : The TSMakeupData pointer.MUST not NULL. + * + * RETURN : int If less than zero failed, otherwise the number of the detected faces. + * + *==========================================================================*/ + int ts_detectface_detect(TSHandle contexTSHandle, TSMakeupData *pInData); + + /*=========================================================================== + * FUNCTION : ts_detectface_detectEx + * + * DESCRIPTION: start detect.Before you MUST call ts_detectface_create_context method + * to create context and get context handle. + * + * PARAMETERS : + * @param[in] contexTSHandle : The context handle. + * @param[in] pInData : The TSMakeupDataEx pointer.MUST not NULL. + * + * RETURN : int If less than zero failed, otherwise the number of the detected faces. + * + *==========================================================================*/ + int ts_detectface_detectEx(TSHandle contexTSHandle, TSMakeupDataEx *pInData); + /*=========================================================================== + * FUNCTION : ts_detectface_get_face_info + * + * DESCRIPTION: get detected face information.Before you MUST call ts_detectface_detect method + * to detect face. + * + * PARAMETERS : + * @param[in] contexTSHandle : The context handle. + * @param[in] index : The face index.MUST > 0. + * @param[out] pFaceRect : The face rects.MUST not NULL. + * @param[out] leftEye : The left eye rect. + * @param[out] rightEye : The right eye rect. + * @param[out] pMouth : The mount rect. + * + * RETURN : TS_OK if success, otherwise failed. + * + *==========================================================================*/ + int ts_detectface_get_face_info(TSHandle contexTSHandle, int index, TSRect *pFaceRect, TSRect *leftEye, TSRect *rightEye, TSRect *pMouth); + +#endif // __TS_DETECTFACE_ENGINE_H__ diff --git a/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_data.h b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_data.h new file mode 100644 index 0000000..ac43713 --- /dev/null +++ b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_data.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014,2015 Thundersoft Corporation + * All rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TS_MAKEUP_DATA_H__ +#define __TS_MAKEUP_DATA_H__ + + #define TS_OK (0x00000000) //Successful + #define TS_ERROR_PARAM (0x00000001) //Parameters error + #define TS_ERROR_IO (0x00000002) //Input or output error + #define TS_ERROR_INTERNAL (0x00000003) //Internal error + #define TS_NO_MEMORY (0x00000004) //No memory error + + + /* + * Data struct : rectangle + */ + typedef struct __tag_tsrect + { + long left; + long top; + long right; + long bottom; + } TSRect; + + /* + * Data struct : point + */ + typedef struct __tag_tsmakeuppoint + { + long x; + long y; + } TSPoint; + + +#endif // __TS_MAKEUP_DATA_H__ diff --git a/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_engine.h b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_engine.h new file mode 100644 index 0000000..375130d --- /dev/null +++ b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_engine.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2014,2015 Thundersoft Corporation + * All rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TS_MAKEUP_ENGINI_H__ +#define __TS_MAKEUP_ENGINI_H__ +#include "ts_makeup_data.h" +#include "ts_makeup_image.h" + + + /* + * FUNCTION : ts_makeup_get_supported_face_num + * + * DESCRIPTION: get supported face number + * + * RETURN : The supported face number + * + */ + int ts_makeup_get_supported_face_num(); + + + /* + * FUNCTION : ts_makeup_skin_beauty + * + * DESCRIPTION: skin beauty method. + * + * PARAMETERS : + * @param[in] pInData : The TSMakeupData pointer.MUST not NULL. + * @param[out] pOutData : The TSMakeupData pointer.MUST not NULL. + * @param[in] pFaceRect : The face rect.MUST not NULL. + * @param[in] cleanLevel : Skin clean level, value range [0,100]. + * @param[in] whiteLevel : Skin white level, value range [0,100]. + * RETURN : TS_OK if success, otherwise failed. + * + */ + int ts_makeup_skin_beauty(TSMakeupData *pInData, TSMakeupData *pOutData, const TSRect *pFaceRect, int cleanLevel,int whiteLevel); + /* + * FUNCTION : ts_makeup_skin_beautyEx + * + * DESCRIPTION: skin beauty method. + * + * PARAMETERS : + * @param[in] pInData : The TSMakeupDataEx pointer.MUST not NULL. + * @param[out] pOutData : The TSMakeupDataEx pointer.MUST not NULL. + * @param[in] pFaceRect : The face rect.MUST not NULL. + * @param[in] cleanLevel : Skin clean level, value range [0,100]. + * @param[in] whiteLevel : Skin white level, value range [0,100]. + * RETURN : TS_OK if success, otherwise failed. + * + */ + int ts_makeup_skin_beautyEx(TSMakeupDataEx *pInData, TSMakeupDataEx *pOutData, const TSRect *pFaceRect, int cleanLevel, int whiteLevel); + /* + * FUNCTION : ts_makeup_finish + * + * DESCRIPTION: Finish makeup,call this method at last time. + * This method MUST be called After ts_makeup_skin_clean and ts_makeup_skin_whiten + * + */ + void ts_makeup_finish(); + + + /* + * FUNCTION : ts_makeup_warp_face + * + * DESCRIPTION: do warp face. + * + * PARAMETERS : + * @param[in] pInData : The TSMakeupData pointer.MUST not NULL. + * @param[out] pOutData : The TSMakeupData pointer.MUST not NULL. + * @param[in] pLeftEye : The left eye rect pointer.MUST not NULL. + * @param[in] pRightEye : The right eye rect pointer.MUST not NULL. + * @param[in] pMouth : The mouth rect pointer.MUST not NULL. + * @param[in] bigEyeLevel : The big eye level, value range [0,100]. + * @param[in] trimFaceLevel : The trim face level, value range [0,100]. + * + * RETURN : TS_OK if success, otherwise failed. + * + */ + int ts_makeup_warp_face(TSMakeupData *pInData, TSMakeupData *pOutData, + const TSRect *pLeftEye, const TSRect *pRightEye, const TSRect *pMouth, int bigEyeLevel, int trimFaceLevel); + +#endif // __TS_MAKEUP_ENGINI_H__ diff --git a/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_image.h b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_image.h new file mode 100644 index 0000000..5621d3f --- /dev/null +++ b/camera/QCamera2/HAL/tsMakeuplib/include/ts_makeup_image.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2014,2015 Thundersoft Corporation + * All rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TS_MAKEUP_IMGAGE_H__ +#define __TS_MAKEUP_IMGAGE_H__ + + /* + * Data struct : TSMakeupData + */ + typedef struct __tag_tsmakeupdata + { + int frameWidth; //NV21 Frame width.MUST > 0. + int frameHeight; //NV21 Frame height. MUST > 0. + unsigned char *yBuf; //NV21 Y buffer pointer.MUST not null. + unsigned char *uvBuf; //NV21 UV buffer pointer.MUST not null. + }TSMakeupData; + + /* + * Data struct : TSMakeupDataEx + */ + typedef struct __tag_tsmakeupdataEx + { + int frameWidth; //NV21 Frame width.MUST > 0. + int frameHeight; //NV21 Frame height. MUST > 0. + unsigned char *yBuf; //NV21 Y buffer pointer.MUST not null. + unsigned char *uvBuf; //NV21 UV buffer pointer.MUST not null. + int yStride; //NV21 Y buffer stride len + int uvStride; //NV21 uv buffer stride len + }TSMakeupDataEx; + + +#endif // __TS_MAKEUP_IMGAGE_H__ -- cgit v1.2.3