/**
 * @file hv_drv_OsdDataPath.h
 * @brief Osd driver layer Datapath selection interface.
 * @verbatim
 * ==============================================================================
 *                        ##### How to use this driver #####
 * ==============================================================================
 * (+) Use Hv_Drv_OsdDataPath_Init(...) to init datapath management data.
 * (+) Use Hv_Drv_OsdDataPath_DrawDDRWhole(...) to draw 2K area to DDR.
 * (+) Use Hv_Drv_OsdDataPath_DrawDDRReal(...) to draw real size area to DDR.
 * (+) Use Hv_Drv_OsdDataPath_ShowDDR(...) to show data formly drawn to DDR.
 * (+) Use Hv_Drv_OsdDataPath_SetDrawMode(...) to set OSD/DDR blend mode.
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-08-22
 */

#ifndef _HV_DRV_OSDDATAPATH_H
#define _HV_DRV_OSDDATAPATH_H


/**
 * @brief Set OSD DDR path enable
 * @param[in] bEnable
 * @return None
 */
VOID Hv_Drv_OsdDataPath_SetDDREnable(BOOL bEnable);

/**
 * @brief Get Draw Parts
 * @param[in] None
 * @return Osd enable flag by bits, WIN0 ~ WIN5 & GRAPHIC
 */
UCHAR8 Hv_Drv_OsdDataPath_GetDrawParts(VOID);

#if (HV_PROJECT_CONFIG_OSD_DDRPATH == HV_CONFIG_ON)

/**
 * @brief Draw 2K Area to DDR
 * @return HV_SUCCESS if copy between double buffer finished, otherwise HV_FAILURE
 */
Status Hv_Drv_OsdDataPath_DrawDDRWhole(VOID);
/**
 * @brief Draw Merged Window Area to DDR
 * @param[in] bDrawToRotateBuffer decides draw to Rotate buffer or Draw Buffer
 * @return HV_SUCCESS if copy between double buffer finished, otherwise HV_FAILURE
 */
Status Hv_Drv_OsdDataPath_DrawDDRReal(BOOL bDrawToRotateBuffer);
/**
 * @brief switch double buffer
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdDataPath_SwitchDrawBuffer(VOID);
/**
 * @brief show data formly drawn to DDR
 * @param[in] bCopyBuffer if copy data between double buffer
 * @return VOID without return
 */
VOID Hv_Drv_OsdDataPath_ShowDDR();

VOID Hv_Drv_OsdDataPath_DoubleBufferCopy(VOID);
#if (HV_OSD_CONFIG_REAL_DDR_CANVAS == HV_CONFIG_ON)
VOID Hv_Drv_OsdDataPath_SetSceneDrawPartsStart(VOID);

VOID Hv_Drv_OsdDataPath_SetSceneDrawPartsEnd(VOID);

VOID Hv_Drv_OsdDataPath_SetSceneDrawParts(OsdSceneDrawPart *pstScenePart);

VOID Hv_Drv_OsdDataPath_SetSceneDrawPartsCurrent(VOID);
#endif

#endif

/**
 * @brief Get Pre-scaler canvas size
 * @param[out] pusWidth canvas width
 * @param[out] pusHeight canvas height
 * @return VOID without return
 */
VOID Hv_Drv_OsdDP_GetPreScalerSize(USHORT16 *pusWidth, USHORT16 *pusHeight);
/**
 * @brief Get Merged Osd Area
 * @param[in] ucFlags enabled windows flag
 * @param[out] pstArea merged area
 * @return VOID without return
 */

VOID Hv_Drv_OsdDataPath_MergeOsdArea(UCHAR8 ucFlags, OsdArea *pstArea);
/**
 * @brief set DDR/OSD blend mode
 * @param[in] enMode mode to set DDR_ONLY: only show DDR path
 *                               OSD_ONLY: only show OSD path
 *                               DDR_FIRST: show both DDR/OSD, DDR cover OSD
 *                               OSD_FIRST: show both DDR/OSD, OSD cover DDR
 * @return VOID without return
 */
VOID Hv_Drv_OsdDataPath_SetDrawMode(OsdHsBlendMode enMode);

VOID Hv_Drv_OsdDataPath_SetVsDivNumber(UCHAR8 ucDiv);

/**
 * @brief get datapath parameters
 * @param[in] None
 * @return datapath parameter
 */
OsdDataPathParam* Hv_Drv_OsdDataPath_GetDataPathParam(VOID);

USHORT16 Hv_Drv_OsdDP_GetRealHActive(VOID);

USHORT16 Hv_Drv_OsdDP_GetRealVActive(VOID);

VOID Hv_Drv_OsdDP_SetOsdScalerup(BOOL bEnable);

VOID Hv_Drv_OsdDataPath_ExpandDrawRange(OsdArea *pstArea, OsdArea *pstMerge);

/**
 * @brief datapath management data init
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdDataPath_Init(VOID);

#endif
