////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  camxfdengineinterface.h
/// @brief interface definition for Face Detection Engine
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CAMXFDENGINEINTERFACE_H
#define CAMXFDENGINEINTERFACE_H

#include "camxdefs.h"
#include "chifdproperty.h"

CAMX_NAMESPACE_BEGIN

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

typedef VOID* FDEngineHandle;  ///< FD Engine handle
static const VOID* FDEngineInvalidHandle = NULL;

static const FDEngineHandle InvalidFDEngineHandle = NULL;

static const CamxResultExt CamxResultExtBITMLInitFailure            = CamxResultExtFDBase + 32;
static const CamxResultExt CamxResultExtBITMLRegistrationInProgress = CamxResultExtFDBase + 33;
static const CamxResultExt CamxResultExtBITMLRegistrationFailure    = CamxResultExtFDBase + 34;
static const CamxResultExt CamxResultExtBITMLSSRRecovering          = CamxResultExtFDBase + 35;
static const CamxResultExt CamxResultExtBITMLSSRRecoverFailure      = CamxResultExtFDBase + 36;

/// Max Image Planes
static const UINT32 MaxPlaneCount = 3;

/// @brief FDEngine Image Plane Type
enum PlaneType
{
    Y = 0,  ///< Luma plane
    CB_CR,  ///< CbCr plane
    CR_CB   ///< CrCb plane
};

/// @brief FDEngine Image Plane
struct ImagePlane
{
    PlaneType   type;       ///< Plane type
    UINT8*      pBuffer;     ///< Plane buffer location
    UINT32      stride;     ///< Stride of Image Plane
    UINT32      scanline;   ///< Scanline of image plane
};

/// @brief FDEngine Image Type
struct FDEngineImage
{
    UINT32      width;                  ///< Image width
    UINT32      height;                 ///< Image height
    UINT32      planeCount;             ///< Number of planes
    ImagePlane  planes[MaxPlaneCount];  ///< Plane information
    INT32       fd;                     ///< fd of buffer
};

/// @brief enumerates detection operation runtime choice
enum FDEngineClientType
{
    ClientHW = 0,   ///< Client type HW
    ClientDSP,      ///< Client type DSP
    ClientSW        ///< Client type SW
};

/// @brief DT parameters
struct FDEngineDTParams
{
    INT32               minFaceSize;                             ///< Minimum Face size for detection.
};

/// @brief CT parameters
struct FDEngineCTParams
{
    UINT32                   dlMinFaceSize;             ///< Minimum face size for Deep Learning contour detection
    INT32                    dlYawAngleCutoff;          ///< Yaw Angle Cutoff for Deep Learning contour detection
    FDContourResultVersion   resultVersion;             ///< mode for CT result
    UINT16                   numPoints;                 ///< Number of FL landmark indices.
    UINT16                   pointIndex[FDContourV4Max];///< FL indices array.
};

/// @brief DSP paramters
struct FDEngineDSPParams
{
    UINT8   majorVersion;   ///< Major version of DSP library
    UINT8   minorVersion;   ///< Minor version of DSP library
    INT32   absapi;         ///< Whether to use dsp abs api
    INT32   clock;          ///< DSP clock speed
    INT32   bus;            ///< DSP bus bandwidth
    INT32   latency;        ///< DSP HW latency
    INT32   dcvsClock;      ///< DCVS dsp target corner clock Range 0 to 6
    BOOL    enableDCVS;     ///< Whether to enable DSP dcvs
};

struct FDHeadBodyROI
{
    UINT32      confidence;   ///< Confidence that a real head/body is detected.
    CHIPoint    center;       ///< Center of the ROI.
    UINT32      width;        ///< Width of the ROI.
    UINT32      height;       ///< Height of the ROI.
    INT32       rollAngle;    ///< Roll angle of the ROI.
};

struct FDHeadBodyInfo
{
    INT32           headId;       ///< ID of the head
    INT32           linkedFaceId; ///< ID of the face associated with the head/body
    FDHeadBodyROI   headROI;      ///< Array of head detected that have head information
    BOOL            torsoValid;   ///< Indicates whether torso ROI is valid.
    FDHeadBodyROI   torsoROI;     ///< Array of torso detected that have torso information
    INT32           history;      ///< History of the face attributes.
    INT32           weight;       ///< Weight of each face per the size, distance from center, and history.
};

struct FDHeadBodyResults
{
    UINT32          numHeads;                       ///< Number of head is detected
    FDHeadBodyInfo  headBodyInfo[FDMaxFaceCount];   ///< Array of head/body detected that have head/body information
};

struct FDIntermediateHeadBodyResults
{
    UINT32          numHeads;                                   ///< Number of head is detected
    FDHeadBodyInfo  headBodyInfo[FDMaxFaceCountIntermediate];   ///< Array of intermediate head that were detected with head
                                                                ///  body information.
};

/// @brief FD FDEngineROIMgrConfig config
struct FDEngineROIMgrConfig
{
    INT32   holdCount;                       ///< Hold count
    INT32   delayCount;                      ///< Delay count
    INT32   swThreshold;                     ///< Face detection threshold
    INT32   swTrackingThreshold;             ///< Face tracking threshold
    FLOAT   tolMoveDist;                     ///< Tolerance for moving distance
    FLOAT   tolSizeRatioMin;                 ///< Minimum allowance of size ratio
    FLOAT   tolSizeRatioMax;                 ///< Maximum allowance of size ratio
    FLOAT   tolAngle;                        ///< Tolerance for angle variation
    INT32   strictSwThreshold;               ///< Strict face detection threshold
    INT32   strictSwTrackingThreshold;       ///< Strict face tracking threshold
    INT32   angleDiffForStrictThreshold;     ///< Angle difference for Strict thresholds
    INT32   smallSwThreshold;                ///< Small face detection threshold
    INT32   smallSwTrackingThreshold;        ///< Small face tracking threshold
    INT32   smallFaceSizeCutoff;             ///< Small face size cutoff
    INT32   yawSwThreshold;                  ///< Yaw face detection threshold
    INT32   yawSwTrackingThreshold;          ///< Yaw face tracking threshold
    BOOL    enableDynamicFPSControl;         ///< Enable the new face tracker with dynamic FD FPS control
    INT32   frameWidth;                      ///< Input image width
    INT32   frameHeight;                     ///< Input image height
    INT32   maxNumFacesToTrack;              ///< Maximum number of faces to be tracked
    INT32   fullHistoryLength;               ///< Size of the full historical data stored for tracking
    INT32   positionRecentHistoryLength;     ///< Size of recent historical data for ROI position; samples in recent history
                                             ///  are used to assess the internal prediction errors
    FLOAT   positionMotionThreshold;         ///< Changes in position values above this threshold, are considered
                                             ///  mainly due to face motion
    FLOAT   positionStillThreshold;          ///< Changes in position values below this threshold, are considered
                                             ///  mainly due to noise
    INT32   sizeRecentHistoryLength;         ///< Size of recent historical data for ROI position; samples in recent history
                                             ///  are used to assess the internal prediction errors
    FLOAT   sizeMotionThreshold;             ///< Changes in size values above this threshold, are considered
                                             ///  mainly due to face motion
    FLOAT   sizeStillThreshold;              ///< Changes in size values below this threshold, are considered
                                             ///  mainly due to noise
    FLOAT   noFaceFDFPSScale;                ///< FPS at which FD should run when no faces are detected, specified as a
                                             ///  scale factor relative to the tracker/preview FPS
    FLOAT   stillFaceFDFPSScale;             ///< FPS at which FD should run when faces are very still/static, specified as a
                                             ///  scale factor relative to tracker/preview FPS
    FLOAT   movingFaceMinFDFPSScale;         ///< FPS at which FD should run when faces are moving slowly (in a predictable
                                             ///  manner), specified as a scale factor relative to tracker/preview FPS
    FLOAT   movingFaceMaxFDFPSScale;         ///< Maximum FPS at which FD can run, usually when faces are moving in adhoc
                                             ///  fashion, specified as a scale factor relative to tracker/preview FPS
                                             ///  faces are moving in adhoc fashion
    FLOAT   stillFaceFDFPSThreshold;         ///< Mean error in the ROI position and size up to which a still face can
                                             ///  tolerate
    FLOAT   movingFaceMaxFDFPSThreshold;     ///< Maximum mean error in the ROI position and size that can be tolerated
                                             ///  before switching to a higher FPS
    INT32   waitCountForFPSSwitching;        ///< Number of frames to wait before making switch to lower FPS
    INT32   initialNoFrameSkipCount;         ///< Initial number of frames that are always processed for face detection
    INT32   newMaskConfidence;               ///< New mask confidence threshold
    INT32   trackingMaskConfidence;          ///< Minimum confidence needed to continue tracking a facial mask
    INT32   maskHoldCount;                   ///< 'holdCount' for mask tracking
    INT32   maskDelayCount;                  ///< 'delayCount' for mask tracking
    INT32   maskPositionRecentHistoryLength; ///< 'positionRecentHistoryLength' for mask tracking
    FLOAT   maskPositionMotionThreshold;     ///< 'positionMotionThreshold' for mask tracking
    FLOAT   maskPositionStillThreshold;      ///< 'positionStillThreshold' for mask tracking
    INT32   maskSizeRecentHistoryLength;     ///< 'sizeRecentHistoryLength' for mask tracking
    FLOAT   maskSizeMotionThreshold;         ///< 'sizeMotionThreshold' for mask tracking
    FLOAT   maskSizeStillThreshold;          ///< 'sizeStillThreshold' for mask tracking
    INT32   sparseLMRecentHistoryLength;     ///< 'positionRecentHistoryLength' for tracking of sparse landmarks
    FLOAT   sparseLMMotionThreshold;         ///< 'positionMotionThreshold' for tracking of sparse landmarks
    FLOAT   sparseLMStillThreshold;          ///< 'positionStillThreshold' for tracking of sparse landmarks
    INT32   newHeadConfidence;               ///< New head confidence threshold
    INT32   trackingHeadConfidence;          ///< Minimum confidence needed to continue tracking head
    INT32   headHoldCount;                   ///< 'holdCount' for head tracking
    INT32   headDelayCount;                  ///< 'delayCount' for head tracking
    INT32   headPositionRecentHistoryLength; ///< 'positionRecentHistoryLength' for head tracking
    FLOAT   headPositionMotionThreshold;     ///< 'positionMotionThreshold' for head tracking
    FLOAT   headPositionStillThreshold;      ///< 'positionStillThreshold' for head tracking
    INT32   headSizeRecentHistoryLength;     ///< 'sizeRecentHistoryLength' for head tracking
    FLOAT   headSizeMotionThreshold;         ///< 'sizeMotionThreshold' for head tracking
    FLOAT   headSizeStillThreshold;          ///< 'sizeStillThreshold' for head tracking
    INT32   newBodyConfidence;               ///< New body confidence threshold
    INT32   trackingBodyConfidence;          ///< Minimum confidence needed to continue tracking body
    INT32   bodyHoldCount;                   ///< 'holdCount' for body tracking
    INT32   bodyDelayCount;                  ///< 'delayCount' for body tracking
    INT32   bodyPositionRecentHistoryLength; ///< 'positionRecentHistoryLength' for body tracking
    FLOAT   bodyPositionMotionThreshold;     ///< 'positionMotionThreshold' for body tracking
    FLOAT   bodyPositionStillThreshold;      ///< 'positionStillThreshold' for body tracking
    INT32   bodySizeRecentHistoryLength;     ///< 'sizeRecentHistoryLength' for body tracking
    FLOAT   bodySizeMotionThreshold;         ///< 'sizeMotionThreshold' for body tracking
    FLOAT   bodySizeStillThreshold;          ///< 'sizeStillThreshold' for body tracking
};

/// @brief Configuration parameter of Face Detection Engine
struct FDEngineConfig
{
    BOOL                    enableFaceMask;      ///< Whether to enable Face Mask Detection
    BOOL                    enableFaceHeadBody;  ///< Whether to enable Head and Body Detection
    BOOL                    enableContour;       ///< Whether to enable Coutour exexution
    BOOL                    supportRectROI;      ///< Toggle to switch between rectangular and square ROI
    FDEngineDTParams        paramsDT;            ///< DT config parameters
    FDEngineCTParams        paramsCT;            ///< CT config parameters
    FDEngineDSPParams       paramsDSP;           ///< DSP config parameters
    FDEngineROIMgrConfig    ROIMgrConfig;        ///< ROI Manager config parameters
};

/// @brief enumerates DLFD version
enum FDEngineDLFDVersion
{
    DLFD_NOT_VALID = -1,  ///< Not valid
    DLFDV4 = 0x040000,    ///< 6 digits: <MajorVersion> <MinorVersion> <Patch> DLFD V4.0.0
    DLFDV45 = 0x040500,   ///< 6 digits: <MajorVersion> <MinorVersion> <Patch> DLFD V4.5.0
};

/// @brief enumerates BITML network version
enum FDEngineNetworkVersion
{
    V68 = 0, ///< v68 version network
    V73,     ///< v73 version network
};

/// @brief Initialization parameters
struct FDEngineCreateParams
{
    BOOL                    createROIManager;         ///< Create FD engine with ROI manager
    BOOL                    createDLFD;               ///< Create FD engine with DL-FD solution
    BOOL                    createDLFacialContour;    ///< Create FL engine with DL-FL solution
    BOOL                    createDLFacialExpression; ///< Facial expression feature enable/disable
    BOOL                    createDLFacialGender;     ///< Facial gender feature enable/disable
    BOOL                    enableDLFAMultiThreading; ///< Enable multi-threaded processing for DLFA
    UINT32                  maxNumInputFace;          ///< Max number of input faces, set this if createROIManager is TRUE
    UINT32                  maxNumOutputFace;         ///< Max number of output faces
    UINT32                  maxDLFAFaceCount;         ///< Max number of input faces to DLFA
    FLOAT                   fdFrameAspectRatio;       ///< Input Image Aspect Ratio
    FDEngineClientType      clientType;               ///< Client type
    FDEngineDLFDVersion     DLFDVersion;              ///< DLFD Version
    FDEngineNetworkVersion  networkVersion;           ///< BITML network version
};

/// @brief Number of faces to be processed for each feature
struct FDEngineProcessLimit
{
    UINT32 partsLimit;             ///< Number of faces to be processed for facial parts detection
    UINT32 attributeLimit;         ///< Number of faces to be processed for facial attribute detection
    UINT32 smileLimit;             ///< Number of faces to be processed for smile detection
    UINT32 gazeLimit;              ///< Number of faces to be processed for gaze detection
    UINT32 blinkLimit;             ///< Number of faces to be processed for blink detection
};

/// @brief Per frame update infomation
struct FDEnginePerFrameInfo
{
  UINT64               frameID;          ///< Frame ID of current frame
  INT32                deviceRotation;   ///< DeviceRotation data
  BOOL                 bufferCached;     ///< Whether input frame is accessed by CPU
  FDEngineImage        imageInfo;        ///< Frame buffer information
  FDEngineProcessLimit procLimit;        ///< Number of faces to be processed for each feature
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineCreate
///
/// @brief  Create FD engine session
///
/// @param  pFDEngineCreateParams     Create parameters for FD Engine creation
/// @param  phFDEngineHandle          FD Engine handle returned to caller
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineCreate(
    FDEngineCreateParams*   pFDEngineCreateParams,
    FDEngineHandle*         phFDEngineHandle);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineDestroy
///
/// @brief  Destroy FD engine session handle
///
/// @param  hFDEngineHandle  FD Engine handle
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineDestroy(
    FDEngineHandle  hFDEngineHandle);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineGetConfig
///
/// @brief  Get FD engine session config
///
/// @param  hFDEngineHandle  FD Engine handle
/// @param  pConfig          Config to get
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineGetConfig(
    FDEngineHandle  hFDEngineHandle,
    FDEngineConfig* pConfig);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineSetConfig
///
/// @brief  Set FD engine session config
///
/// @param  hFDEngineHandle  FD Engine handle
/// @param  pConfig          Config got from upper layer
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineSetConfig(
    FDEngineHandle  hFDEngineHandle,
    FDEngineConfig* pConfig);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineSetDLFLShiftVector
///
/// @brief  Set DLFD shift vectors in FD engine
///
/// @param  hFDEngineHandle  FD Engine handle
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineSetDLFLShiftVector(
    FDEngineHandle  hFDEngineHandle);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineRunDLFD
///
/// @brief  Run DL-FD detection
///
/// @param  hFDEngineHandle    FD Engine handle
/// @param  pPerFrameInfo      Information update per frame
/// @param  pResult            Output face result
/// @param  pHeadBodyResults   Output head and body result
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineRunDLFD(
    FDEngineHandle                 hFDEngineHandle,
    FDEnginePerFrameInfo*          pPerFrameInfo,
    FDIntermediateResults*         pResult,
    FDIntermediateHeadBodyResults* pHeadBodyResults);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineProcessResult
///
/// @brief  Process Face Results to combine results and remove False positives
///
/// @param  hFDEngineHandle                 FD Engine handle
/// @param  pPerFrameInfo                   Information update per frame
/// @param  pMainResult                     Face result by Main Detector -- typically faster HW
/// @param  pAuxResult                      Face result by Aux assist Detector -- typically SW or DL
/// @param  pMainResult                     Face result by Main Detector -- typically faster HW
/// @param  pHeadBodyResult                 Head and body result by main detector
/// @param  runFDFlag                       Indicates whether FD algorithm is executed for this frame. If this flag is
///                                         'FALSE', the 'pOutputResult' is filled either with predicted or with the
///                                         previous frame results (depending on the ROI manager settings). The stabilized
///                                         result CAN be valid or invalid in all cases
/// @param  pOutputResult                   Output face result
/// @param  pOutputResultStabilized         Output stabilized face result
/// @param  pOutputHeadBodyResult           Output head and body result
/// @param  pOutputHeadBodyResultStabilized Output stabilized head and body result
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineProcessResult(
    FDEngineHandle                  hFDEngineHandle,
    FDEnginePerFrameInfo*           pPerFrameInfo,
    FDIntermediateResults*          pMainResult,
    FDIntermediateResults*          pAuxResult,
    FDIntermediateHeadBodyResults*  pHeadBodyResult,
    BOOL                            runFDFlag,
    FDResults*                      pOutputResult,
    FDResults*                      pOutputResultStabilized,
    FDHeadBodyResults*              pOutputHeadBodyResult,
    FDHeadBodyResults*              pOutputHeadBodyResultStabilized);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineGetFDRunFlag
///
/// @brief  Get recommendation from the tracker on whether to run FD algorithm this frame
///
/// @param  hFDEngineHandle             FD Engine handle
/// @param  pPerFrameInfo               Information update per frame
/// @param  pFDRunFlag                  Returns the FD run indicator
/// @param  pRequiredFrameCyclePeriod   Returns the recommended period for the FD execution frame cycle. It is recommended
///                                     to run the FD algorithm atleast once every 'pRequiredFrameCyclePeriod' consecutive
///                                     frames
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineGetFDRunFlag(
    FDEngineHandle          hFDEngineHandle,
    FDEnginePerFrameInfo*   pPerFrameInfo,
    BOOL*                   pFDRunFlag,
    UINT32*                 pRequiredFrameCyclePeriod);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineDLFacialContourDetect
///
/// @brief  Detect DL Facial Contour points for existing faces.
///         There is an internal dependency between FDEngineDLFacialContourDetect (CD),
///         FDEngineDLFacialExpressionDetect (ED) and FDEngineDLFacialGenderDetect (GD). Let CD(n), ED(n) and GD(n) denote
///         the detect calls for 'n'th frame. In general, note the following conditions for proper functioning of DLFA:
///         1. Requests of same attribute types for multiple frames are NOT allowed
///            CD(n+1) MUST NOT be called before CD(n) returns (similarly for ED & GD)
///         2. Late requests are NOT allowed
///            If any of CD(n), ED(n) or GD(n) call is issued already, DO NOT issue another call (of CD, ED or GD) for a
///            frame less than 'n' (like CD(n-1)).
///         3. Early requests are not recommended (but should be OKAY in most cases)
///            If any of CD(n), ED(n) or GD(n) call is issued, it is recommended to wait till all the ‘n’th frame requests
///            return before issuing any subsequent request. Though this should work fine in almost all the cases, it can
///            in principle cause an error in one of the really rare scenarios.
///
/// @param  hFDEngineHandle  FD Engine handle
/// @param  pPerFrameInfo    Information update per frame
/// @param  pFDResult        Face information container, used as both input and output structure
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineDLFacialContourDetect(
    FDEngineHandle          hFDEngineHandle,
    FDEnginePerFrameInfo*   pPerFrameInfo,
    FDResults*              pFDResult);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineDLFacialExpressionDetect
///
/// @brief  Detect DL facial expression for existing faces.
///         Please refer to the brief of 'FDEngineDLFacialContourDetect' for some important details.
///
/// @param  hFDEngineHandle  FD Engine handle
/// @param  pPerFrameInfo    Information update per frame
/// @param  pFDResult        Face information container, used as both input and output structure
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineDLFacialExpressionDetect(
    FDEngineHandle          hFDEngineHandle,
    FDEnginePerFrameInfo*   pPerFrameInfo,
    FDResults*              pFDResult);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineDLFacialGenderDetect
///
/// @brief  Detect DL facial gender for existing faces
///         Please refer to the brief of 'FDEngineDLFacialContourDetect' for some important details.
///
/// @param  hFDEngineHandle  FD Engine handle
/// @param  pPerFrameInfo    Information update per frame
/// @param  pFDResult        Face information container, used as both input and output structure
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineDLFacialGenderDetect(
    FDEngineHandle          hFDEngineHandle,
    FDEnginePerFrameInfo*   pPerFrameInfo,
    FDResults*              pFDResult);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FDEngineDLFacialAttributesDetect
///
/// @brief  Detect DL facial attributes (contour, expression and gender) for existing faces
///
/// @param  hFDEngineHandle     FD Engine handle
/// @param  pPerFrameInfo       Information update per frame
/// @param  pFDResult           Face information container, used as both input and output structure
/// @param  doContourDetect     Enable facial contour detection for this frame
/// @param  doExpressionDetect  Enable facial expression detection for this frame
/// @param  doGenderDetect      Enable facial gender detection for this frame
///
/// @return CamxResultSuccess if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CAMX_VISIBILITY_PUBLIC CamxResult FDEngineDLFacialAttributesDetect(
    FDEngineHandle          hFDEngineHandle,
    FDEnginePerFrameInfo*   pPerFrameInfo,
    FDResults*              pFDResult,
    BOOL                    doContourDetect,
    BOOL                    doExpressionDetect,
    BOOL                    doGenderDetect);

#ifdef __cplusplus
}
#endif // __cplusplus

CAMX_NAMESPACE_END

#endif // end of CAMXFDENGINEINTERFACE_H
