t25_osd.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 229 行

H
229
字号
/*****************************************************************
**                                                             	**
**  Copyright (C) 2004 Amlogic,Inc.                            	**
**  All rights reserved                                        	**
**        Filename : t25_osd.c /Project:AVOS  					** 
**        Revision : 1.0                                       	**
**                                                             	**
*****************************************************************/
#ifndef __T25_OSD_H_
#define __T25_OSD_H_

#include "osd_output.h"
/* Define as __inline if that's what the C compiler calls it.  */

//#define DYNAMIC_OSD_BUFFER

#define Setup_Menu_Alpha_0 		0x0000
#define Setup_Menu_Alpha_1 		0x0ddd	
#define Setup_Menu_Alpha_2 		0x0ccc
#define Setup_Menu_Alpha_3 		0x0fff

extern OSDDEVICE	osddev ;
extern INT32S reg_even_addr, reg_odd_addr ;
extern INT8U * pMallocAddr ;
extern INT8U *	sys_scr_odd_addr ;
extern INT8U * sys_scr_even_addr ;
extern INT8U *	sys_offscr_odd_addr ;
extern INT8U * sys_offscr_even_addr ;
extern POINT   start_point;

#ifdef __ROM_
//#define SPEED_UP
#define PRINT_WORRYING_MSG(a) 
#define PRINT_ERROR_MSG(a)
#else
#define PRINT_WORRYING_MSG(a) {\
                        OS_CPU_SR  cpu_sr;\
                        OS_ENTER_CRITICAL(); \
                        printf("Warning: %s \n", a); \
                        OS_EXIT_CRITICAL();}
#define PRINT_ERROR_MSG(a) {\
                        OS_CPU_SR  cpu_sr;\
                        OS_ENTER_CRITICAL(); \
                        printf("Error: %s \n", a); \
                        OS_EXIT_CRITICAL();}
#endif


/****************************************************************************************/
/*	According device flag to clear display buffer and reset display buffer head			*/
/****************************************************************************************/
extern INT32S OSDRefreshScrBuffer(POSDDEV psd) ;

/****************************************************************************************/
/*	create screen , and do some initialize for screen device							*/
/****************************************************************************************/
extern INT32S OSDInit(POSDDEV psd);

/****************************************************************************************/
/*	create window , and locate memory for display buffer.
		PSCRDEV psd : screen device point;
		INT8U win_num : the windows of this screen include
		RECT win_areas : the display rect of windows, size is win_areas[win_num] 
		INT32U *pf_types : the pixel format of every windows supported, size is  pf_types[win_num]*/ 
/****************************************************************************************/
extern INT32S OSDCreate(POSDDEV psd, INT8U win_num, RECT* win_areas, INT32U *pf_types, INT8U off_screen_flag);   
    
/****************************************************************************************/
/*	close screen and free memory for display buffer.
		PSCRDEV psd : screen device point;													*/
/****************************************************************************************/
extern INT32S OSDDestroy(POSDDEV psd) ;


/****************************************************************************************/
/*	set screen's system palette, or window's palette.
		PSCRDEV psd : screen device point;													
		INT8U handle: indicate set which palette, 0 is sys, other is the window id 
		INT32S count: set palette or alpha mask number
		YUVENTRY *pal : palette or alpha mask value										*/
/****************************************************************************************/
extern INT32S OSDSetPalette(POSDDEV psd,INT8U handle,INT32S count,YUVENTRY *pal) ;

/****************************************************************************************/
/*	set screen's system alpha blending mask, or window's alpha blending mask.
		PSCRDEV psd : screen device point;													
		INT8U handle: indicate set which palette, 0 is sys, other is the window id 
		INT32S count: set palette or alpha mask number
		YUVENTRY *pal : palette or alpha mask value										*/
/****************************************************************************************/
extern INT32S OSDSetAlphaMask(POSDDEV psd,INT8U handle,INT32S count,YUVENTRY *pal) ;

/****************************************************************************************/
/*	Set device flag as off screen, means all following draw action should do on off 
    display buffer. If device don't support off screen function, this function should do
    nothing.				 															*/
/****************************************************************************************/
extern INT32S OSDSetOffScreen(POSDDEV psd) ;


/****************************************************************************************/
/*	If support off screen, this function will active the off screen buffer as current display
  buffer and change the before display buffer to off screen buffer. If don't support off screen 
  function, should be a empty function
		POSDDEV psd : screen device point;												*/
/****************************************************************************************/
extern INT32S OSDActiveOffScreen(POSDDEV psd) ;

/********************************************************************************************/
/*	Turn off screen, don't show anything. If device don't support this function, do nothing	
		PSCRDEV psd : screen device point;													*/
/********************************************************************************************/
extern INT32S OSDTurnOffScreen(POSDDEV psd) ;

/********************************************************************************************/
/*	Turn on screen. If device don't support this function, do nothing	
		PSCRDEV psd : screen device point;													*/
/********************************************************************************************/
extern INT32S OSDTurnOnScreen(POSDDEV psd) ;

/****************************************************************************************/
/*  draw pixel at absoluteness (x,y).
        PSCRDEV psd : screen device point;
        COORD x,COORD y : coordinate of pixel
        PIXELVAL c: pixel value, should be index of palette
    pixel format, 16bit sequence(PF_PALETTE_2): 
        --------------------------------------------------------------------------
        | pixel0 |  pixel1 | pixel2 | pixel3 | pixel4 | pixel5 | pixel6 | pixel7 | 
        ---------------------------------------------------------------------------
        bit15                                                                   bit0*/
/****************************************************************************************/
extern INT32S OSDDrawPixel(POSDDEV psd,COORD x,COORD y,PIXELVAL c);

/********************************************************************************************/
/*  Get one pixel's color value from display buffer
        PSCRDEV psd : screen device point;          
        COORD x,COORD y : pixel's x,y corrdicate ;
        INT32S pixelnum : the drawing pixel index
        PIXELVAL *c : the pixel's color value                                               */
/********************************************************************************************/
extern INT32S OSDReadPixel(POSDDEV psd,COORD x,COORD y,PIXELVAL *c) ;

/*  Draw a horz line, internal function 
        PSCRDEV psd : screen device point;          
        COORD x,COORD y : pixel's x,y corrdinate value;
        COORD x2 : end pixel's x corrdinate value
        PIXELVAL *c : the pixel's color value of the horz line                              */
/********************************************************************************************/
extern INT32S DrawHorzLine(POSDDEV psd,COORD x,COORD y,COORD length,PIXELVAL c);
/********************************************************************************************/
/*  Draw a horz line, check legal window area if pixelval is 0(transprant color), don't draw 
        PSCRDEV psd : screen device point;          
        COORD x,COORD y : pixel's x,y corrdinate value;
        COORD x2 : end pixel's x corrdinate value
        PIXELVAL *c : the pixel's color value of the horz line                              */
/********************************************************************************************/
extern INT32S OSDDrawHorzLine(POSDDEV psd,COORD x,COORD y,COORD length,PIXELVAL c);

/********************************************************************************************/
/*  Draw a vertical line 
        POSDDEV psd : osd device point;         
        COORD x,COORD y : pixel's x,y corrdinate value;
        COORD y2 : end pixel's y corrdinate value
        PIXELVAL *c : the pixel's color value of this vertical line                         */
/********************************************************************************************/
extern INT32S OSDDrawVertLine(POSDDEV psd,COORD x,COORD y1,COORD height,PIXELVAL c);

/********************************************************************************************/
/*  use one color to fill the given rect 
        PSCRDEV psd : screen device point;          
        RECT fillrect :rect which will be filled use give color;
        PIXELVAL c : the pixel's color value to fill                            */
/********************************************************************************************/
extern INT32S OSDFillRect(POSDDEV psd,RECT fillrect,PIXELVAL c) ;

/***************************************************************************************************/
/*  Draw bits which use one bit to represent one pixels, if the bit is 0, means use back
  ground color to draw this bit if the bg_flag flag is true; it the bit is 1, then use front 
  color to draw this bit, this normally used by fonts, following is the example of bits format:
     Character H (0x48): ->  0/1  mode:    -> binary mode -> char array mode (store mode):  
     height=8, width=9
     +---------+            +---------+         01100011        0x63,
     | **   ** |            |011000110|         00110001        0x31,
     | **   ** |            |011000110|         10011000        0x98,
     | **   ** |            |011000110|         11001111        0xcf,
     | ******* |            |011111110|         11100110        0xe6,
     | **   ** |            |011000110|         00110011        0x33,
     | **   ** |            |011000110|         00011001        0x19,
     | **   ** |            |011000110|         10001100        0x8c,
     |         |            |000000000|         00000000        0x00
     +---------+            +---------+ 
        PSCRDEV psd : screen device point;
        COORD x,y : cooridcate of bits
        COORD width : bits width
        COORD height: bits height 
        IPIXELVAL fg, bg : front color and back ground color 
        INT8S bg_flag : to indicate if need to draw the bits which color is back ground color */
/***************************************************************************************************/
extern INT32S OSDDrawFontBits(POSDDEV psd,COORD x,COORD y,COORD width, COORD height,
 const INT8U * bits, PIXELVAL fg, PIXELVAL bg,INT8S bg_flag, INT8U zoomx, INT8U zoomy);
/***************************************************************************************************/
/*  Draw bmp bits which use RLE compressed,please see 5.5.2 Compressed bitmap of AML3168 DVD 
decoder API Specification as reference. The bmp bits's format is 
  struct {  unsigned char bmp_width_high;
            unsigned char bmp_width_low; //width = bmp_width_high << 8 | bmp_width_low ;
            unsigned char bmp_height_high;
            unsigned char bmp_height_low; //height = bmp_height_high << 8 | bmp_height_low
            unsigned char *compress_bmp_data; //RLE compression with the rule of 5.5.2 
         } BMP_STRUCT ;
   
        PSCRDEV psd : screen device point;
        COORD x,y : cooridcate of bits
        INT8U * bits : data of bmp, it struct like BMP_STRUCT */
/***************************************************************************************************/
extern INT32S OSDDrawRLEBits(POSDDEV psd,COORD x,COORD y,const INT8U * bits);

extern INT32S OSDSetBufferAddr(POSDDEV psd,void *even_addr1,void *odd_addr1,void *even_addr2,void *odd_addr2) ;

extern INT32S OSDSetOutputType(POSDDEV psd,INT32U output_type) ;

extern INT32S OSDMovePixels(POSDDEV psd, INT8U active_win_id, INT32U direction, INT16U insposy, INT16U insheight, INT8U *updatebits);

extern INT32S OSDCreateUsingFrameBuffer(POSDDEV psd);

extern INT32S OSDCreateNormal(POSDDEV psd);

extern INT32S OSDRewriteWindowsPosition(POSDDEV psd, INT8U active_win_id, INT16U newposx, INT16U newposy, INT16U newwidth, INT16U newheight);
#endif //end of __T25_OSD_H_

⌨️ 快捷键说明

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