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

#ifndef _HV_CAL_OSDWINDOW_H
#define _HV_CAL_OSDWINDOW_H

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

/**
 * @brief get base addr of window register
 * @param[in] enIndex which window to get
 * @return window register base address
 */
UINT32 Hv_Cal_OsdWindow_GetBaseAddr(OsdWindowPhyId enIndex);

/**
 * @brief set current window index
 * @param[in] enIndex window index
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetCurrentWindow(OsdWindowPhyId enIndex);

/**
 * @brief get current window index
 * @param[in] None
 * @return current window index
 */
OsdWindowPhyId Hv_Cal_OsdWindow_GetCurrentWindow(VOID);

/**
 * @brief set window enable/disable status
 * @param[in] bEnable enable or disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetEnable(BOOL bEnable);

/**
 * @brief get window enable/disable status
 * @param[in] None
 * @return HV_TRUE for enable, HV_FALSE for disable
 */
BOOL Hv_Cal_OsdWindow_GetEnable(VOID);

/**
 * @brief set window position
 * @param[in] usX window X-axis value
 * @param[in] usY window Y-axis value
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetPos(USHORT16 usX, USHORT16 usY);

/**
 * @brief get window position
 * @param[out] pusX window X-axis value
 * @param[out] pusY window Y-axis value
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_GetPos(USHORT16 *pusX, USHORT16 *pusY);

/**
 * @brief set window size
 * @param[in] usWidth window width
 * @param[in] usHeight window height
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetSize(USHORT16 usWidth, USHORT16 usHeight);

/**
 * @brief get window size
 * @param[out] pusWidth window width
 * @param[out] pusHeight window height
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_GetSize(USHORT16 *pusWidth, USHORT16 *pusHeight);

/**
 * @brief set window border enable/disable status
 * @param[in] bEnable enable or disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetBorderEnable(BOOL bEnable);

/**
 * @brief get window border enable/disable status
 * @param[in] None
 * @return HV_TRUE for enable, HV_FALSE for disable
 */
BOOL Hv_Cal_OsdWindow_GetBorderEnable(VOID);

/**
 * @brief set border color of window
 * @param[in] uiColor border color in RGB888 format
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetBorderColor(UINT32 uiColor);

/**
 * @brief set font enable/disable status
 * @param[in] bEnable enable or disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontEnable(BOOL bEnable);

/**
 * @brief get font enable/disable status
 * @param[in] None
 * @return HV_TRUE for enable, HV_FALSE for disable
 */
BOOL Hv_Cal_OsdWindow_GetFontEnable(VOID);

/**
 * @brief set font start position of current window
 * @param[out] usX X-axis value
 * @param[out] usY Y-axis value
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontStart(USHORT16 usX, USHORT16 usY);

/**
 * @brief Get font start position of current window
 * @param[out] pusX X-axis value
 * @param[out] pusY Y-axis value
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_GetFontStart(USHORT16 *pusX, USHORT16 *pusY);

/**
 * @brief set user defined font
 * @param[in] enType resource bit
 * @param[in] ucWidth width of font
 * @param[in] ucHeight height of font
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetUserDefinedFont(OsdResourceType enType, UCHAR8 ucWidth, UCHAR8 ucHeight);

/**
 * @brief set resource for font window
 * @param[in] ucIndex which resource out of 8 groups
 * @param[in] usResourceOffset offset within OSD Resource buffer
 * @param[in] enSize resource size
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetResource(UCHAR8 ucIndex, USHORT16 usResourceOffset, OsdResourceSize enSize);

/**
 * @brief set font index offset
 * @param[in] usOffset offset within OSD Index buffer
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRowIndexAddr(USHORT16 usOffset);

/**
 * @brief set row count of current font window
 * @param[in] usRowCount row count including END row
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRowCount(USHORT16 usRowCount);

/**
 * @brief set rect-group enable/disable
 * @param[in] bEnable enable or disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRectGroupEnable(BOOL bEnable);

/**
 * @brief set rect-group foreground alpha
 * @param[in] ucAlpha alpha value
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRectGroupAlpha(UCHAR8 ucAlpha);

/**
 * @brief set rect-group background color enable/disable
 * @param[in] bEnable enable or disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRectGroupBGEnable(BOOL bEnable);

/**
 * @brief set rect-group background color
 * @param[in] usColor color in RGB565 format
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetRectGroupBGColor(USHORT16 usColor);

/**
 * @brief set font blink duration
 * @param[in] enDuty stay percentage of whole blink period
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontBlinkDuty(OsdBlinkDuty enDuty);

/**
 * @brief set font blink period
 * @param[in] ucRate frames for one blink period
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontBlinkRate(UCHAR8 ucRate);

/**
 * @brief set font effect mode
 * @param[in] enMode font effect mode OSD_TRANS_MODE_NONE: no effect
 *                                    OSD_TRANS_MODE_FADE: fade in/out effect
 *                                    OSD_TRANS_MODE_SHUTTER: shutter effect
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransMode(OsdTransMode enMode);

/**
 * @brief set font effect change speed
 * @param[in] ucSpeed value changed for each change
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransSpeed(UCHAR8 ucSpeed);

/**
 * @brief set font effect change rate
 * @param[in] ucFrame change per ucFrame frames
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransFrame(UCHAR8 ucFrame);

/**
 * @brief set font effect direction
 * @param[in] enDirection effect direction OSD_TRANS_DI_V: V direction
 *                                         OSD_TRANS_DI_H: H direction
 *                                         OSD_TRANS_DI_V_H: both H and V direction
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransDirection(OsdTransDirection enDirection);

/**
 * @brief set shutter effect segment size
 * @param[in] usX segment size in X direction
 * @param[in] usY segment size in Y direction
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransStartPos(USHORT16 usX, USHORT16 usY);

/**
 * @brief set shutter effect trans cen
 * @param[in] usX trans cen in X direction
 * @param[in] usY trans cen in Y direction
 * @return VOID without return
 */
VOID Hv_Cal_OsdWindow_SetFontTransCen(USHORT16 usX, USHORT16 usY);

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

#endif
