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

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  camxsoftwarestatsinterface.h
/// @brief Software Stats Generation
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CAMXSOFTWARESTATSINTERFACE_H
#define CAMXSOFTWARESTATSINTERFACE_H

#include "chiafcommon.h"
#include "chistatsinterfacedefs.h"
#include "camxdefs.h"
#include "camxosutils.h"
#include "camxutils.h"

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

// Pack data structures to ensure consistent layout.
#pragma pack(push, CDK_PACK_SIZE)

/** @addtogroup chi_stats_stats
@{ */

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GenerateBFStats
///
/// @brief Creates an instance of the generated software Bayer focus statistics.
///
/// @datatypes
/// #StatsDimension \n
/// #AFConfigParams \n
/// #AFBAFStatistics
///
/// @param[in] pImage           Pointer to the address of the Y-plane image buffer.
/// @param[in] pImageDimension  Pointer to the image width and height.
/// @param[in] stride           Image width plus pixel padding.
/// @param[in] pConfiguration   Pointer to the autofocus configuration parameters. The ROI must be one-third of the image
///                             dimensions.
/// @param[in] pBFStats         Pointer to the output Bayer focus structure to be filled.
///
/// @return Indication of failure only if all pixel values are zero. @newpage
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef VOID (*CREATEGENERATEBFSTATS)(
    const UINT8*            pImage,
    const StatsDimension*   pImageDimension,
    const UINT32            stride,
    const AFConfigParams*   pConfiguration,
    AFBAFStatistics*        pBFStats);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @cond GenerateRSStats @endcond
///
/// @brief Creates an instance to the generated software RS statistics.
///
/// @datatypes
/// #StatsDimension \n
/// #AFDStatsRSConfig \n
/// #StatsRowSum
///
/// @param[in] pImage           Pointer to the address of the Y-plane image buffer.
/// @param[in] pImageDimension  Pointer to image width and height.
/// @param[in] stride           Image width plus pixel padding.
/// @param[in] pConfiguration   Pointer to RS configuration from the statistics.
/// @param[in] pRowSumStats     Pointer to the output RS structure to be filled.
///
/// @return Indication of failure only if all pixel values are zero.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef CamxResult (*CREATEGENERATERSSTATS)(
    const UINT8*            pImage,
    const StatsDimension*   pImageDimension,
    const UINT32            stride,
    const AFDStatsRSConfig* pConfiguration,
    StatsRowSum*            pRowSumStats);

/** @} *//* end_addtogroup chi_stats_stats */

#pragma pack(pop)

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CAMXSOFTWARESTATSINTERFACE_H
