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

#ifndef _HV_CAL_OSDBLEND_H
#define _HV_CAL_OSDBLEND_H

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

/**
 * @brief set rect-group enable/disable status
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetRectGroupEnable(BOOL bEnable);

/**
 * @brief set background color and enable status
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] bEnable 1 for enable, 0 for disable
 * @param[in] usColor color in RGB565 format
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetBackground(OsdBlendingStage enStage, BOOL bEnable, USHORT16 usColor);

/**
 * @brief set background alpha
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] ucAlpha alpha value
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetBackgroundAlpha(OsdBlendingStage enStage, UCHAR8 ucAlpha);

/**
 * @brief set foreground alpha
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 * @param[in] ucAlpha alpha value
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetForegroundAlpha(OsdBlendingStage enStage, UCHAR8 ucAlpha);

/**
 * @brief set switch enable/disable status
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] bEnableSwitch 1 for switch function, 0 for blend function
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetSwitch(OsdBlendingStage enStage, BOOL bEnableSwitch);

/**
 * @brief set alpha input selection
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] enType alpha input type OSD_ALPHA_TYPE_CH0: channel0 use alpha0, channel1 use 1 - alpha0
 *                                    OSD_ALPHA_TYPE_CH1: channel0 use 1 - alpha1, channel1 use alpha1
 *                                    OSD_ALPHA_TYPE_SET: channel0 use alpha_set, channel1 use 1 - alpha_set
 * @param[in] ucValue alpha value, used only for OSD_ALPHA_TYPE_SET
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetAlphaSelect(OsdBlendingStage enStage, OsdAlphaSelectType enType, UCHAR8 ucValue);

/**
 * @brief set alpha output selection
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] enType alpha output type OSD_ALPHA_OUTPUT_FF_CH01: merged area 0xff, otherwise channel alpha
 *                                     OSD_ALPHA_OUTPUT_FF_SET: merged area 0xff, otherwise specified value
 *                                     OSD_ALPHA_OUTPUT_CH0: channel 0 first
 *                                     OSD_ALPHA_OUTPUT_CH1: channel 1 first
 *                                     OSD_ALPHA_OUTPUT_FORCE: all area force value
 * @param[in] ucValue alpha value, only used for OSD_ALPHA_OUTPUT_FORCE
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetAlphaOutput(OsdBlendingStage enStage, OsdAlphaOutputType enType, UCHAR8 ucValue);

/**
 * @brief set alpha output ratio enable/disable status
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] bEnable 1 for enable, 0 for disable
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetAlphaOutputRatioEnable(OsdBlendingStage enStage, BOOL bEnable);

/**
 * @brief set alpha output ratio
 * @param[in] enStage blending stage OSD_BLENDING_STAGE_RECT_GROUP: rect/grid/line within window
 *                                   OSD_BLENDING_STAGE_RECT_FONT: rect-group/font within font window
 *                                   OSD_BLENDING_STAGE_WIN01: win0/win1
 *                                   OSD_BLENDING_STAGE_WIN23: win2/win3
 *                                   OSD_BLENDING_STAGE_WIN0123: win01/win23
 *                                   OSD_BLENDING_STAGE_WINRECT: win_rect0/win_rect1
 *                                   OSD_BLENDING_STAGE_WINALL: win_rect01/win_0123
 *                                   OSD_BLENDING_STAGE_GRAPHIC: winall/graphic
 * @param[in] ucRatio ratio value, 0~255
 * @return VOID without return
 */
VOID Hv_Cal_OsdBlend_SetAlphaOutputRatio(OsdBlendingStage enStage, UCHAR8 ucRatio);

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

#endif
