osd.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:7k
- #ifndef __OSD_H__
- #define __OSD_H__
- #if defined(__cplusplus)
- extern "C" {
- #endif
- #include "gendef.h"
- #include "stgxobj.h"
- #include "layer.h"
- typedef struct _KB_OSDRect
- {
- INT32 nX;
- INT32 nY;
- INT32 nWidth;
- INT32 nHeight;
- }KB_OSDRect;
- typedef struct _KB_OSDRGB /* defination of RGB structure */
- {
- UINT8 cRed; /* red */
- UINT8 cGreen; /* green */
- UINT8 cBlue; /* blue */
- }KB_OSDRGB;
- /* 定义每个像素的字节数 */
- #define KB_OSD_BYTES 2
- #define KB_OSD_COLOR_ARGB_16_4444 0 /* A = 4 R = 4 G = 4 B = 4 */
- #define KB_OSD_COLOR_ARGB_16_1555 1 /* A = 1 R = 5 G = 5 B = 5 */
- #define KB_OSD_COLOR_RGB_24 2 /* A = 0 R = 8 G = 8 B = 8 */
- #define KB_OSD_COLOR_YUV_24 3 /* A = 0 Y = 8 U = 8 V = 8 */
- #define KB_OSD_COLOR_ARGB_32 4 /* A = 8 R = 8 G = 8 B = 8 */
- #define KB_OSD_COLOR_RGBA_16_4444 5 /* R = 4 G = 4 B = 4 A = 4 */
- #define KB_OSD_WIDTH 720
- #define KB_OSD_HEIGHT 576
- #define KB_OSD_COLOR KB_OSD_COLOR_ARGB_16_1555
- #if (KB_OSD_COLOR == KB_OSD_COLOR_ARGB_16_4444)
- #define KB_OSD_RGB24_TO_ARGB16(pcRgb24, pcArgb16)
- pcArgb16[1] = (0xF0 | ((pcRgb24[0] >> 4) & 0x0F));
- pcArgb16[0] = (pcRgb24[1] & 0xF0) | ((pcRgb24[2] >> 4) & 0x0F);
- #define KB_OSD_ColorRef_TO_ARGB16(nColorRef, pcArgb16)
- pcArgb16[1] = ((UINT8)(nColorRef >> 24) & 0x80) | ((UINT8)(nColorRef >> 16) & 0x0F);
- pcArgb16[0] = ((UINT8)(nColorRef >> 12) & 0xF0) | ((UINT8)(nColorRef >> 4) & 0x0F);
-
- #elif (KB_OSD_COLOR == KB_OSD_COLOR_ARGB_16_1555)
- #define KB_OSD_RGB24_TO_ARGB16(pcRgb24, pcArgb16)
- pcArgb16[1] = (0x80 | ((pcRgb24[0] >> 1) & 0x7c) | ((pcRgb24[1] >> 6) & 0x03));
- pcArgb16[0] = ((pcRgb24[1] << 2) & 0xE0) | ((pcRgb24[2] >> 3) & 0x1F);
- #define KB_OSD_RGB24_TO_UINT16(pcRgb24, nUint16)
- nUint16 = 0x8000 | (((UINT16)pcRgb24[0] << 7) & 0x7c00) | (((UINT16)pcRgb24[1] << 2) & 0x03e0) | (((UINT16)pcRgb24[2] >> 3) & 0x001f);
-
- #define KB_OSD_ColorRef_TO_ARGB16(nColorRef, pcArgb16)
- pcArgb16[1] = (((UINT8)(nColorRef >> 24) & 0x80) | ((UINT8)(nColorRef >> 17) & 0x7c) | ((UINT8)(nColorRef >> 14) & 0x03));
- pcArgb16[0] = ((UINT8)(nColorRef >> 6) & 0xE0) | ((UINT8)(nColorRef >> 3) & 0x1F);
- #define KB_OSD_ColorRef_TO_UINT16(nColorRef, nUint16)
- nUint16 = 0x8000 | ((UINT16)(nColorRef >> 9) & 0x7c00) | ((UINT16)(nColorRef >> 6) & 0x03e0) | ((UINT16)(nColorRef >> 3) & 0x001f);
-
- #endif
- #if (KB_OSD_COLOR == KB_OSD_COLOR_ARGB_16_4444)
-
- #define KB_OSD_RGB24_TO_UINT16(nColorRef, pcArgb16)
- pcArgb16[1] = ((UINT8)(nColorRef >> 24) & 0x80) | ((UINT8)(nColorRef >> 20) & 0x0F));
- pcArgb16[0] = ((UINT8)(nColorRef >> 12) & 0xF0) | ((UINT8)(nColorRef >> 4) & 0x0F);
-
- #elif (KB_OSD_COLOR == KB_OSD_COLOR_ARGB_16_1555)
-
-
-
- #endif
- /* |Alpha| Red |Green| Blue | */
- typedef UINT32 ColrRef; /* 0x | FF | AB | CD | EF | */
- //定义颜色值
- #define KB_COLOR_TRANSPARENCY 0x00000000 /* 透明 */
- #define KB_COLOR_AQUA 0xFF00FFFF /* 浅绿 */
- #define KB_COLOR_BLACK 0xFF000000 /* 黑色 */
- #define KB_COLOR_BLUE 0xFF0000FF /* 蓝色 */
- #define KB_COLOR_FUCHSIA 0xFFFF00FF /* 紫红 */
- #define KB_COLOR_GRAY 0xFF808080 /* 灰色 */
- #define KB_COLOR_GREEN 0xFF008000 /* 绿色 */
- #define KB_COLOR_LIME 0xFF00FF00 /* 酸橙 */
- #define KB_COLOR_MAROON 0xFF800000 /* 栗色 */
- #define KB_COLOR_NAVY 0xFF000080 /* 深蓝 */
- #define KB_COLOR_OLIVE 0xFF808000 /* 橄榄 */
- #define KB_COLOR_PURPLE 0xFF800080 /* 紫色 */
- #define KB_COLOR_RED 0xFFFF0000 /* 红色 */
- #define KB_COLOR_SILVER 0xFFC0C0C0 /* 银色 */
- #define KB_COLOR_TEAL 0xFF008080 /* 深青 */
- #define KB_COLOR_WHILE 0xFFFFFFFF /* 白色 */
- #define KB_COLOR_YELLOW 0xFFFFFF00 /* 黄色 */
- #define KB_COLOR_SMALL_WIN 0xFF64AED3 /*浅蓝,播放区的边框*/
- #define KB_COLOR_TITLE_BAR 0xFF315D82 /*蓝,用来写系统管理界面中的标题*/
- #define KB_COLOR_Option 0xFF85CFF3 /*蓝,用来写系统管理界面中的选项*/
- #define KB_COLOR_Selected 0xFFADEE88 /*绿,用来写系统管理界面中的被选中的选项*/
- #define KB_COLOR_UnSelected 0xFF347DAA /*蓝,用来写游戏界面中的未被选中的选项*/
- #define KB_COLOR_Signal 0xFF72B9E3 /*蓝,用来画搜索界面中信号质量的背景*/
- #define KB_COLOR_Start_Search 0xFF61A4CF /*蓝,开始搜索按钮的背景*/
- #define KB_COLOR_Quality_Back 0xFF4676A4 /*蓝,信号质量和信号等级的背景色*/
- #define KB_COLOR_Quality 0xFFEDDA57 /*黄,信号质量的填充色*/
- #define KB_COLOR_INFO_BAR 0xFF315D82/*深蓝,信息条背景*/
- #define KB_COLOR_VOLUME_BG 0xFF72B9E3/*声音显示部分背景颜色*/
- #define KB_COLOR_CHANNEL_BG 0xFF8DD6F9/*频道背景的蓝色*/
- #define KB_COLOR_BG_VOLUME_LOGO 0xFFAF6001/*褐,视频状态下的音量图标的颜色*/
- #define KB_COLOR_BLUE_DARK 0xfc315c82
- #define KB_COLOR_BLUE_MID 0xfc72b9e2
- #define KB_COLOR_BLUE_THIN 0xfc8dd6f9
- #define KB_COLOR_SELECT_GREEN 0xfcadee88
- #define KB_COLOR_TXT_WHITE 0xfcffffff
- #define KB_COLOR_TXT_BLACK 0xfc000000
- //函数返回值定义
- #define OSD_RETURN_OK 0 //成功
- #define OSD_RETURN_FAIL -1 //失败
- #define OSD_RETURN_EXIT -999 // 退出zhengrz 2005-3-31
- //定义消息框返回类型
- #define IDNONE 0 //return value when there isn't any button
- #define IDABORT 1 //The Abort button was selected.
- #define IDCANCEL 2 //The Cancel button was selected.
- #define IDIGNORE 3 //The Ignore button was selected.
- #define IDNO 4 //The No button was selected.
- #define IDOK 5 //The OK button was selected.
- #define IDRETRY 6 //The Retry button was selected.
- #define IDYES 7 //The Yes button was selected.
- #define IDERROR 8 //there is an error when a messagebox shows
- extern STGXOBJ_Bitmap_t Bitmap[NUM_VPORTS];
- /*****************************************************************************
- ** Function prototypes
- *****************************************************************************/
- extern INT32 KB_OSDFillRect(INT32 nX,INT32 nY,INT32 nWidth,INT32 nHeight,ColrRef nColor);
- extern INT32 KB_OSDRef2Rgb(ColrRef nColorRef, KB_OSDRGB *pRgb);
- extern INT32 KB_OSDGetTransparency(void);
- extern INT32 KB_OSDSetTransparency(INT32 nLevel);
- extern void* KB_OSDAllocate(INT32 nWidth, INT32 nHeight);
- extern INT32 KB_OSDAllocBitmap(STGXOBJ_Bitmap_t *Bitmap_p,STAVMEM_BlockHandle_t *BlockHandle_p,U32 Width,U32 Height );
- extern INT32 KB_OSDInit(void);
- #if defined(__cplusplus)
- }
- #endif
- #endif