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

📄 dvb_osd.h

📁 DVB软件,基于CT216软件的开发源程序.
💻 H
字号:
/**************************************************************************

        (C)Copyright Cheertek Inc. 2002-2004,
           D700, all right reserved.

        Product : STB Firmware

****************************************************************************/
#ifndef __DVB_OSD_H
#define __DVB_OSD_H

/*! \file
* This module provides the OSD control API.  This module will load fonts, palette, bmp
* and string data.  These data maybe declare in "code" segment.  The linker needs combine
* the OSD module object files and these data object files in a bank.
*/

#include "dvb_type.h"
#include "ap_defs.h"

#define MAXNO_OF_OSD_STRING                 160
/**< The maximum word number in an line.
*/

#define OSD_FRAME_DISPLAY_REGION        0
/**< Define the region number of Display Region
*/

#define OSD_FRAME_WORKING_REGION        1
/**< Define the region number of Working Region
*/

#ifndef NO_BMP_REGION
#define OSD_FRAME_BITMAP_REGION         2   
/**< Define the region number of Bitmap Region
*/
#endif

#define OSD_FRAME_MAX_REGION_NUM        3
/**< Define the maximun region number
*/

#define OSD_FRAME_HANLDE_ERROR_ID           (0xFFFF)
/**< Define the error handle ID of OSD frame
*/


/******************************************************************************/
// YUV <--> RGB conversion macros
// [31:24]:don't care, [23:16]:R value, [15:8]: G value, [7:0]: B value
#define RGB_R(rgb)              ((u8)((u32)rgb>>16))
#define RGB_G(rgb)              ((u8)((u32)rgb>>8))
#define RGB_B(rgb)              ((u8)rgb)


/**
* Define the OSD error type.
*/
typedef enum
{
	EN_OSD_NO_ERROR,
	EN_OSD_ERROR_SDRAM_ACCESS,
	EN_OSD_ERROR_DATA_FORMAT,
	EN_OSD_ERROR_BMP_INDEX,
	EN_OSD_ERROR_SEMAPHORE,
	EN_OSD_ERROR_BMP_SIZE
}EN_OSD_ERROR;

/**
* Define the OSD ratio.
*/
typedef enum
{
	EN_OSD_TRANSPARENT=0,
	EN_OSD_MIN_RATIO=35,
#ifdef DUI
	EN_OSD_DEFAULT_RATIO=43,
#else
	EN_OSD_DEFAULT_RATIO=55,
#endif
	EN_OSD_OPACITY=63
}EN_OSD_RATIO;


/**
* Define the OSD Mode.
*/
typedef enum
{
	EN_OSD_MODE_DISABLE,
	EN_OSD_MODE_8_BIT
}EN_OSD_MODE;

/**
* Define the Color-Palette Initial parameters.
*/
typedef struct
{
	u32     u32Addr;                            /* Color Palette Address (Leon Dram Address) */
	u32     u32Len;                             /* Color Palette Length */
}DVB_OSD_ColorPatelleInitParameters;

/**
* Define the Font Set Addr.
*/
typedef struct
{
	u16	*u16SysFontSetAddr;
	u32	*u32SysFontsSetFontOffsetAddr;
	u8	*u8SysFontsSetFontWidthAddr;
	u8 	*u8SysFontsInfoAddr;
	u8	*u8SysFontsSetFontHeightAddr;
	u8	*u8SysFontsSetFontStartPosAddr;
}DVB_OSD_UNICODE_FONT_PARAMETER;

/**
* Define the Font Table Initial parameters.
*/
typedef struct
{
	u32     u32FontTable0Addr;                  /* Font Table 0 Address (Leon Dram Address), must be 2048 alignment*/
	u32     u32FontTable0Len;                   /* Font Table 0 Length */
	u32     u32FontTable1Addr;                  /* Font Table 1 Address (Leon Dram Address), must be 2048 alignment */
	u32     u32FontTable1Len;                   /* Font Table 1 Length */
	u16     u16DefaultFontTableID;              /* Default used Font Table ID */
}DVB_OSD_FontTableInitParameters;


/**
* Define the Line-Map Initial parameters.
*/

typedef struct
{
	u32     u32MaxCmdNum;                       /* Maximum Linemap Command Number */
	u32     u32MaxLineNum;                      /* Maximum Line number of each linemap */
	u32     u32Addr;                            /* Linemap Buffer Address (Leon Dram Address) */
	u32     u32Len;                             /* Linemap Buffer Length */
}DVB_OSD_LinemapInitParameters;


/**
* Define the OSD Frame Initial parameters.
*/
typedef struct
{
	u32     u32FrameBufferAddr;                 /* Frame Buffer Address (Leon Dram Address) , must be a multiple of 4 */
	u16     u16RegionWidth;                     /* All Region Width */
	u16     u16DisplayRegionHeight;             /* Display Region Height */
	u16     u16WorkingRegionHeight;             /* Working Region Height */
	u16     u16BitmapRegionHeight;              /* Bitmap Region Height */
	u16     u16PAL_VisibleHeight;               /* PAL system Visible Region Height */
	u16     u16NTSC_VisibleHeight;              /* NTSC system Visible Region Height */
	u16     u16PAL_LeftTopPoint_X;              /* PAL system Left-Top ponit X */
	u16     u16PAL_LeftTopPoint_Y;              /* PAL system Left-Top ponit Y */
	u16     u16NTSC_LeftTopPoint_X;             /* NTSC system Left-Top ponit X */
	u16     u16NTSC_LeftTopPoint_Y;	            /* NTSC system Left-Top ponit Y */
	u16     u16ColorDepth;                      /* OSD color Depth ,1(4-Bits),2(8-Bits)*/
	u16     u16DefaultMixRatio;                 /* Default OSD Frame mix ratio */
	bool8   b8LinkNextFrame;                    /* Link next frame, TRUE(Enable)/FALSE(Disable) */
	u16     u16kNextFrameHandleID;              /* The frame ID of link next frame */
	bool8   b8DefaultPALSystem;                 /* Default OSD frame Mode, TRUE(PAL)/FALSE(NTSC) */
}DVB_OSD_FrameInitParameters;



/**
* Define the OSD  Initial parameters.
*/
typedef struct
{
    DVB_OSD_ColorPatelleInitParameters          stColorPaletteParams;	    /* Color Palette Inital parameters */
    DVB_OSD_FontTableInitParameters             stFontTableParams;          /* Font Table Inital parameters */
    DVB_OSD_LinemapInitParameters               stLinemapParams;            /* Linemap Inital parameters */
    DVB_OSD_FrameInitParameters                 stFrameParams;              /* Frame Inital parameters */
    u16                                         u16TransponderColorIdx;     /* The Coloe Index of Transponder Color*/
    u16                                         u16AreaCopyColorKeyIndex;   /* The Color Index of Area Copy Color Key*/
    bool8                                       b8OSDDrawStringFGColorKey;  /* The Color Key Status of Draw String's Font Color, TRUE(enable)/FALSE(disable) */
    bool8                                       b8OSDDrawStringBGColorKey;  /* The Color Key Status of Draw String's Background Color, TRUE(enable)/FALSE(disable) */
    bool8                                       b8AreaCopyColorKeyEnable;   /* The Color Key Status of Area Copy, TRUE(enable)/FALSE(disable) */
}DVB_OSD_InitParameters;


/**
* Define the Icon bitmap unzip parameters.
*/
typedef struct DVB_OSD_UnzipBmpParameter
{
	u32	u32TopFieldZipLength;
	u32	u32BottomFieldZipLength;
	u32	u32TopFieldBmpLength;
	u32	u32BottomFieldBmpLength;
	u8*	pu8TopFieldData;
	u8*	pu8BottomFieldData;
}DVB_OSD_UnzipBmpParameter;



/**
* Define the OSD font initial parameter structure.  The system needs load three arrays to SDRAM
buffer.  These arrays are generated by CheerTek's tool.
*/
typedef struct DVB_OSD_FontsInitParameter
{
	u8 	u8FontTableIdx;      		/**< the font table index , only support two font table now ( idx = 0 , 1) */
	u8 	*pu8FontTable;				/**< the pointer of fonts array */
	u32 u32FontTableArraySize;		/**< the size of font table array */
	u32 u32FontTableDramSize;		/**< the size of dram font table  */
}DVB_OSD_FontsInitParameter;

#if 0
/**
* Define the Bitmap parameter structure.  The bmp needs to load from flash to SDRAM first,
the application can display to OSD.  We need specific a index number for each bmp.
When we want to load a bmp to SDRAM bmp buffer, we need a position to put this bmp.  The
application needs arrange the position for every bmp in SDRAM.  The SDRAM bmp buffer's height
and width depends the driver configuration.  The bmp data array is generated by CheerTek's tool.
*/
typedef struct DVB_OSD_BmpParameter
{
	u8 u8BmpIndex;		/**< This is bmp index and the number is unique. */
	u16 u16PosX;		/**< the position X in SDRAM buffer */
	u16 u16PosY;		/**< the position Y in SDRAM buffer */
	u16 u16Width;		/**< the width of bmp */
	u16 u16Height;		/**< the height of bmp */
	u8 *pu32BmpData;	/**< the pointer of bmp data */
	u16 u16Length;		/**< the bytes of bmp data length */
}DVB_OSD_BmpParameter;
#endif

/**
* Define the Bitmap parameter structure.  The bmp needs to load from flash to SDRAM first,
the application can display to OSD.  We need specific a index number for each bmp.
When we want to load a bmp to SDRAM bmp buffer, we need a position to put this bmp.  The
application needs arrange the position for every bmp in SDRAM.  The SDRAM bmp buffer's height
and width depends the driver configuration.
*/
typedef struct DVB_OSD_BmpParameter
{
	u8 u8BmpIndex;		/**< This is bmp index and the number is unique. */
	u16 u16PosX;		/**< the position X in SDRAM buffer */
	u16 u16PosY;		/**< the position Y in SDRAM buffer */
	u16 u16Width;		/**< the width of bmp */
	u16 u16Height;		/**< the height of bmp */
}DVB_OSD_BmpParameter;

#if 0
EN_OSD_ERROR DVB_OSDMenuPalette_Load (u32 *pu32Palette, u16 u16Length);
/*! \fn EN_OSD_ERROR DVB_OSDMenuPalette_Load (u32 *pu32Palette, u16 u16Length)
\brief Load the menu palette to SDRAM buffer.  The total color palette number is 255.
The color palette number 256 is transparency.
The menu palette aligns to bottom.  For example: the application wants to load
100 color palettes for menu.  These palettes index are from #155  to #254.
\param pu32Palette (Input) the pointer of palette array
\param u16Length (Input) the bytes of palette array
\return EN_OSD_NO_ERROR - success
\return EN_OSD_ERROR_SDRAM_ACCESS - access the SDRAM fail
\return EN_OSD_ERROR_DATA_FORMAT - the palette format or length error.
*/
#endif

typedef u8 ct_sm_EncodingSrc; // [0x00, 0xFF] // LocalCode/Lcode
typedef u16 ct_sm_EncodingSrcDb; // [0x00, 0xFF] // LocalCode/Lcode

typedef u16 ct_sm_ExtCharCodeTable [96]; // from 0xA0 to 0xFF

typedef struct ct_sm_CharGlyph_st
{
    u8 xoff_to_blackbox; // 虑

⌨️ 快捷键说明

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