/**********************************************************************************
 *
 * Copyright (c) 2019-2022 Beijing AXera Technology Co., Ltd. All Rights Reserved.
 *
 * This source file is the property of Beijing AXera Technology Co., Ltd. and
 * may not be copied or distributed in any isomorphic form without the prior
 * written consent of Beijing AXera Technology Co., Ltd.
 *
 **********************************************************************************/
#ifndef _SAMPLE_RUN_JOINT_API_H_
#define _SAMPLE_RUN_JOINT_API_H_

#include "ax_global_type.h"

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct _sampleRunJoint_RECT_S
    {
        float x;
        float y;
        float w;
        float h;
    } sampleRunJoint_RECT_S;

    typedef struct _sampleRunJoint_POINT_S
    {
        float x;
        float y;
        float score;
    } sampleRunJoint_POINT_S;
    

    typedef struct _sampleRunJoint_MAT_S
    {
        int w, h, c, s;
        unsigned char *data;
    } sampleRunJoint_MAT_S;

    typedef struct _sampleRunJoint_OBJECT_ITEM_S
    {
        unsigned int labelId;
        char labelName[20];
        sampleRunJoint_RECT_S stRect;
        unsigned int nLandmark;
        sampleRunJoint_POINT_S *landmark;
        sampleRunJoint_MAT_S mMask; // cv::Mat
        float prob;
    } sampleRunJoint_OBJECT_ITEM_S;

    typedef struct _sampleRunJoint_RESULT_S
    {
        unsigned int nObjectSize;
        unsigned int nWidth;
        unsigned int nHeight;
        int bHasMask;
        int bHasLandmark;
        sampleRunJoint_OBJECT_ITEM_S *pstObjectItems;
    } sampleRunJoint_RESULT_S;
    
    extern int SampleRunJointInit(const char *pStrModel, void **ppJointHandle,const int s32ModelType);
    extern int SampleRunJointDeInit(void *joint_handle);
    extern int SampleRunJointProcess(void *joint_handle, const AX_VIDEO_FRAME_S *pstFrame, sampleRunJoint_RESULT_S **ppResult);
    extern int SampleRunJointReleaseResult(void *pResult);

#ifdef __cplusplus
}
#endif

#endif /* _SAMPLE_RUN_JOINT_API_H_ */
