///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017-2023 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file chifdproperty.h
/// @brief Define Qualcomm Technologies, Inc. FD property definitions
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CHIFDPROPERTY_H
#define CHIFDPROPERTY_H

#include "camxdefs.h"
#include "chicommontypes.h"

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

// Data structures that are exposed to OEM must be packed to have the expected layout.
#pragma pack(push, CDK_PACK_SIZE)


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Describes Common FD data structures
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/** @addtogroup chi_fd_macros
@{ */

static const UINT8  FDMaxFaceCount              = 10;       ///< Maximum number of faces that the FD solution can detect.
static const UINT8  FDMaxFaceCountIntermediate  = 35;       ///< Maximum number of intermediate (probable) faces that FD
                                                            ///  processes.
static const INT32  FDInvalidPoint              = -2000;    ///< Coordinate value that indicates an invalid point.
static const INT32  FDContourV4Max              = 300;      ///< Maximum number of custom contour points

/** @} */ /* end_addtogroup chi_fd_macros */


/** @addtogroup chi_fd_vendor_tags
@{ */

static const CHAR* VendorTagSectionOEMFDConfig  = "org.quic.camera2.oemfdconfig";      ///< Pointer to the section for OEM FD
                                                                                       ///  configuration.
static const CHAR* VendorTagNameOEMFDConfig     = "OEMFDConfig";                       ///< Pointer to the configure FD tuning
                                                                                       ///  parameters.

static const CHAR* VendorTagSectionOEMFDResults    = "org.quic.camera2.oemfdresults";  ///< Pointer to the section for OEM FD
                                                                                       ///  results.
static const CHAR* VendorTagNameOEMFDResults       = "OEMFDResults";                   ///< Pointer to the list of face ROI
                                                                                       ///  data, where there is one set of
                                                                                       ///  data for each detected face.
static const CHAR* VendorTagNameOEMFDUpperBodyResult = "OEMFDUpperBodyResults";        ///< Pointer to the list of UpperBody ROI
                                                                                       ///  data, where there is one set of
                                                                                       ///  data for each detected upperbody.
static const CHAR* VendorTagNameOEMFDContourResults = "OEMFDContourResults";           ///< Vendor tag name for OEM face
                                                                                       ///  contour results.
// Facial attribute settings vendor tag section
static const CHAR* VendorTagSectionFacialAttrSettings = "org.codeaurora.qcamera3.facial_attr";  ///< Pointer to the section for
                                                                                                ///  face attribute settings.
static const CHAR* VendorTagNameFaceMaskSetting       = "face_mask_enable"; ///< Pointer to the enable setting for
                                                                            ///  Face mask detection.
static const CHAR* VendorTagNameUpperBodySetting      = "upperbody_enable"; ///< Pointer to the upperbody detection is enabled.
static const CHAR* VendorTagNameGazeSetting           = "gaze_enable";      ///< Pointer to the gaze detection is enabled.
static const CHAR* VendorTagNameBlinkSetting          = "blink_enable";     ///< Pointer to the blink detection is enabled.
static const CHAR* VendorTagNameContourSetting        = "contour_enable";   ///< Pointer to the face contour detection is enabled.
static const CHAR* VendorTagNameContourVersionSetting = "contour_version";  ///< Pointer to the contour detection version for
                                                                            ///  V1 and V1+.
static const CHAR* VendorTagNameGenderSetting         = "gender_enable";    ///< Pointer to the enable setting for gender
                                                                            ///  detection.
static const CHAR* VendorTagNameFaceExpressionSetting = "face_expression_enable";  ///< Pointer to the enable setting for
                                                                                   ///   Face Expression detection.

// Stats facial attribute vendor tag section
static const CHAR* VendorTagSectionStats              = "org.codeaurora.qcamera3.stats";  ///< Pointer to the section
                                                                                          ///  statistics for facial
                                                                                          ///  attributes.

static const CHAR* VendorTagNameMaskResults           = "mask_results";      ///< Pointer to the mask ROI for a face.
static const CHAR* VendorTagNameFDUpperBodyResults    = "upperbody_results"; ///< Pointer to the upperbody results.
static const CHAR* VendorTagNameBSGCAvailable         = "bsgc_available";    ///< Pointer to the BSGC is available.
static const CHAR* VendorTagNameGazeFacePose          = "gaze_angle";        ///< Pointer to the face pose of the gaze (face
                                                                             ///  yaw angle).
static const CHAR* VendorTagNameGazeFaceDirection     = "gaze_direction";    ///< Pointer to the facial direction of the gaze.
static const CHAR* VendorTagNameGazeDirection         = "gaze_degree";       ///< Pointer to the gaze direction.
static const CHAR* VendorTagNameBlinkDetected         = "blink_detected";    ///< Pointer to the blink is detected.
static const CHAR* VendorTagNameBlinkDegree           = "blink_degree";      ///< Pointer to the blink degree of both eyes.
static const CHAR* VendorTagNameGender                = "gender";            ///< Pointer to the gender for faces
static const CHAR* VendorTagNameExpression            = "face_expression";   ///< Pointer to the expression for faces.
static const CHAR* VendorTagNameContourPointResults   = "contour_results";   ///< Pointer to the face contour points of newer
                                                                             ///  versions for V1 or V1+.
/** @} */ /* end_addtogroup chi_fd_vendor_tags */

/** @addtogroup chi_fd_macros
@{ */

typedef INT32 CamxFDCTDResultStatus;                                    ///< Result status of FD contour detection.
static  const CamxFDCTDResultStatus  CamxFDCTDResultSuccess       = 0;  ///< Result of FD contour detection is successful.
static  const CamxFDCTDResultStatus  CamxFDCTDResultEFailed       = 1;  ///< Result of FD contour detection is an unspecified
                                                                        ///  error.
static  const CamxFDCTDResultStatus  CamxFDCTDResultEVUnsupported = 2;  ///< Result of FD contour detection version is not
                                                                        ///  supported.
static  const CamxFDCTDResultStatus  CamxFDCTDResultECanceled     = 3;  ///< Result of FD contour detection is canceled.


/** @} */ /* end_addtogroup chi_fd_macros */


/** @addtogroup chi_fd_datatypes
@{ */

/// @brief Configuration types for the face size.
enum FDFaceSizeType
{
    FDFaceAdjFixed,     ///< Absolute value that is set for the minimum size.
    FDFaceAdjFloating,  ///< Minimum face size calculation is based on the ratio.
};

/// @brief Values for angle configuration.
enum FDSearchAngle
{
    FDAngleNone,    ///< No angle.
    FDAngle15,      ///< 15 degrees on each side.
    FDAngle45,      ///< 45 degrees on each side.
    FDAngle75,      ///< 75 degrees on each side.
    FDAngle105,     ///< 105 degrees on each side.
    FDAngle135,     ///< 135 degrees on each side.
    FDAngleAll,     ///< All angles.
};

/// @brief Sparse landmark information for a face.
enum FDFaceSparseLMPointIndex
{
    FDFaceSparseLMPointLeftEye = 0,
    FDFaceSparseLMPointRightEye,
    FDFaceSparseLMPointNose,
    FDFaceSparseLMPointMouthLeft,
    FDFaceSparseLMPointMouthRight,
    FDFaceSparseLMPointMouthCenter,
    FDFaceSparseLMPointMax,         /* Number of Indices */
};

/// @brief Index values for each facial point.
enum FDFacialPointIndex
{
    FDFacialPointLeftEye = 0,
    FDFacialPointRightEye,
    FDFacialPointMouth,
    FDFacialPointLeftEyeIn,
    FDFacialPointLeftEyeOut,
    FDFacialPointRightEyeIn,
    FDFacialPointRightEyeOut,
    FDFacialPointMouthLeft,
    FDFacialPointMouthRight,
    FDFacialPointNoseLeft,
    FDFacialPointNoseRight,
    FDFacialPointMouthUp,
    FDFacialPointMax,              /* Number of Indices */
};

/// @brief Index values for each facial contour.
enum FDContourIndex
{
    FDContourEyeLeftOut = 0,
    FDContourEyeLeftIn,
    FDContourEyeLeftUp,
    FDContourEyeLeftDown,
    FDContourEyeLeftOutUp,
    FDContourEyeLeftOutDown,
    FDContourEyeLeftInUp,
    FDContourEyeLeftInDown,
    FDContourBrowLeftOut,
    FDContourBrowLeftIn,
    FDContourBrowLeftUp,
    FDContourBrowLeftDown,
    FDContourBrowLeftOutUp,
    FDContourBrowLeftOutDown,
    FDContourBrowLeftInUp,
    FDContourBrowLeftInDown,
    FDContourEyeRightIn,
    FDContourEyeRightOut,
    FDContourEyeRightUP,
    FDContourEyeRightDown,
    FDContourEyeRightInUp,
    FDContourEyeRightInDown,
    FDContourEyeRightOutUp,
    FDContourEyeRightOutDown,
    FDContourBrowRightIn,
    FDContourBrowRightOut,
    FDContourBrowRightUP,
    FDContourBrowRightDown,
    FDContourBrowRightInUp,
    FDContourBrowRightInDown,
    FDContourBrowRightOutUp,
    FDContourBrowRightOutDown,
    FDContourNoseLeft,
    FDContourNoseRight,
    FDContourNose,
    FDContourNoseTip,
    FDContourNoseLeft3,
    FDContourNoseLeft4,
    FDContourNoseRight3,
    FDContourNoseRight4,
    FDContourMouthLeft,
    FDContourMouthRight,
    FDContourMouthUp,
    FDContourLipUp,
    FDContourLipDown,
    FDContourMouthDown,
    FDContourMouthLeftUP1,
    FDContourLipLeftUP1,
    FDContourLipLeftDown1,
    FDContourMouthLeftDown1,
    FDContourMouthRightUP1,
    FDContourLipRightUP1,
    FDContourLipRightDown1,
    FDContourMouthRightDown1,
    FDContourMouthLeftUP2,
    FDContourLipLeftUP2,
    FDContourLipLeftDown2,
    FDContourMouthLeftDown2,
    FDContourMouthRightUP2,
    FDContourLipRightUP2,
    FDContourLipRightDown2,
    FDContourMouthRightDown2,
    FDContourFaceLeft10,
    FDContourFaceLeft9,
    FDContourFaceLeft8,
    FDContourFaceLeft7,
    FDContourFaceLeft6,
    FDContourFaceLeft5,
    FDContourFaceLeft4,
    FDContourFaceLeft3,
    FDContourFaceLeft2,
    FDContourFaceLeft1,
    FDContourChin,
    FDContourFaceRight1,
    FDContourFaceRight2,
    FDContourFaceRight3,
    FDContourFaceRight4,
    FDContourFaceRight5,
    FDContourFaceRight6,
    FDContourFaceRight7,
    FDContourFaceRight8,
    FDContourFaceRight9,
    FDContourFaceRight10,
    FDContourEyePupilLeft,
    FDContourEyePupilRight,
    FDContourForehead,
    FDContourNoseCenter1,
    FDContourNoseCenter2,
    FDContourNoseCenter3,
    FDContourMax                   /* Number of Indices */
};

/// @brief Version 1 of index values for each facial contour.
enum FDContourV1Index
{
    FDContourV1EyeLeftOut = 0,
    FDContourV1EyeLeftIn,
    FDContourV1EyeLeftUp,
    FDContourV1EyeLeftDown,
    FDContourV1EyeLeftOutUp,
    FDContourV1EyeLeftOutDown,
    FDContourV1EyeLeftInUp,
    FDContourV1EyeLeftInDown,
    FDContourV1BrowLeftOut,
    FDContourV1BrowLeftIn,
    FDContourV1ForeheadLeft,
    FDContourV1BrowLeftUp,
    FDContourV1BrowLeftDown,
    FDContourV1BrowLeftOutUp,
    FDContourV1BrowLeftOutDown,
    FDContourV1BrowLeftInUp,
    FDContourV1BrowLeftInDown,
    FDContourV1EyeRightIn,
    FDContourV1EyeRightOut,
    FDContourV1EyeRightUP,
    FDContourV1EyeRightDown,
    FDContourV1EyeRightInUp,
    FDContourV1EyeRightInDown,
    FDContourV1EyeRightOutUp,
    FDContourV1EyeRightOutDown,
    FDContourV1BrowRightIn,
    FDContourV1ForeheadRight,
    FDContourV1BrowRightOut,
    FDContourV1BrowRightUP,
    FDContourV1BrowRightDown,
    FDContourV1BrowRightInUp,
    FDContourV1BrowRightInDown,
    FDContourV1BrowRightOutUp,
    FDContourV1BrowRightOutDown,
    FDContourV1NoseLeft,
    FDContourV1NoseRight,
    FDContourV1Nose,
    FDContourV1NoseLeft2,
    FDContourV1NoseLeft1,
    FDContourV1NoseRight2,
    FDContourV1NoseRight1,
    FDContourV1NoseTip,
    FDContourV1NoseLeft3,
    FDContourV1NoseLeft4,
    FDContourV1NoseRight3,
    FDContourV1NoseRight4,
    FDContourV1MouthLeft,
    FDContourV1MouthRight,
    FDContourV1MouthUp,
    FDContourV1LipUp,
    FDContourV1LipDown,
    FDContourV1MouthDown,
    FDContourV1MouthLeftUP1,
    FDContourV1LipLeftUP1,
    FDContourV1LipLeftDown1,
    FDContourV1MouthLeftDown1,
    FDContourV1MouthRightUP1,
    FDContourV1LipRightUP1,
    FDContourV1LipRightDown1,
    FDContourV1MouthRightDown1,
    FDContourV1MouthLeftUP2,
    FDContourV1LipLeftUP2,
    FDContourV1LipLeftDown2,
    FDContourV1MouthLeftDown2,
    FDContourV1MouthRightUP2,
    FDContourV1LipRightUP2,
    FDContourV1LipRightDown2,
    FDContourV1MouthRightDown2,
    FDContourV1FaceLeft20,
    FDContourV1FaceLeft19,
    FDContourV1FaceLeft18,
    FDContourV1FaceLeft17,
    FDContourV1FaceLeft16,
    FDContourV1FaceLeft15,
    FDContourV1FaceLeft14,
    FDContourV1FaceLeft13,
    FDContourV1FaceLeft12,
    FDContourV1FaceLeft11,
    FDContourV1FaceLeft10,
    FDContourV1FaceLeft9,
    FDContourV1FaceLeft8,
    FDContourV1FaceLeft7,
    FDContourV1FaceLeft6,
    FDContourV1FaceLeft5,
    FDContourV1FaceLeft4,
    FDContourV1FaceLeft3,
    FDContourV1FaceLeft2,
    FDContourV1FaceLeft1,
    FDContourV1Chin,
    FDContourV1FaceRight1,
    FDContourV1FaceRight2,
    FDContourV1FaceRight3,
    FDContourV1FaceRight4,
    FDContourV1FaceRight5,
    FDContourV1FaceRight6,
    FDContourV1FaceRight7,
    FDContourV1FaceRight8,
    FDContourV1FaceRight9,
    FDContourV1FaceRight10,
    FDContourV1FaceRight11,
    FDContourV1FaceRight12,
    FDContourV1FaceRight13,
    FDContourV1FaceRight14,
    FDContourV1FaceRight15,
    FDContourV1FaceRight16,
    FDContourV1FaceRight17,
    FDContourV1FaceRight18,
    FDContourV1FaceRight19,
    FDContourV1FaceRight20,
    FDContourV1EyePupilLeft,
    FDContourV1EyePupilRight,
    FDContourV1Forehead,
    FDContourV1NoseCenter1,
    FDContourV1NoseCenter2,
    FDContourV1NoseCenter3,
    FDContourV1Max              /* Number of Indices */
};

/// @brief Version 2 of index values for each facial contour.
enum FDContourV2Index
{
    FDContourV2EyeLeftOut = 0,
    FDContourV2EyeLeftIn,
    FDContourV2EyeLeftUp,
    FDContourV2EyeLeftDown,
    FDContourV2EyeLeftOutUp,
    FDContourV2EyeLeftOutDown,
    FDContourV2EyeLeftInUp,
    FDContourV2EyeLeftInDown,
    FDContourV2BrowLeftOut,
    FDContourV2BrowLeftIn,
    FDContourV2ForeheadLeft,
    FDContourV2BrowLeftUp,
    FDContourV2BrowLeftDown,
    FDContourV2BrowLeftOutUp,
    FDContourV2BrowLeftOutDown,
    FDContourV2BrowLeftInUp,
    FDContourV2BrowLeftInDown,
    FDContourV2EyeRightIn,
    FDContourV2EyeRightOut,
    FDContourV2EyeRightUP,
    FDContourV2EyeRightDown,
    FDContourV2EyeRightInUp,
    FDContourV2EyeRightInDown,
    FDContourV2EyeRightOutUp,
    FDContourV2EyeRightOutDown,
    FDContourV2BrowRightIn,
    FDContourV2ForeheadRight,
    FDContourV2BrowRightOut,
    FDContourV2BrowRightUP,
    FDContourV2BrowRightDown,
    FDContourV2BrowRightInUp,
    FDContourV2BrowRightInDown,
    FDContourV2BrowRightOutUp,
    FDContourV2BrowRightOutDown,
    FDContourV2NoseLeft,
    FDContourV2NoseRight,
    FDContourV2Nose,
    FDContourV2NoseLeft2,
    FDContourV2NoseLeft1,
    FDContourV2NoseRight2,
    FDContourV2NoseRight1,
    FDContourV2NoseTip,
    FDContourV2NoseLeft3,
    FDContourV2NoseLeft4,
    FDContourV2NoseRight3,
    FDContourV2NoseRight4,
    FDContourV2MouthLeft,
    FDContourV2MouthRight,
    FDContourV2MouthUp,
    FDContourV2LipUp,
    FDContourV2LipDown,
    FDContourV2MouthDown,
    FDContourV2MouthLeftUP1,
    FDContourV2LipLeftUP1,
    FDContourV2LipLeftDown1,
    FDContourV2MouthLeftDown1,
    FDContourV2MouthRightUP1,
    FDContourV2LipRightUP1,
    FDContourV2LipRightDown1,
    FDContourV2MouthRightDown1,
    FDContourV2MouthLeftUP2,
    FDContourV2LipLeftUP2,
    FDContourV2LipLeftDown2,
    FDContourV2MouthLeftDown2,
    FDContourV2MouthRightUP2,
    FDContourV2LipRightUP2,
    FDContourV2LipRightDown2,
    FDContourV2MouthRightDown2,
    FDContourV2FaceLeft20,
    FDContourV2FaceLeft19,
    FDContourV2FaceLeft18,
    FDContourV2FaceLeft17,
    FDContourV2FaceLeft16,
    FDContourV2FaceLeft15,
    FDContourV2FaceLeft14,
    FDContourV2FaceLeft13,
    FDContourV2FaceLeft12,
    FDContourV2FaceLeft11,
    FDContourV2FaceLeft10,
    FDContourV2FaceLeft9,
    FDContourV2FaceLeft8,
    FDContourV2FaceLeft7,
    FDContourV2FaceLeft6,
    FDContourV2FaceLeft5,
    FDContourV2FaceLeft4,
    FDContourV2FaceLeft3,
    FDContourV2FaceLeft2,
    FDContourV2FaceLeft1,
    FDContourV2Chin,
    FDContourV2FaceRight1,
    FDContourV2FaceRight2,
    FDContourV2FaceRight3,
    FDContourV2FaceRight4,
    FDContourV2FaceRight5,
    FDContourV2FaceRight6,
    FDContourV2FaceRight7,
    FDContourV2FaceRight8,
    FDContourV2FaceRight9,
    FDContourV2FaceRight10,
    FDContourV2FaceRight11,
    FDContourV2FaceRight12,
    FDContourV2FaceRight13,
    FDContourV2FaceRight14,
    FDContourV2FaceRight15,
    FDContourV2FaceRight16,
    FDContourV2FaceRight17,
    FDContourV2FaceRight18,
    FDContourV2FaceRight19,
    FDContourV2FaceRight20,
    FDContourV2EyePupilLeft,
    FDContourV2EyePupilRight,
    FDContourV2Forehead,
    FDContourV2NoseCenter1,
    FDContourV2NoseCenter2,
    FDContourV2NoseCenter3,
    FDContourV2FaceTop1,
    FDContourV2FaceTop2,
    FDContourV2FaceTop3,
    FDContourV2FaceTop4,
    FDContourV2FaceTop5,
    FDContourV2FaceTop6,
    FDContourV2FaceTop7,
    FDContourV2FaceTop8,
    FDContourV2FaceTop9,
    FDContourV2FaceTop10,
    FDContourV2FaceTop11,
    FDContourV2FaceTop12,
    FDContourV2FaceTop13,
    FDContourV2FaceTop14,
    FDContourV2FaceTop15,
    FDContourV2FaceTop16,
    FDContourV2FaceTop17,
    FDContourV2FaceTop18,
    FDContourV2FaceTop19,
    FDContourV2BrowRightOut1,
    FDContourV2BrowLeftOut1,
    FDContourV2NoseRight5,
    FDContourV2NoseCenterRight,
    FDContourV2NoseRight6,
    FDContourV2NoseCenter4,
    FDContourV2NoseCenter5,
    FDContourV2NoseCenter6,
    FDContourV2NoseCenter7,
    FDContourV2NoseRight7,
    FDContourV2NoseCenterRight1,
    FDContourV2NoseCenter8,
    FDContourV2NoseCenterRight2,
    FDContourV2NoseRight8,
    FDContourV2NoseCenter10,
    FDContourV2NoseRight9,
    FDContourV2NoseRight10,
    FDContourV2NoseRight11,
    FDContourV2NoseCenterRight3,
    FDContourV2NoseCenter9,
    FDContourV2NoseCenter11,
    FDContourV2NoseCenterRight4,
    FDContourV2NoseRight12,
    FDContourV2NoseRight13,
    FDContourV2NoseRight14,
    FDContourV2NoseLeft5,
    FDContourV2NoseCenterLeft,
    FDContourV2NoseLeft6,
    FDContourV2NoseLeft7,
    FDContourV2NoseCenterLeft1,
    FDContourV2NoseCenterLeft2,
    FDContourV2NoseLeft8,
    FDContourV2NoseLeft9,
    FDContourV2NoseLeft10,
    FDContourV2NoseLeft11,
    FDContourV2NoseCenterLeft3,
    FDContourV2NoseCenterLeft4,
    FDContourV2NoseLeft12,
    FDContourV2NoseLeft13,
    FDContourV2NoseLeft14,
    FDContourV2EyeRightOutUp1,
    FDContourV2EyeRightOutUp2,
    FDContourV2EyeRightOutUp3,
    FDContourV2EyeRightInUp1,
    FDContourV2EyeRightInUp2,
    FDContourV2EyeRightOutDown1,
    FDContourV2EyeRightOutDown2,
    FDContourV2EyeRightOutDown3,
    FDContourV2EyeRightInDown1,
    FDContourV2EyeRightInDown2,
    FDContourV2EyeRightInDown3,
    FDContourV2EyeRightInUp3,
    FDContourV2EyeLeftOutUp1,
    FDContourV2EyeLeftOutUp2,
    FDContourV2EyeLeftOutUp3,
    FDContourV2EyeLeftInUp1,
    FDContourV2EyeLeftInUp2,
    FDContourV2EyeLeftOutDown1,
    FDContourV2EyeLeftOutDown2,
    FDContourV2EyeLeftOutDown3,
    FDContourV2EyeLeftInDown1,
    FDContourV2EyeLeftInDown2,
    FDContourV2EyeLeftInDown3,
    FDContourV2EyeLeftInUp3,
    FDContourV2MouthRightDown3,
    FDContourV2MouthRightUP3,
    FDContourV2MouthRightDown4,
    FDContourV2LipMidUP1,
    FDContourV2LipRightUP3,
    FDContourV2LipRightUP4,
    FDContourV2LipRightUP5,
    FDContourV2LipMidUP2,
    FDContourV2LipMidUP3,
    FDContourV2LipRightUP6,
    FDContourV2LipMidUP4,
    FDContourV2MouthRightUP4,
    FDContourV2LipMidDown1,
    FDContourV2MouthRightDown5,
    FDContourV2LipMidDown2,
    FDContourV2LipRightDown3,
    FDContourV2LipMidDown3,
    FDContourV2LipMidDown4,
    FDContourV2MouthLeftDown3,
    FDContourV2MouthLeftUP3,
    FDContourV2MouthLeftDown4,
    FDContourV2LipMidUP6,
    FDContourV2LipLeftUP3,
    FDContourV2LipLeftUP4,
    FDContourV2LipLeftUP5,
    FDContourV2LipMidUP7,
    FDContourV2LipMidUP8,
    FDContourV2LipLeftUP6,
    FDContourV2MouthLeftUP4,
    FDContourV2LipMidDown5,
    FDContourV2MouthLeftDown5,
    FDContourV2LipMidDown6,
    FDContourV2LipLeftDown3,
    FDContourV2LipMidDown7,
    FDContourV2CheekRight1,
    FDContourV2CheekRight2,
    FDContourV2CheekRight3,
    FDContourV2CheekRight4,
    FDContourV2CheekRight5,
    FDContourV2CheekRight6,
    FDContourV2CheekRight7,
    FDContourV2CheekRight8,
    FDContourV2CheekRight9,
    FDContourV2CheekRight10,
    FDContourV2CheekRight11,
    FDContourV2CheekRight12,
    FDContourV2CheekRight13,
    FDContourV2CheekRight14,
    FDContourV2CheekRight15,
    FDContourV2CheekRight16,
    FDContourV2CheekRight17,
    FDContourV2CheekRight18,
    FDContourV2CheekRight19,
    FDContourV2CheekRight20,
    FDContourV2CheekRight21,
    FDContourV2CheekRight22,
    FDContourV2CheekRight23,
    FDContourV2CheekRight24,
    FDContourV2CheekRight25,
    FDContourV2CheekRight26,
    FDContourV2CheekRight27,
    FDContourV2CheekRight28,
    FDContourV2CheekRight29,
    FDContourV2CheekRight30,
    FDContourV2CheekLeft1,
    FDContourV2CheekLeft2,
    FDContourV2CheekLeft3,
    FDContourV2CheekLeft4,
    FDContourV2CheekLeft5,
    FDContourV2CheekLeft6,
    FDContourV2CheekLeft7,
    FDContourV2CheekLeft8,
    FDContourV2CheekLeft9,
    FDContourV2CheekLeft10,
    FDContourV2CheekLeft11,
    FDContourV2CheekLeft12,
    FDContourV2CheekLeft13,
    FDContourV2CheekLeft14,
    FDContourV2CheekLeft15,
    FDContourV2CheekLeft16,
    FDContourV2CheekLeft17,
    FDContourV2CheekLeft18,
    FDContourV2CheekLeft19,
    FDContourV2CheekLeft20,
    FDContourV2CheekLeft21,
    FDContourV2CheekLeft22,
    FDContourV2CheekLeft23,
    FDContourV2CheekLeft24,
    FDContourV2CheekLeft25,
    FDContourV2CheekLeft26,
    FDContourV2CheekLeft27,
    FDContourV2CheekLeft28,
    FDContourV2CheekLeft29,
    FDContourV2CheekLeft30,
    FDContourV2Chin1,
    FDContourV2Chin2,
    FDContourV2ChinRight1,
    FDContourV2ChinRight2,
    FDContourV2ChinRight3,
    FDContourV2ChinLeft1,
    FDContourV2ChinLeft2,
    FDContourV2ChinLeft3,
    FDContourV2Max              /* Number of Indices */
};


/// @brief Version 3 of index values for each facial contour.
enum FDContourV3Index
{
    FDContourV3EyeLeftOut = 0,
    FDContourV3EyeLeftIn,
    FDContourV3EyeLeftUp,
    FDContourV3EyeLeftDown,
    FDContourV3EyeLeftOutUp,
    FDContourV3EyeLeftOutDown,
    FDContourV3EyeLeftInUp,
    FDContourV3EyeLeftInDown,
    FDContourV3BrowLeftOut,
    FDContourV3BrowLeftIn,
    FDContourV3ForeheadLeft,
    FDContourV3BrowLeftUp,
    FDContourV3BrowLeftDown,
    FDContourV3BrowLeftOutUp,
    FDContourV3BrowLeftOutDown,
    FDContourV3BrowLeftInUp,
    FDContourV3BrowLeftInDown,
    FDContourV3EyeRightIn,
    FDContourV3EyeRightOut,
    FDContourV3EyeRightUP,
    FDContourV3EyeRightDown,
    FDContourV3EyeRightInUp,
    FDContourV3EyeRightInDown,
    FDContourV3EyeRightOutUp,
    FDContourV3EyeRightOutDown,
    FDContourV3BrowRightIn,
    FDContourV3ForeheadRight,
    FDContourV3BrowRightOut,
    FDContourV3BrowRightUP,
    FDContourV3BrowRightDown,
    FDContourV3BrowRightInUp,
    FDContourV3BrowRightInDown,
    FDContourV3BrowRightOutUp,
    FDContourV3BrowRightOutDown,
    FDContourV3NoseLeft,
    FDContourV3NoseRight,
    FDContourV3Nose,
    FDContourV3NoseLeft2,
    FDContourV3NoseLeft1,
    FDContourV3NoseRight2,
    FDContourV3NoseRight1,
    FDContourV3NoseTip,
    FDContourV3NoseLeft3,
    FDContourV3NoseLeft4,
    FDContourV3NoseRight3,
    FDContourV3NoseRight4,
    FDContourV3MouthLeft,
    FDContourV3MouthRight,
    FDContourV3MouthUp,
    FDContourV3LipUp,
    FDContourV3LipDown,
    FDContourV3MouthDown,
    FDContourV3MouthLeftUP1,
    FDContourV3LipLeftUP1,
    FDContourV3LipLeftDown1,
    FDContourV3MouthLeftDown1,
    FDContourV3MouthRightUP1,
    FDContourV3LipRightUP1,
    FDContourV3LipRightDown1,
    FDContourV3MouthRightDown1,
    FDContourV3MouthLeftUP2,
    FDContourV3LipLeftUP2,
    FDContourV3LipLeftDown2,
    FDContourV3MouthLeftDown2,
    FDContourV3MouthRightUP2,
    FDContourV3LipRightUP2,
    FDContourV3LipRightDown2,
    FDContourV3MouthRightDown2,
    FDContourV3FaceLeft20,
    FDContourV3FaceLeft19,
    FDContourV3FaceLeft18,
    FDContourV3FaceLeft17,
    FDContourV3FaceLeft16,
    FDContourV3FaceLeft15,
    FDContourV3FaceLeft14,
    FDContourV3FaceLeft13,
    FDContourV3FaceLeft12,
    FDContourV3FaceLeft11,
    FDContourV3FaceLeft10,
    FDContourV3FaceLeft9,
    FDContourV3FaceLeft8,
    FDContourV3FaceLeft7,
    FDContourV3FaceLeft6,
    FDContourV3FaceLeft5,
    FDContourV3FaceLeft4,
    FDContourV3FaceLeft3,
    FDContourV3FaceLeft2,
    FDContourV3FaceLeft1,
    FDContourV3Chin,
    FDContourV3FaceRight1,
    FDContourV3FaceRight2,
    FDContourV3FaceRight3,
    FDContourV3FaceRight4,
    FDContourV3FaceRight5,
    FDContourV3FaceRight6,
    FDContourV3FaceRight7,
    FDContourV3FaceRight8,
    FDContourV3FaceRight9,
    FDContourV3FaceRight10,
    FDContourV3FaceRight11,
    FDContourV3FaceRight12,
    FDContourV3FaceRight13,
    FDContourV3FaceRight14,
    FDContourV3FaceRight15,
    FDContourV3FaceRight16,
    FDContourV3FaceRight17,
    FDContourV3FaceRight18,
    FDContourV3FaceRight19,
    FDContourV3FaceRight20,
    FDContourV3EyePupilLeft,
    FDContourV3EyePupilRight,
    FDContourV3Forehead,
    FDContourV3NoseCenter1,
    FDContourV3NoseCenter2,
    FDContourV3NoseCenter3,
    FDContourV3FaceTop1,
    FDContourV3FaceTop2,
    FDContourV3FaceTop3,
    FDContourV3FaceTop4,
    FDContourV3FaceTop5,
    FDContourV3FaceTop6,
    FDContourV3FaceTop7,
    FDContourV3FaceTop8,
    FDContourV3FaceTop9,
    FDContourV3FaceTop10,
    FDContourV3FaceTop11,
    FDContourV3FaceTop12,
    FDContourV3FaceTop13,
    FDContourV3FaceTop14,
    FDContourV3FaceTop15,
    FDContourV3FaceTop16,
    FDContourV3FaceTop17,
    FDContourV3FaceTop18,
    FDContourV3FaceTop19,
    FDContourV3BrowRightOut1,
    FDContourV3BrowLeftOut1,
    FDContourV3NoseRight5,
    FDContourV3NoseCenterRight,
    FDContourV3NoseRight6,
    FDContourV3NoseCenter4,
    FDContourV3NoseCenter5,
    FDContourV3NoseCenter6,
    FDContourV3NoseCenter7,
    FDContourV3NoseRight7,
    FDContourV3NoseCenterRight1,
    FDContourV3NoseCenter8,
    FDContourV3NoseCenterRight2,
    FDContourV3NoseRight8,
    FDContourV3NoseCenter10,
    FDContourV3NoseRight9,
    FDContourV3NoseRight10,
    FDContourV3NoseRight11,
    FDContourV3NoseCenterRight3,
    FDContourV3NoseCenter9,
    FDContourV3NoseCenter11,
    FDContourV3NoseCenterRight4,
    FDContourV3NoseRight12,
    FDContourV3NoseRight13,
    FDContourV3NoseRight14,
    FDContourV3NoseLeft5,
    FDContourV3NoseCenterLeft,
    FDContourV3NoseLeft6,
    FDContourV3NoseLeft7,
    FDContourV3NoseCenterLeft1,
    FDContourV3NoseCenterLeft2,
    FDContourV3NoseLeft8,
    FDContourV3NoseLeft9,
    FDContourV3NoseLeft10,
    FDContourV3NoseLeft11,
    FDContourV3NoseCenterLeft3,
    FDContourV3NoseCenterLeft4,
    FDContourV3NoseLeft12,
    FDContourV3NoseLeft13,
    FDContourV3NoseLeft14,
    FDContourV3EyeRightOutUp1,
    FDContourV3EyeRightOutUp2,
    FDContourV3EyeRightOutUp3,
    FDContourV3EyeRightInUp1,
    FDContourV3EyeRightInUp2,
    FDContourV3EyeRightOutDown1,
    FDContourV3EyeRightOutDown2,
    FDContourV3EyeRightOutDown3,
    FDContourV3EyeRightInDown1,
    FDContourV3EyeRightInDown2,
    FDContourV3EyeRightInDown3,
    FDContourV3EyeRightInUp3,
    FDContourV3EyeLeftOutUp1,
    FDContourV3EyeLeftOutUp2,
    FDContourV3EyeLeftOutUp3,
    FDContourV3EyeLeftInUp1,
    FDContourV3EyeLeftInUp2,
    FDContourV3EyeLeftOutDown1,
    FDContourV3EyeLeftOutDown2,
    FDContourV3EyeLeftOutDown3,
    FDContourV3EyeLeftInDown1,
    FDContourV3EyeLeftInDown2,
    FDContourV3EyeLeftInDown3,
    FDContourV3EyeLeftInUp3,
    FDContourV3MouthRightDown3,
    FDContourV3MouthRightUP3,
    FDContourV3MouthRightDown4,
    FDContourV3LipMidUP1,
    FDContourV3LipRightUP3,
    FDContourV3LipRightUP4,
    FDContourV3LipRightUP5,
    FDContourV3LipMidUP2,
    FDContourV3LipMidUP3,
    FDContourV3LipRightUP6,
    FDContourV3LipMidUP4,
    FDContourV3MouthRightUP4,
    FDContourV3LipMidDown1,
    FDContourV3MouthRightDown5,
    FDContourV3LipMidDown2,
    FDContourV3LipRightDown3,
    FDContourV3LipMidDown3,
    FDContourV3LipMidDown4,
    FDContourV3MouthLeftDown3,
    FDContourV3MouthLeftUP3,
    FDContourV3MouthLeftDown4,
    FDContourV3LipMidUP6,
    FDContourV3LipLeftUP3,
    FDContourV3LipLeftUP4,
    FDContourV3LipLeftUP5,
    FDContourV3LipMidUP7,
    FDContourV3LipMidUP8,
    FDContourV3LipLeftUP6,
    FDContourV3MouthLeftUP4,
    FDContourV3LipMidDown5,
    FDContourV3MouthLeftDown5,
    FDContourV3LipMidDown6,
    FDContourV3LipLeftDown3,
    FDContourV3LipMidDown7,
    FDContourV3Chin4,
    FDContourV3FaceRight21,
    FDContourV3FaceLeft21,
    FDContourV3FaceLeft22,
    FDContourV3FaceLeft23,
    FDContourV3FaceLeft24,
    FDContourV3FaceLeft25,
    FDContourV3FaceLeft26,
    FDContourV3FaceLeft27,
    FDContourV3FaceLeft28,
    FDContourV3FaceRight22,
    FDContourV3FaceRight23,
    FDContourV3FaceRight24,
    FDContourV3FaceRight25,
    FDContourV3FaceRight26,
    FDContourV3FaceRight27,
    FDContourV3FaceLeft29,
    FDContourV3FaceRight28,
    FDContourV3FaceRight29,
    FDContourV3FaceLeft30,
    FDContourV3FaceRight30,
    FDContourV3FaceRight31,
    FDContourV3FaceLeft31,
    FDContourV3FaceRight32,
    FDContourV3FaceLeft32,
    FDContourV3FaceTop20,
    FDContourV3FaceTop21,
    FDContourV3FaceTop22,
    FDContourV3FaceTop23,
    FDContourV3FaceTop24,
    FDContourV3FaceTop25,
    FDContourV3FaceTop26,
    FDContourV3FaceTop27,
    FDContourV3FaceTop28,
    FDContourV3FaceTop29,
    FDContourV3FaceTop30,
    FDContourV3FaceTop31,
    FDContourV3FaceTop32,
    FDContourV3FaceTop33,
    FDContourV3FaceTop34,
    FDContourV3FaceTop35,
    FDContourV3FaceTop36,
    FDContourV3FaceTop37,
    FDContourV3FaceTop38,
    FDContourV3FaceTop39,
    FDContourV3BrowLeftInDown1,
    FDContourV3BrowLeftOutDown1,
    FDContourV3BrowLeftOutDown2,
    FDContourV3BrowRightOutDown1,
    FDContourV3BrowRightInDown1,
    FDContourV3BrowRightInDown2,
    FDContourV3BrowLeftInUp1,
    FDContourV3BrowLeftOutUp1,
    FDContourV3BrowLeftInUp2,
    FDContourV3BrowRightOutDown2,
    FDContourV3BrowLeftOutUp2,
    FDContourV3BrowRightInUp1,
    FDContourV3BrowLeftInDown2,
    FDContourV3BrowRightOutUp1,
    FDContourV3BrowRightOutUp2,
    FDContourV3BrowRightInUp2,
    FDContourV3NoseCenter12,
    FDContourV3NoseCenter13,
    FDContourV3NoseCenter14,
    FDContourV3NoseLeft15,
    FDContourV3NoseRight15,
    FDContourV3MouthRight1,
    FDContourV3MouthLeft1,
    FDContourV3Max              /* Number of Indices */
};

/// @brief Face ROI information.
struct FDFaceROI
{
    UINT32      confidence;   ///< Confidence that a real face is detected.
    CHIPoint    center;       ///< Center of the face.
    UINT32      width;        ///< Width of the face.
    UINT32      height;       ///< Height of the face.
    INT32       rollAngle;    ///< Roll angle of the face.
    INT32       pose;         ///< Pose angle of the face.
};

/// @brief Mask ROI information.
struct FDMaskROI
{
    UINT32      confidence;   ///< Confidence of the mask.
    CHIPoint    center;       ///< Center of the mask.
    UINT32      width;        ///< Width of the mask.
    UINT32      height;       ///< Height of the mask.
};

/// @brief Point attribute information for a face.
struct FDFacePoint
{
    CHIPoint    position;    ///< Indicates the position of the face point.
    UINT32      confidence;  ///< Indicates the confidence of the face point.
                             ///  @newpagetable
};

/// @brief Version numbers of the contour results.
enum FDContourResultVersion
{
    FDContourResultVersionUnknown = -1,   ///< Version unknown
    FDContourResultVersion0       =  0,   ///< Currently unsupported.
    FDContourResultVersion1,              ///< Version 1 is for 115 points.
    FDContourResultVersion2,              ///< Version 2 is for 300 points.
    FDContourResultVersion3,              ///< Version 3 is for 300 points.
    FDContourResultVersion4,              ///< Version 4 is for custom 300 points.
    FDContourResultVersionMax             ///< Maximum number of versions.
};

/// @brief Information for sparse landmark points.
struct FDFaceSparseLM
{
    BOOL        valid;                                 ///< Indicates whether this information is valid.
    FDFacePoint sparseLMPoint[FDFaceSparseLMPointMax]; ///< Array of sparse landmark points.
};

/// @brief Information about the precise face angle.
struct PreciseFaceAngle
{
    INT32       preciseYaw;                            ///< Indicates the precise yaw (or left/right) direction of the face.
                                                       ///
                                                       ///  @values -180 through 179, where a positive value means the face is
                                                       ///  facing right.

    INT32       preciseRoll;                           ///< Indicates the precise roll (or rotate) angle of the face.
                                                       ///
                                                       ///  @values -180 through 179, where a positive value means the face is
                                                       ///  rotated clockwise in-plane.

    INT32       precisePitch;                          ///< Indicates the precise pitch (or up/down) direction of the face.
                                                       ///
                                                       ///  @values -180 through 179, where a positive value means the face is
                                                       ///  in the upward direction
};

/// @brief Information for facial contour points.
struct FDFaceContour
{
    BOOL                   valid;                      ///< Indicates whether this information is valid.
                                                       ///
                                                       ///  @valuesbul
                                                       ///  - 0 -- Not valid
                                                       ///  - 1 -- Valid @tablebulletend

    FDContourResultVersion resultVersion;              ///< Contour result version
    INT32                  numPointsPerFace;           ///< Number of detected points
    PreciseFaceAngle       preciseFaceAngle;           ///< Information about the precise face angles

    /// @brief Union of contour point arrays.
    union
    {
        FDFacePoint contourPoint[FDContourMax];        ///< Array of contour points.
        FDFacePoint contourV1Point[FDContourV1Max];    ///< Array of contour points for version 1.
        FDFacePoint contourV2Point[FDContourV2Max];    ///< Array of contour points for version 2.
        FDFacePoint contourV3Point[FDContourV3Max];    ///< Array of contour points for version 3.
        FDFacePoint contourV4Point[FDContourV4Max];    ///< Array of contour points for version 4.
    };
};

/// @brief Information for the gaze direction.
struct FDFaceGazeDirection
{
    BOOL    valid;              ///< Indicates whether this information is valid.
                                ///
                                ///  @valuesbul
                                ///  - 0 -- Not valid
                                ///  - 1 -- Valid @tablebulletend

    INT32   leftRightGaze;      ///< Indicates the left/right gaze direction.
                                ///
                                ///  @values -90 to 90, where the direction is with respect to the image plane

    INT32   upDownGaze;         ///< Indicates the up/down gaze direction.
                                ///
                                ///  @values -90 to 90, where the direction is with respect to the image plane

    UINT32  confidence;         ///< Indicates the confidence value for gaze detection.
                                ///
                                ///  @values 0 to 1000, where a higher value indicates a higher confidence in the estimation
};

/// @brief Information for facial blink estimation.
struct FDFaceBlinkEstimation
{
    BOOL    valid;              ///< Indicates whether this information is valid.
                                ///
                                ///  @valuesbul
                                ///  - 0 -- Not valid
                                ///  - 1 -- Valid @tablebulletend

    BOOL    blinkDetected;      ///< Indicates whether a blink is detected.
                                ///
                                ///  @valuesbul
                                ///  - 0 -- FALSE
                                ///  - 1 -- TRUE (blink detected) @tablebulletend

    INT32   leftBlink;          ///< Left eye blink ratio.
                                ///
                                ///  @valuesbul 1 to 1000
                                ///  - A value closer to 1 means the eye is closer to being fully opened.
                                ///  - A value closer to 1000 means the eye is closer to being fully closed. @tablebulletend

    INT32   rightBlink;         ///< Right eye blink ratio.
                                ///
                                ///  @valuesbul 1 to 1000
                                ///  - A value closer to 1 means the eye is closer to being fully opened.
                                ///  - A value closer to 1000 means the eye is closer to being fully closed. @tablebulletend
};

/// @brief Different expressions for faces.
enum FDExpressionIndex
{
    FDExpressionUncertain = 0,    ///< Expression is ambiguous.
    FDExpressionSurprise,         ///< Expression surprise.
    FDExpressionFear,             ///< Expression fear.
    FDExpressionDisgust,          ///< Expression disgust.
    FDExpressionHappiness,        ///< Expression happiness.
    FDExpressionSad,              ///< Expression sad.
    FDExpressionAnger,            ///< Expression anger.
    FDExpressionNeutral,          ///< Expression neutral.
    FDExpressionCount             ///< Maximum number of expressions.
};

/// @brief Contains information about a facial expression.
struct FDFaceExpression
{
    BOOL                valid;                                      ///< Indicates whether the information is valid.
                                                                    ///
                                                                    ///  @valuesbul
                                                                    ///  - 0 -- Not valid
                                                                    ///  - 1 -- Valid @tablebulletend

    UINT32              expressionConfidences[FDExpressionCount];   ///< Array of confidences for all expressions.
                                                                    ///
                                                                    ///  Range: [0, 1000]

    FDExpressionIndex   bestExpression;                             ///< Expression that best describes the face.
};

/// @brief Defines the gender for faces.
enum FDGenderIndex
{
    FDGenderUncertain = 0,  ///< Gender is ambiguous.
    FDGenderFemale,         ///< Gender female.
    FDGenderMale,           ///< Gender male.
    FDGenderCount           ///< Max gender count.
};

/// @brief Contains information about the gender of a face.
struct FDFaceGender
{
    BOOL            valid;                              ///< Indicates whether the information is valid.
                                                        ///
                                                        ///  @valuesbul
                                                        ///  - 0 -- Not valid
                                                        ///  - 1 -- Valid @tablebulletend

    UINT32          genderConfidences[FDGenderCount];   ///< Array of confidences for all genders.
                                                        ///
                                                        ///  Range: [0, 1000]

    FDGenderIndex   bestGender;                         ///< Gender that best describes the face
};

/// @brief Information for a face mask.
struct FDFaceMask
{
    BOOL      valid  ;  ///< Indicates whether there is a mask in the face.
                        ///
                        ///  @valuesbul
                        ///  - 0 -- FALSE
                        ///  - 1 -- TRUE (blink detected) @tablebulletend

    FDMaskROI maskROI;  ///< Information about the mask region.
};

/// @brief Information for face attributes.
struct FDFaceInfo
{
    INT32                 faceID;          ///< Unique ID of the face.

    BOOL                  newFace;         ///< Indicates whether this face is a new face.
                                           ///
                                           ///  @valuesbul
                                           ///  - 0 -- FALSE
                                           ///  - 1 -- TRUE (new face) @tablebulletend

    FDFaceROI             faceROI;         ///< ROI information for the face.
    FDFaceSparseLM        sparseLM;        ///< Information about the sparse landmark for a face.
    FDFaceMask            mask;            ///< Information about the mask for a face.
    FDFaceContour         contour;         ///< Face contour information.
    FDFaceGazeDirection   gaze;            ///< Information about the gaze direction.
    FDFaceBlinkEstimation blink;           ///< Information about the blink estimation.
    FDFaceExpression      expression;      ///< Information about the expression on a face.
    FDFaceGender          gender;          ///< Information about gender of a face.
    INT32                 history;         ///< History of the face attributes.
    INT32                 weight;          ///< Weight of each face per the size, distance from center, and history.
};

/// @brief Results of a face detection.
struct FDResults
{
    UINT8       numFacesDetected;           ///< Number of faces that were detected.
    FDFaceInfo  faceInfo[FDMaxFaceCount];   ///< Array of faces detected that have face information.
};

/// @brief Intermediate (probable) results of a face detection.
struct FDIntermediateResults
{
    UINT8       numFacesDetected;                       ///< Number of faces that were detected.
    FDFaceInfo  faceInfo[FDMaxFaceCountIntermediate];   ///< Array of intermediate faces that were detected with face
                                                        ///  information.
};

#ifndef DOXYGEN_SHOULD_SKIP_THIS
CAMX_BEGIN_PACKED

// FD Metadata results structure layouts

using FDPoint = CHIPoint ;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


/// @brief Describes the Face Detection ROI.
struct FDROIRegion
{
    INT32 left;        ///< Left of the region
    INT32 top;         ///< Top of the region
    INT32 right;       ///< Right of the region
    INT32 bottom;      ///< Bottom of the region
};

/// @brief Metadata for a face rectangle.
struct FDMetaDataFaceRect
{
    FDPoint topLeft;        ///< Point that indicates the top left of the face rectangle.
    FDPoint bottomRight;    ///< Point that indicates the bottom right of the face rectangle.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the face landmark layout.
struct FDMetaDataFaceLandmark
{
    FDPoint leftEyeCenter;   ///< Point that indicates the left eye is centered.
    FDPoint rightEyeCenter;  ///< Point that indicates the right eye is centered.
    FDPoint mouthCenter;     ///< Point that indicates the mouth is centered.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the mask ROI results.
struct FDMetaDataMaskResults
{
    INT32       numMasks;                ///< Num of face mask detected.
    INT32       faceID[FDMaxFaceCount];  ///< Face ID of mask ROI.
    FDROIRegion maskROI[FDMaxFaceCount]; ///< Mask ROI information.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for upper body detection ROI results with respect to active array.
struct FDMetadataUpperBodyResults
{
    UINT32       numHeads;                      ///< Number of the detected head(s)
    INT32        linkedFaceId[FDMaxFaceCount];  ///< ID of the face associated with the head/body
    FDROIRegion  headROI[FDMaxFaceCount];       ///< Head ROI
    BOOL         torsoValid[FDMaxFaceCount];    ///< Indicators of whether a torso is detected.
    FDROIRegion  torsoROI[FDMaxFaceCount];      ///< Torso ROI
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the blink degree layout.
struct FDMetaDataBlinkDegree
{
    UINT8   leftBlink;     ///< Left eye blink ratio.
                           ///
                           ///  @values 1 to 100

    UINT8   rightBlink;    ///< Right eye blink ratio.
                           ///
                           ///  @values 1 to 100
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the face direction layout (previously called gaze direction).
struct FDMetaDataFaceDirection
{
    INT32   upDown;       ///< Indicates the up/down direction of the face.
                          ///
                          ///  @values -180 to 179, where a positive value means the face is in the upward direction

    INT32   leftRight;    ///< Indicates the left/right direction of the face.
                          ///
                          ///  @values -180 to 179, where a positive value means the face is facing right

    INT32   roll;         ///< Indicates the roll angle of the face.
                          ///
                          ///  @values -180 to 179, where a positive value means the face is rotated clockwise in-plane
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the gaze direction layout (previously called gaze degree).
struct FDMetaDataGazeDirection
{
    INT8   leftRight;     ///< Indicates the left/right gaze direction.
                          ///
                          ///  @values -90 to 90, where the direction is with respect to the image plane

    INT8   topBottom;     ///< Indicates the up/down gaze direction.
                          ///
                          ///  @values -90 to 90, where the direction is with respect to the image plane
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for a facial expression.
struct FDMetaDataFaceExpression
{
    FDExpressionIndex   bestExpression;                            ///< Expression that best describes the face.
    INT32               faceID;                                    ///< Unique identifier for the detected face.
    UINT32              expressionConfidences[FDExpressionCount];  ///< Confidences for all expressions.
                                                                   ///
                                                                   ///Range: [0, 1000]
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the facial expression results.
struct FDMetaDataFaceExpressionResults
{
    INT32                       version;                        ///< Version of the expression detection.

    UINT32                      numExpFaces;                    ///< Number of face detected with an expression.
                                                                ///
                                                                ///  @values 0 to 10

    INT32                       reserved[2];                    ///< Padding reserved for future use. Must be initialized to
                                                                ///  zeros.
    FDMetaDataFaceExpression    faceExpression[FDMaxFaceCount]; ///< Array of facial expression information for detected faces.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the gender of a face.
struct FDMetaDataFaceGender
{
    FDGenderIndex   bestGender;                         ///< Gender that best describes the face.
    INT32           faceID;                             ///< Unique identifier for the detected face.
    UINT32          genderConfidences[FDGenderCount];   ///< Array of confidences for all genders.
                                                        ///
                                                        ///  Range: [0, 1000][0, 1000]
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Metadata for the facial expression results.
struct FDMetaDataFaceGenderResults
{
    INT32                       version;                    ///< Version of the gender detection.

    UINT32                      numGenFaces;                ///< Number of faces detected with gender.
                                                            ///
                                                            ///  @values 0 to 10

    INT32                       reserved[2];                ///< Padding reserved for future use. Must be initialized to zeros.
    FDMetaDataFaceGender        faceGender[FDMaxFaceCount]; ///< Array of gender information for detected faces.
} /** @cond */ CAMX_PACKED /** @endcond */;


/// @brief Face Detection metadata results. These results are in line with Android metadata tag expectations.
struct FDMetaDataResults
{
    UINT8                     numFaces;                           ///< Number of faces detected.
    INT32                     faceID[FDMaxFaceCount];             ///< Array of unique IDs for detected faces.
    UINT8                     faceScore[FDMaxFaceCount];          ///< Array of confidence scores for detected faces.
    FDMetaDataFaceRect        faceRect[FDMaxFaceCount];           ///< Array of rectangle information for detected faces.
    FDMetaDataFaceLandmark    faceLandmark[FDMaxFaceCount];       ///< Array of landmark information for detected faces.

    UINT8                     blinkDetected[FDMaxFaceCount];      ///< Array of blink-detected flags for detected faces.
                                                                  ///
                                                                  ///  @valuesbul{of the flags in the array}
                                                                  ///  - 0 -- FALSE
                                                                  ///  - 1 -- TRUE @tablebulletend

    FDMetaDataBlinkDegree     blinkDegree[FDMaxFaceCount];        ///< Array of blink degree values for detected faces.

    INT8                      facePoseAngle[FDMaxFaceCount];      ///< Array of face pose values for detected faces.
                                                                  ///
                                                                  ///  @values -90, -45, 0, 45, 90

    FDMetaDataFaceDirection   faceAngleDirection[FDMaxFaceCount]; ///< List of face angle direction values for detected faces.
    FDMetaDataGazeDirection   gazeDirection[FDMaxFaceCount];      ///< List of gaze direction values for detected faces.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Version 1 of the metadata for facial contour points.
struct FDMetaDataV1FaceContour
{
    FDPoint                   contourPoint[FDContourV1Max];       ///< Array of contour points.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Version 2 of the metadata for facial contour points.
struct FDMetaDataV2FaceContour
{
    FDPoint                   contourPoint[FDContourV2Max];       ///< Facial contour points.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Version 3 of the metadata for facial contour points.
struct FDMetaDataV3FaceContour
{
    FDPoint                   contourPoint[FDContourV3Max];       ///< Facial contour points.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Version 4 of the metadata for custom facial contour points.
struct FDMetaDataV4FaceContour
{
    FDPoint                   contourPoint[FDContourV4Max];       ///< Facial contour points.
} /** @cond */ CAMX_PACKED /** @endcond */;

/// @brief Facial contour results with a version number for backward compatibility.
///
/// To access the contour points, follow these steps:
/// -# Read the contour result header of size FDContourResultHeaderSize.
/// -# Calculate the size of the contour points in bytes as numFaces * numPointsPerFace * sizeof(INT32).
/// -# Read the contour point based on the offset from the start of the result buffer (header size) and size of the contour
///    points.
struct FDMetaDataVersionedFaceContourResults
{
    CamxFDCTDResultStatus          status;                   ///< Result of the facial contour.
    INT32                          version;                  ///< Version number of the facial contour point definition.
    INT32                          numPointsPerFace;         ///< Number of contour points per face.
    UINT32                         numFaces;                 ///< Number of faces with contour information.
    INT32                          reserved[4];              ///< Padding reserved for future use. Must be initialized to NULL.
    INT32                          faceID[FDMaxFaceCount];   ///< Array of contour IDs.
    FDPoint                        points[1];                ///< Array of contour points.
} /** @cond @endcond */;

#ifndef DOXYGEN_SHOULD_SKIP_THIS
CAMX_END_PACKED
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


/// @brief Used to calculate the maximum number of facial contour points for all versions.
union FDContourMaxSet
{
    char v1[FDContourV1Max];          ///< Array of facial contour results for version 1.
    char v2[FDContourV2Max];          ///< Array of facial contour results for version 2.
    char v3[FDContourV3Max];          ///< Array of facial contour results for version 3.
    char v4[FDContourV4Max];          ///< Array of facial contour results for version 4.
};

/// Maximum number of facial contour points per face for all result versions.
static const UINT32 FDContourPointPerFaceMax = sizeof(FDContourMaxSet);

/// Maximum contour point data size in bytes.
static const UINT32 FDContourPointDataSizeMax = FDMaxFaceCount * FDContourPointPerFaceMax * sizeof(FDPoint);

/// Gets the size of the structure member.
#define STRUCT_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)

/// Header size (in bytes) of the versioned facial contour result.
/// @hideinitializer
static const INT32 FDContourResultHeaderSize = STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, status)           +
                                               STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, version)          +
                                               STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, numPointsPerFace) +
                                               STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, numFaces)         +
                                               STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, reserved)         +
                                               STRUCT_MEMBER_SIZE(FDMetaDataVersionedFaceContourResults, faceID);

/// Maximum data size (in bytes) of the versioned facial contour result.
static const INT32 FDContourResultSizeMax       = FDContourResultHeaderSize + FDContourPointDataSizeMax;

/// Maximum data count of the versioned facial contour result.
/// @newpage
static const UINT32 FDContourResultDataCountMax = FDContourResultSizeMax / sizeof(INT32);

/// Gets the total size of the versioned facial contour result.
#define FD_CONTOUR_RESULT_INT32_DATA_COUNT(pCTResult)                                                                   \
    ((FDContourResultHeaderSize + pCTResult->numFaces * pCTResult->numPointsPerFace * sizeof(FDPoint)) / sizeof(INT32))

/// @brief Information about the face size.
struct FDFaceSize
{
    enum FDFaceSizeType type;   ///< Face size type: floating or fixed.

    /// @brief Union of face size attributes.
    struct
    {
        UINT32  size;           ///< Absolute value of the face size.
        FLOAT   ratio;          ///< Face size ratio. The calculated size based on this ratio with respect to the input frame.
    };
};

/// @brief Configuration parameters for face detection hardware.
struct FDHwConfig
{
    BOOL            enable;                 ///< Indicates whether hardware detection is enabled.
                                            ///
                                            ///  @valuesbul
                                            ///  - 0 -- FALSE
                                            ///  - 1 -- TRUE @tablebulletend

    FDFaceSize      minFaceSize;            ///< Minimum face size configuration for the hardware.
    FDFaceSize      maxFaceSize;            ///< Maximum face size configuration for the hardware.

    BOOL            enableUpFrontAngles;    ///< Indicates whether to enable upFront-only detection when possible.
                                            ///
                                            ///  @valuesbul
                                            ///  - 0 -- FALSE
                                            ///  - 1 -- TRUE
                                            ///
                                            ///  When enabled: @vertspace{-3}
                                            ///  - If upFront is possible, this parameter uses the upFrontAngle field for
                                            ///    configuration.
                                            ///  - If upFront is not possible, this parameter uses the angle field for
                                            ///    configuration. @tablebulletend

    FDSearchAngle   angle;                  ///< Angle configuration for faces in all poses.

    UINT32          upFrontAngle;           ///< Angle configuration for faces in all poses.
                                            ///
                                            ///  This parameter is used for detecting only upFront faces.

    UINT32          threshold;              ///< Threshold for determining a face.
    UINT32          noFaceFrameSkip;        ///< Frame skip count when no faces are detected.
    UINT32          newFaceFrameSkip;       ///< Frame skip count when at least one face is detected.

    BOOL            enableHWFP;             ///< Indicates whether the hardware False Positive filter is enabled.
                                            ///
                                            ///  @valuesbul
                                            ///  - 0 -- FALSE
                                            ///  - 1 -- TRUE @tablebulletend
};

/// @brief Configuration parameters for FD deep learning (DL).
struct FDDlConfig
{
    BOOL            enable;                                 ///< Indicates whether to enable Deep Learning Face Detection.
                                                            ///
                                                            ///  @valuesbul
                                                            ///  - 0 -- FALSE (no restriction on direction)
                                                            ///  - 1 -- TRUE @tablebulletend

    INT             version;                                ///< Version of deep learning for Face Detection.
    FDFaceSize      minFaceSize;                            ///< Minimum face size configuration.
    FDFaceSize      maxFaceSize;                            ///< Maximum face size configuration.
};

/// @brief Configuration parameters for the ROI manager.
struct FDROIManagerConfig
{
    BOOL    enable;                          ///< Indicates whether the face ROI manager is enabled.
                                             ///
                                             ///  @valuesbul
                                             ///  - 0 -- FALSE
                                             ///  - 1 -- TRUE @tablebulletend

    UINT32  newNormalFaceConfidence;         ///< Confidence to determine whether a face is actually a face during detection.
    UINT32  existingFaceConfidence;          ///< Confidence to determine an existing face.
    UINT32  angleDiffForStrictConfidence;    ///< Angle in each direction after which strict confidence values are used to
                                             ///  determine the face.
    UINT32  strictNewNormalFaceConfidence;   ///< Strict confidence to determine whether a face is a face during detection.
    UINT32  strictExistingFaceConfidence;    ///< Strict confidence to determine an existing face.
    FLOAT   faceLinkMoveDistanceRatio;       ///< Threshold for the Move Distance ratio when linking a face.
    FLOAT   faceLinkMinSizeRatio;            ///< Threshold for the minimum size ratio when linking a face.
    FLOAT   faceLinkMaxSizeRatio;            ///< Threshold for the maximum size ratio when linking a face.
    FLOAT   faceLinkRollAngleDifference;     ///< Threshold for the roll angle difference when linking a face.
    UINT32  smallNewNormalFaceConfidence;    ///< Confidence to determine a small face as a typical face during detection.
    UINT32  smallExistingFaceConfidence;     ///< Confidence to determine an existing small face.
    UINT32  smallFaceSizeCutoff;             ///< Size cutoff for a small face.
    UINT32  yawNewNormalFaceConfidence;      ///< Confidence in determining a yaw face as a normal face during detection.
    UINT32  yawExistingFaceConfidence;       ///< Confidence in determining an existing yaw face.

    UINT32  fullHistoryLength;               ///< Size of the full historical data stored for tracking.
                                             ///
                                             ///  @values 1 to 20

    UINT32  positionRecentHistoryLength;     ///< Size of the recent historical data for an ROI position.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)
                                             ///
                                             ///  Samples in the history are used to assess the internal prediction errors.

    FLOAT   positionMotionThreshold;         ///< Changes in position values above this threshold are considered to be due to
                                             ///  face motion.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   positionStillThreshold;          ///< Changes in position values below this threshold are considered to be due to
                                             ///  noise.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  sizeRecentHistoryLength;         ///< Size of the recent historical data for an ROI size.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)
                                             ///
                                             ///  Samples in the history are used to assess the internal prediction errors.

    FLOAT   sizeMotionThreshold;             ///< Changes in size values above this threshold are considered to be due to
                                             ///  face motion.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   sizeStillThreshold;              ///< Changes in size values below this threshold are considered to be due to noise.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   noFaceFDFPSScale;                ///< FPS at which FD should run when no faces are detected.
                                             ///
                                             ///  @values 0.01 to 1.0 (must be @le movingFaceMaxFDFPSScale)
                                             ///
                                             ///  The value is specified as a scale factor relative to the tracker/preview FPS.

    FLOAT   stillFaceFDFPSScale;             ///< FPS at which FD should run when faces are very still or static.
                                             ///
                                             ///  @values 0.01 to 1.0 (must be @le movingFaceMinFDFPSScale)
                                             ///
                                             ///  The value is specified as a scale factor relative to the tracker/preview FPS.

    FLOAT   movingFaceMinFDFPSScale;         ///< FPS at which FD should run when faces are moving slowly (in a
                                             ///  predictable manner).
                                             ///
                                             ///  @values 0.01 to 1.0 (must be @le movingFaceMaxFDFPSScale)
                                             ///
                                             ///  The value is specified as a scale factor relative to the tracker/preview FPS.

    FLOAT   movingFaceMaxFDFPSScale;         ///< Maximum FPS at which FD can run when faces are moving for this purpose.
                                             ///
                                             ///  @values 0.01 to 1.0
                                             ///
                                             ///  The value is specified as a scale factor relative to the tracker/preview FPS.

    FLOAT   stillFaceFDFPSThreshold;         ///< Mean error in the ROI position and size, up to which a still face can
                                             ///  tolerate.
                                             ///
                                             ///  @values 0.0 to 100.0

    FLOAT   movingFaceMaxFDFPSThreshold;     ///< Maximum mean error in the ROI position and size that can be tolerated
                                             ///  before switching to a higher FPS.
                                             ///
                                             ///  @values 0.0 to 100.0

    UINT32  waitCountForFPSSwitching;        ///< Number of frames to wait before switching to a lower FPS.
                                             ///
                                             ///  @values 1 to 20

    UINT32  newMaskConfidence;               ///< Minimum confidence required to accept a new mask for tracking.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  trackingMaskConfidence;          ///< Minimum confidence required to continue tracking a face mask.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  maskHoldCount;                   ///< Same as FDConfig.holdCount, but for mask tracking.
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  maskDelayCount;                  ///< Same as FDConfig.delayCount, but for mask tracking
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  maskPositionRecentHistoryLength; ///< Same as FDConfig.positionRecentHistoryLength, but for mask tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   maskPositionMotionThreshold;     ///< Same as FDConfig.positionMotionThreshold, but for mask tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   maskPositionStillThreshold;      ///< Same as FDConfig.positionStillThreshold, but for mask tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  maskSizeRecentHistoryLength;     ///< Same as FDConfig.sizeRecentHistoryLength, but for mask tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   maskSizeMotionThreshold;         ///< Same as FDConfig.sizeMotionThreshold, but for mask tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   maskSizeStillThreshold;          ///< Same as FDConfig.sizeStillThreshold, but for mask tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  sparseLMRecentHistoryLength;     ///< Same as FDConfig.positionRecentHistoryLength, but for sparse landmarks.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   sparseLMMotionThreshold;         ///< Same as FDConfig.positionMotionThreshold, but for sparse landmarks.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   sparseLMStillThreshold;          ///< Same as FDConfig.positionStillThreshold, but for sparse landmarks.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  newHeadConfidence;               ///< Minimum confidence required to accept a new head for tracking.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  trackingHeadConfidence;          ///< Minimum confidence required to continue tracking head.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  headHoldCount;                   ///< Same as FDConfig.holdCount, but for head tracking.
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  headDelayCount;                  ///< Same as FDConfig.delayCount, but for head tracking
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  headPositionRecentHistoryLength; ///< Same as FDConfig.positionRecentHistoryLength, but for head tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   headPositionMotionThreshold;     ///< Same as FDConfig.positionMotionThreshold, but for head tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   headPositionStillThreshold;      ///< Same as FDConfig.positionStillThreshold, but for head tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  headSizeRecentHistoryLength;     ///< Same as FDConfig.sizeRecentHistoryLength, but for head tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   headSizeMotionThreshold;         ///< Same as FDConfig.sizeMotionThreshold, but for head tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   headSizeStillThreshold;          ///< Same as FDConfig.sizeStillThreshold, but for mask tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  newBodyConfidence;               ///< Minimum confidence required to accept a new body for tracking.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  trackingBodyConfidence;          ///< Minimum confidence required to continue tracking body.
                                             ///
                                             ///  @values 0 to 1000

    UINT32  bodyHoldCount;                   ///< Same as FDConfig.holdCount, but for mask tracking.
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  bodyDelayCount;                  ///< Same as FDConfig.delayCount, but for mask tracking
                                             ///
                                             ///  @values 0 to 5 (must be @le fullHistoryLength)

    UINT32  bodyPositionRecentHistoryLength; ///< Same as FDConfig.positionRecentHistoryLength, but for body tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   bodyPositionMotionThreshold;     ///< Same as FDConfig.positionMotionThreshold, but body tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   bodyPositionStillThreshold;      ///< Same as FDConfig.positionStillThreshold, but for body tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    UINT32  bodySizeRecentHistoryLength;     ///< Same as FDConfig.sizeRecentHistoryLength, but for body tracking.
                                             ///
                                             ///  @values 1 to 20 (must be @le fullHistoryLength)

    FLOAT   bodySizeMotionThreshold;         ///< Same as FDConfig.sizeMotionThreshold, but for body tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

    FLOAT   bodySizeStillThreshold;          ///< Same as FDConfig.sizeStillThreshold, but for body tracking.
                                             ///
                                             ///  @values 0.01 to 32.0

};

/// @brief Information about the version of the face detection tuning data tool. The software can ignore this version number.
struct FDConfigVersion
{
    UINT32          id;                     ///< ID of the tuning tool.
    INT32           majorRevision;          ///< Major version of the tuning tool.
    INT32           minorRevision;          ///< Minor version of the tuning tool.
    INT32           incrRevision;           ///< Incremental version of the tuning tool.
};

/// @brief Configuration parameters for the software preprocessing trigger.
struct FDSWPreprocessConfig
{
    FLOAT   exposureShortBySafeThreshold;   ///< Threshold for triggering preprocessing of a face detection frame based
                                            ///  on the ratio of short and safe exposure sensitivities.
    FLOAT   deltaEVFromTargetThreshold;     ///< Threshold for triggering preprocessing of a face detection frame based on the
                                            ///  delta exposure value from the target.
};

/// @brief Configuration parameters for facial attributes.
struct FDFacialAttributeConfig
{
    UINT32  CTDMaxNumberOfFacesSingleCamera; ///< Maximum number of faces to use when running contour detection.
    UINT32  CTDMaxNumberOfFacesMultiCamera;  ///< Maximum number of faces to use when running contour detection.
    UINT32  CTDLMinFaceSize;                 ///< Minimum face size cutoff for Deep Learning contour detection.
    INT32   CTDLYawAngleCutoff;              ///< Yaw angle cutoff for Deep Learning contour detection.

    BOOL    bFDStabilizationOverride;        ///< Indicates whether published unstabilized face detection is the result when
                                             ///  contour detection is enabled.
                                             ///
                                             ///  @valuesbul
                                             ///  - 0 -- FALSE
                                             ///  - 1 -- TRUE (face detection results) @tablebulletend

};

/// @brief Configuration parameters for the face detection tuning tool.
struct FDConfig
{
    UINT32                  id;                            ///< ID of the tuning tool.
    FDConfigVersion         FDConfigData;                  ///< Tuning configuration information.
    INT8                    maxNumberOfFaces;              ///< Maximum number of faces to detect in the overall face detection
                                                           ///  solution.
    UINT32                  maxFPSWithFaces;               ///< Maximum number of frames per second for running face detection
                                                           ///  processing when faces are detected.
    UINT32                  maxFPSWithNoFaces;             ///< Maximum number of frames per second for running face detection
                                                           ///  processing when no faces are detected.
    UINT32                  multiCameraMaxFPSWithFaces;    ///< Maximum FPS to run face detection processing when faces are
                                                           ///  detected.
    UINT32                  multiCameraMaxFPSWithNoFaces;  ///< Maximum number of frames per second for running face detection
                                                           ///  processing when no faces are detected.
    UINT32                  initialNoFrameSkipCount;       ///< First number of frames that are always processed for face
                                                           ///  detection.
    UINT32                  maxPendingFrames;              ///< Maximum number of allowed frames in a pending queue.
    FLOAT                   areaRatioThreshold;            ///< Threshold of the area ratio between face ROI within the final
                                                           ///  FOV and raw ROI
                                                           ///
                                                           ///< @values 0 to 0.5

    UINT32                  delayCount;                    ///< For the number of frames specified by the delay count, defer
                                                           ///  the publishing of a new face ROI as the result of a newly
                                                           ///  detected face.
    UINT32                  holdCount;                     ///< Number of frames to keep output face information after the face
                                                           ///  is lost during tracking.

    BOOL                    supportRectROI;                ///< Indicates whether to switch between a rectangular or square
                                                           ///  ROI.
                                                           ///
                                                           ///  @valuesbul
                                                           ///  - 0 -- Square
                                                           ///  - 1 -- Rectangle @tablebulletend

    FDHwConfig              hwConfig;                      ///< Configuration of face detection hardware.
    FDDlConfig              dlConfig;                      ///< Configuration of Deep Learning detection.
    FDROIManagerConfig      managerConfig;                 ///< Configuration of the ROI manager.
    FDSWPreprocessConfig    swPreprocess;                  ///< Configuration of the software preprocessing trigger.
    FDFacialAttributeConfig facialAttrConfig;              ///< Configuration parameters of facial attributes.
                                                           ///  @newpagetable
};

/// @brief Configuration parameters for the face contour points indices.
struct FDCTPtConfig
{
    UINT32                  configToolVersion;             ///< ID of the tuning tool.
    FDConfigVersion         ConfigFileRevision;            ///< Face contour configuration information.
    UINT32                  numPoints;                     ///< number of points
    UINT32                  indices[FDContourV4Max];       ///< FL custom contour indices
};

/** @} */ /* end_addtogroup chi_fd_macros */

#pragma pack(pop)

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CHIFDPROPERTY_H
