📄 osdcp_global.h
字号:
#ifndef OSDCP_GLOBAL_H
#define OSDCP_GLOBAL_H
#include "OSDcp_rec.h"
#include "OSDcp_text.h"
#include "OSDcp_bmp.h"
#include "OSDcp_bar.h"
//*************************************************************************
// Macro
//*************************************************************************
#define OSDCP_DATA_TABL 0
#define OSDCP_DATA_BIN 1
#define OSDcp_data_type OSDCP_DATA_BIN
#define OSDCP_STR_LENGTH 25
#define LINKITEM_MAX 100
#define WINDOW_MAX 16
#define OSD_TREE_MAX 8
#define INFO_BYTE_NO 0x10
#define LAYER_SET_BYTE_NO 0x20
#define INFO_SIZE 64
//*************************************************************************
// Structures
//*************************************************************************
typedef struct
{
U8 rectype;
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;
}OSDcp_layer_rec_table;
typedef struct
{
U8 bmptype;
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;
U16 bmpfmt_width;
U16 bmpfmt_height;
U8 bmpfmt_bBmpColorKeyEnable;//BOOLEAN bmpfmt_bBmpColorKeyEnable;
U8 bmpfmt_bScale;//BOOLEAN bmpfmt_bScale;
U8 enbmphandle;//BMPHANDLE* bmp_ptr;
}OSDcp_layer_bmp_table;
typedef struct
{
U8 texttype;
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;
U8 enTextAlign;//EN_ALIGNMENT_TYPE enTextAlign;
//BOOLEAN fHighLight;
//U8 bFrameWidth;
U8 Fontfmt_flag;
U8 Fontfmt_ifont_gap;
U8 text_handle;//FONTHANDLE text_handle;
U16 enmsgstring;//U8* text_ptr;
}OSDcp_layer_text_table;
typedef struct
{
U8 bartype;
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;
U16 x_1;
U16 y_1;
U16 width_1;
U16 height_1;
U16 radius_1;
U32 f_clr_1; //frame color
//U32 t_clr_1; //text_color
U32 b_clr_1; //background color
U32 g_clr_1; //gradient color
U8 u8Gradient_1;
//U8 bStringIndexWidth_1;
//EN_ALIGNMENT_TYPE enTextAlign_1;
//BOOLEAN fHighLight_1;
U8 bFrameWidth_1;
//MSAPI_GEFontFmt Fontfmt_1;
U8 barflag;
U8 Percentage;
}OSDcp_layer_bar_table;
typedef struct
{
U16 x;
U16 y;
U16 width;
U16 height;
}OSDcp_window_erase_table;
typedef struct
{
U8 rectype;
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;
}OSDcp_rec_table;
typedef struct
{
U8 bmptype;
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;
U16 bmpfmt_width;
U16 bmpfmt_height;
U8 bmpfmt_bBmpColorKeyEnable;//BOOLEAN bmpfmt_bBmpColorKeyEnable;
U8 bmpfmt_bScale;//BOOLEAN bmpfmt_bScale;
}OSDcp_bmp_table;
typedef struct
{
U8 texttype;
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;
U8 enTextAlign;//EN_ALIGNMENT_TYPE enTextAlign;
//BOOLEAN fHighLight;
//U8 bFrameWidth;
U8 Fontfmt_flag;
U8 Fontfmt_ifont_gap;
U8 text_handle;//FONTHANDLE text_handle;
}OSDcp_text_table;
typedef struct
{
U8 bartype;
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;
U16 x_1;
U16 y_1;
U16 width_1;
U16 height_1;
U16 radius_1;
U32 f_clr_1; //frame color
//U32 t_clr_1; //text_color
U32 b_clr_1; //background color
U32 g_clr_1; //gradient color
U8 u8Gradient_1;
//U8 bStringIndexWidth_1;
//EN_ALIGNMENT_TYPE enTextAlign_1;
//BOOLEAN fHighLight_1;
U8 bFrameWidth_1;
//MSAPI_GEFontFmt Fontfmt_1;
U8 barflag;
}OSDcp_bar_table;
typedef struct
{
U8 id;
U8 window;
U8 comp_type;
U16 x;
U16 y;
U8 osd_function;
}OSDcp_linkitem_constructor_table;
typedef struct
{
U16 element0;
U16 element1;
U16 element2;
U16 element3;
}OSDcp_linkitem_element_table;
typedef struct
{
U8 parent_window_id;
U8 child_window_id;
U8 prev_comp_id;
U8 next_comp_id;
}OSDcp_linkitem_linking_table;
typedef struct
{
U8 osd_action_menu;
U8 osd_action_up;
U8 osd_action_down;
U8 osd_action_left;
U8 osd_action_right;
U8 osd_action_select;
U8 osd_action_exit;
}OSDcp_linkitem_button_table;
typedef struct
{
U8 parent_window_act_0;
U8 parent_window_id_0;
U8 parent_window_act_1;
U8 parent_window_id_1;
U8 parent_window_act_2;
U8 parent_window_id_2;
U8 child_window_act_0;
U8 child_window_id_0;
U8 child_window_act_1;
U8 child_window_id_1;
U8 child_window_act_2;
U8 child_window_id_2;
U8 prev_window_act_0;
U8 prev_window_id_0;
U8 prev_window_act_1;
U8 prev_window_id_1;
U8 prev_window_act_2;
U8 prev_window_id_2;
U8 next_window_act_0;
U8 next_window_id_0;
U8 next_window_act_1;
U8 next_window_id_1;
U8 next_window_act_2;
U8 next_window_id_2;
}OSDcp_linkitem_window_table;
typedef struct
{
U16 width;
U16 height;
}OSDcp_loadbitmap_info_table;
typedef struct
{
U16 startaddr;
U16 length;
}OSDcp_string_info_table;
//*************************************************************************
// Enums
//*************************************************************************
typedef enum
{
OSDCP_COMP_INIT,
OSDCP_COMP_NORMAL,
OSDCP_COMP_HIGHLIGHT,
OSDCP_COMP_UNACTIVE,
OSDCP_COMP_NONE,
} EN_OSDCP_COMPONENT_STATE_TYPE;
typedef enum
{
OSDCP_LINKITEM_UNACTIVE,
OSDCP_LINKITEM_ACTIVE,
} EN_OSDCP_LINKITEM_STATE_TYPE;
typedef enum
{
OSDCP_COMP_DECREASE,
OSDCP_COMP_INCREASE,
} EN_OSDCP_OPERATOR_TYPE;
typedef enum
{
OSDCP_CM_MENU_INIT,
OSDCP_CM_LINK_PARENT,
OSDCP_CM_LINK_CHILD,
OSDCP_CM_LINK_PREV,
OSDCP_CM_LINK_NEXT,
OSDCP_CM_MENU_EXIT,
OSDCP_CM_INCREASE,
OSDCP_CM_DECREASE,
OSDCP_CM_NONE=0xff
} EN_OSDCP_COMMAND_TYPE;
typedef enum
{
OSDCP_WINDOW_PARENT,
OSDCP_WINDOW_CHILD,
OSDCP_WINDOW_PREV,
OSDCP_WINDOW_NEXT,
OSDCP_WINDOW_NONE=0xff
} EN_OSDCP_WINDOW_CONTROL;
typedef enum
{
WINDOW_HIDE,
WINDOW_SHOW,
WINDOW_HIGHLIGHT,
NONE_WINDOW=0xff
} EN_OSDCP_WINDOW_OPERATOR;
#ifdef OSDCP_GLOBAL_C
#define INTERFACE
#else
#define INTERFACE extern
#endif
INTERFACE U16 osdcp_u16StringBuffer_0[OSDCP_STR_LENGTH];
INTERFACE U16 osdcp_u16StringBuffer_1[OSDCP_STR_LENGTH];
//INTERFACE U8 osdcp_u8StringBuffer[OSDCP_STR_LENGTH];
INTERFACE U8 total_id_no, total_window_no;
INTERFACE U8 window_id_count[WINDOW_MAX];
INTERFACE U8 colorkey_alpha_s, colorkey_alpha_e, colorkey_red_s, colorkey_red_e, colorkey_green_s, colorkey_green_e, colorkey_blue_s, colorkey_blue_e;
INTERFACE U16 layer_rec_addr, layer_bmp_addr, layer_text_addr, layer_bar_addr, window_erase_addr, layer_set_addr;
INTERFACE U16 comp0_rec0_addr, comp0_bmp0_addr;
INTERFACE U16 comp1_rec0_addr, comp1_bar0_addr;
INTERFACE U16 comp2_rec0_addr, comp2_text0_addr, comp2_text1_addr;
INTERFACE U16 comp3_rec0_addr, comp3_text0_addr;
INTERFACE U16 comp4_rec0_addr, comp4_bmp0_addr;
INTERFACE U16 linkitem_constructor_addr, linkitem_element_addr, linkitem_linking_addr, linkitem_button_addr, linkitem_window_addr;
#undef INTERFACE
#endif /* OSDCP_GLOBAL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -