/**
 * @file hv_cal_OsdWindow.h
 * @brief Osd Cal layer Frame interface.
 * @verbatim
 * ==============================================================================
 *                        ##### How to use this driver #####
 * ==============================================================================
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-08-22
 */

#ifndef _HV_CAL_OSDFRAME_H
#define _HV_CAL_OSDFRAME_H

#include "hv_comm_DataType.h"
#include "hv_drv_OsdTypes.h"


/**
 * @brief convert pixel format
 * @param[in] enSrcFormat source pixel format
 * @param[in] enDstFormat destination pixel format
 * @param[in] uiColor color value
 * @return color value of required format
 */
UINT32 Hv_Cal_OsdFrame_PixelFormatConvert(OsdPixelFormat enSrcFormat, OsdPixelFormat enDstFormat, UINT32 uiColor);

/**
 * @brief set frame dividend
 * @param[in] ucDivNum frame dividend
 *                          0: disable
 *                          1: disable
 *                          2: 2
 *                          3: 3
 *                          4: 4
 *                          5: 5
 *                          .
 *                          .
 *                          .
 *                          15: 15
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_VsDivNum(UCHAR8 ucDivNum);

/**
 * @brief set reg_en
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_SetSync(VOID);

/**
 * @brief check VSYNC
 * @param[in] None
 * @return HV_TRUE/HV_FALSE
 */
BOOL Hv_Cal_OsdFrame_CheckSync(VOID);

/**
 * @brief wait VSYNC
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_WaitSync(VOID);

/**
 * @brief set reg_en and wait VSYNC
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_SetAndWaitSync(VOID);

/**
 * @brief set universal alpha enable/disable status
 * @param[in] enPath datapath selection OSD_DATAPATH_GRAPHIC
 *                                      OSD_DATAPATH_DDRREAD
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_SetUniversalAlphaEnable(OsdDataPath enPath, BOOL bEnable);

/**
 * @brief set universal alpha value
 * @param[in] enPath datapath selection OSD_DATAPATH_GRAPHIC
 *                                      OSD_DATAPATH_DDRREAD
 * @param[in] ucValue alpha value
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_SetUniversalAlphaValue(OsdDataPath enPath, UCHAR8 ucValue);

/**
 * @brief set universal alpha mode
 * @param[in] enPath datapath selection OSD_DATAPATH_GRAPHIC
 *                                      OSD_DATAPATH_DDRREAD
 * @param[in] enMode mode selection OSD_ALPHA_FORCE_ALL: all set to same alpha
 *                                  OSD_ALPHA_FORCE_NONZERO: area with alpha not zero set to same alpha
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_SetUniversalAlphaMode(OsdDataPath enPath, OsdAlphaForceMode enMode);

/**
 * @brief Frame initialization function
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Cal_OsdFrame_Init(VOID);

#endif
