⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msapi_osd.h

📁 mstar 776 开发的车载dvd
💻 H
字号:
#ifndef MSAPI_OSD_H
#define MSAPI_OSD_H

#include "board.h"
#include "DataType.h"
#include "msAPI_Font.h"

#define GE_DRIVER_TEST        0
/********************************************************************************/
/*                                 Macro                                        */
/********************************************************************************/
#define BTN_TEXT_GAP    		4//2
#define USE_EPG 1   //suppress compiler warning!

///////////////////////////////////////////////////////////////
// color format
///////////////////////////////////////////////////////////////
#define COLOR_TRANSPARENT                               0X000000
#define COLOR_WHITE     		                        0xffffff
#define COLOR_BLACK     		                        0x0f0f0f
#define COLOR_RED       		                        0xe00000
#define COLOR_GREEN     		                        0x00FF00
#define COLOR_YELLOW    		                        0xffdf00
#define COLOR_LTBLUE    		                        0x0080ff
#define COLOR_BLUE      		                        0x0000ff
#define COLOR_DKGRAY    		                        0x808080
#define COLOR_ASHEN    	 		                        0xffC800
#define COLOR_MAGENTA			                        0xff00ff
#define COLOR_CYAN				                        0x00FFFF
#define COLOR_DKRED     		                        0xbf5164
#define COLOR_DKGREEN   		                        0x00bf20
#define COLOR_DKBLUE    		                        0x0060c0//0x576288
#define COLOR_LTGRAY    		                        0xdfdfdf
#define COLOR_GRAY      		                        0xa0a0a0
#define COLOR_BRBLUE    		                        0x00ffff
#define COLOR_PINK      		                        0xffAFAF
#define COLOR_PURPLE    		                        0x919EBA
#define COLOR_ORANGE    		                        0xff9f00
#define COLOR_BROWN     		                        0xa55e02//0xa05f00
#define COLOR_MIDBLUE                                   0x82d7ff

//FOR S1 TRUNK
#define COLOR_MIDBLUE           0x82d7ff
#define COLOR_OPTION_LTBLUE 	0x99ccff
#define COLOR_BOTTON_DKBLUE 	0x3366cc
#define COLOR_BOTTONFRAME_BLUE  0x00ccff
#define COLOR_MENU_LTOLIVEGREEN	0xD5F565
//#define COLOR_MENU_BBB		0x0060C0
#define COLOR_MENU_BLUE			0x0080FF
#define COLOR_MENU_LTBLUE		0xC0DFE0
#define COLOR_MENU_DKGREEN		0x00BF20
#define COLOR_MENU_LTGREEN		0x00FF00
#define COLOR_MENU_PINK			0xF847F4
//#define COLOR_MENU_HHH		0xFF9F00
#define COLOR_MENU_DKGRAY		0x808080
#define COLOR_MENU_GRAY			0xA0A0A0
#define COLOR_MENU_LTGRAY		0xDFDFDF
//#define COLOR_MENU_LLL		0xA05F00
#define COLOR_MENU_LTYELLOW		0xFFFF80
#define COLOR_MENU_GRID         COLOR_LTBLUE
#define BACKGROUND_COLOR    	COLOR_TRANSPARENT

///////////////////////////////////////////////////////////////
// blcok gradient attribute
///////////////////////////////////////////////////////////////
#define CONSTANT_COLOR  0x01
#define GRADIENT_X_COLOR 0x02
#define GRADIENT_Y_COLOR 0x04
#define GRADIENT_X_CENTER_COLOR 0x16
#define GRADIENT_Y_CENTER_COLOR 0x32
/********************************************************************************/
/*                                 Enum                                         */
/********************************************************************************/
typedef enum
{
    CHAR_IDX_1BYTE,
    CHAR_IDX_2BYTE
} EN_CHAR_IDX_LENGTH;

typedef enum
{
	EN_ALIGNMENT_DEFAULT,
    EN_ALIGNMENT_LEFT,
    EN_ALIGNMENT_RIGHT,
    EN_ALIGNMENT_CENTER
} EN_ALIGNMENT_TYPE;


/********************************************************************************/
/*                             Structure type                                   */
/********************************************************************************/

typedef struct
{

    U8 a;
    U8 r;
    U8 g;
    U8 b;
}MSAPI_GERGBColor;

typedef struct
{
    U16 flag;	// scale or italic
    U16 width;
    U16 height;
    U8 dis;
    MSAPI_GERGBColor clr;
    U8 blinkfg;
    U8 blinkbg;
    U8 ifont_gap;  // inter-font gap, only valid for GEFONT_FLAG_GAP
} MSAPI_GEFontFmt;

typedef struct
{
    U16 x;
    U16 y;
    U16 width;
    U16 height;
	U16 radius;
	U32 f_clr;  //frame color
    U32 t_clr;  //text_color
    U32 b_clr;  //background color
    U32 g_clr;  //gradient color
    U8 u8Gradient;
    U8 bStringIndexWidth;
    EN_ALIGNMENT_TYPE enTextAlign;
    BOOLEAN fHighLight;
    U8 bFrameWidth;
    MSAPI_GEFontFmt Fontfmt;
} OSDClrBtn;

typedef struct
{
    U16 x1;
    U16 y1;
    U16 x2;
    U16 y2;
    U32 u32LineColor;		// Line color
    U8 	u8LineWidth;
} OSDClrLine;

typedef struct
{
    U16 width;
    U16 height;
    U8 rowdata[1];//row data
} BMPHDR;


typedef struct
{
    MSAPI_GERGBColor color_s;
    MSAPI_GERGBColor color_e;
} MSAPI_GEColorRange;

typedef struct
{
	BOOLEAN bBmpColorKeyEnable;
	MSAPI_GEColorRange clrrange;
	BOOLEAN bScale;
  	U16 width;
	U16 height;
} MSAPI_GEBitmapFmt;

typedef struct
{
  	U16 x;
  	U16 y;
  	U16 width;
	U16 height;
    U8  fbID;
} MSAPI_OSDRegion;

typedef struct
{
    U16 x0;
    U16 y0;
    U16 x1;
    U16 y1;
} MSAPI_ClipWindow;

#ifdef MSAPI_OSD_C
#define INTERFACE
#else
#define INTERFACE extern
#endif

// Variable
INTERFACE MSAPI_ClipWindow ClipWindow;
INTERFACE MSAPI_ClipWindow ClipWindowBackup;

INTERFACE U16 msAPI_OSD_u16Strlen(U16 *pu16Str);
#if (KEEP_UNUSED_FUNC == 1)
INTERFACE void msAPI_OSD_u16Strcpy(U16 *pu16Dest, U16 *pu16Src);
INTERFACE S8 msAPI_OSD_u16Strcmp(U16 *u16strA,U16 *u16strB);
INTERFACE void msAPI_OSD_u16Strcat(U16 *pu16Dest, U16 *pu16Src);
#endif
INTERFACE U16 msAPI_OSD_GetStrLength(U8 *pu8Str, U8 u8NoOfBytesPerChar);
INTERFACE U16 msAPI_OSD_GetStrWidth(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);
#if 1
INTERFACE void msAPI_OSD_DrawLine(OSDClrLine *p_clr_line);
#else
INTERFACE void msAPI_OSD_DrawLine(OSDClrBtn *pclrBtn);
#endif
INTERFACE void msAPI_OSD_DrawText(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawText_I2(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawPunctuatedString(FONTHANDLE font_handle, U16 *pu16Str, OSDClrBtn *pclrBtn, U8 max_row_num);
INTERFACE void msAPI_OSD_DrawPunctuatedString_S1(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn, U8 max_row_num);

INTERFACE void msAPI_OSD_DrawFrame(OSDClrBtn *clrBtn);
INTERFACE void msAPI_OSD_DrawBlock(OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawMMIBlock(OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawButton(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);

INTERFACE void msAPI_OSD_DrawRoundFrame (OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawRoundBlock (OSDClrBtn *pclrBtn);
INTERFACE void msAPI_OSD_DrawRoundButton(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);

INTERFACE void msAPI_OSD_DrawBitmap(BMPHANDLE Handle, U16 u16StartX, U16 u16StartY, MSAPI_GEBitmapFmt bmpfmt);
INTERFACE void msAPI_OSD_DrawBitmap_Subtitle(BMPHANDLE Handle, U16 u16StartX, U16 u16StartY, MSAPI_GEBitmapFmt bmpfmt);
INTERFACE void msAPI_OSD_SetClipWindow(U16 x0, U16 y0, U16 x1, U16 y1);
INTERFACE void msAPI_OSD_GetClipWindow(U16 *pX0, U16 *pY0, U16 *pX1, U16 *pY1);
INTERFACE void msAPI_OSD_BackupClipWindow(void);
INTERFACE void msAPI_OSD_SetDither(BOOLEAN bEnable);
INTERFACE void msAPI_OSD_SetRotation(U8 locrotate,U8 glorotate);

#ifdef CI
INTERFACE unsigned short msAPI_OSD_Get_TextString_Width(FONTHANDLE font_handle, U8 *pu8Str, OSDClrBtn *pclrBtn);
#endif

INTERFACE U8 msAPI_OSD_Transfer_CC_Color(U8 u8Color , U8 type);
//INTERFACE   void APITest(void);

#undef INTERFACE

// Optional special drawing function

#define MSAPI_OSD_AQUA

#ifdef MSAPI_OSD2_C
#define INTERFACE
#else
#define INTERFACE extern
#endif
INTERFACE U8 msAPI_OSD_CopyRegion(MSAPI_OSDRegion *src, MSAPI_OSDRegion *dst);

#ifdef MSAPI_OSD_AQUA
INTERFACE void msAPI_OSD_DrawGradientRoundBlock(OSDClrBtn *pclrBtn);

#endif

INTERFACE void msAPI_OSD_DrawColorKeyBitmap(BMPHANDLE Handle, U16 u16StartX, U16 u16StartY, MSAPI_GEBitmapFmt bmpfmt);

#undef INTERFACE

// end Optional special drawing function

#endif /* MSAPI_OSD_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -