aw_engine.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 454 行 · 第 1/2 页

H
454
字号
/*****************************************************************
**                                                             	**
**  Copyright (C) 2004 Amlogic,Inc.                            	**
**  All rights reserved                                        	**
**        Filename : aw_engine.h /Project:AVOS  				** 
**        Revision : 1.0                                       	**
**                                                             	**
*****************************************************************/
#ifndef _AW_ENGINE_H
#define _AW_ENGINE_H
#include "Drivers/osd/osd_output.h"

typedef void (*OSDONOFFCB)() ;
/**
 * @file aw_engine.h
 * @author LiChao, chao_li@amlogic.com.cn
 *
 * The core graphics functionality of Amlogic window resides in the device independent 
 * graphics engine, which calls the screen, mouse and keyboard drivers to interface with 
 * the hardware. User applications programs never call the core graphics engine routines 
 * directly, but rather through the programmer API's. Also, the core routines use internal 
 * text font and bitmap formats that are designed for speed and may or may not be the same 
 * as the structures used in standard API's. 
 * 
 * In addition, all clipping and color conversion is handled within this layer.  The 
 * following files comprise the core modules of Amlogic window:
 *
 *   aw_draw.c		Core graphics routines for line, circle, polygon draw and fill, text 
 *                  and bitmap drawing, color conversion
 *   devfont.c		Core routines for font, include get string size, draw string, register font.
 *   aw_resource.c 	Core routines for resource file management, get resource data, 
 *                  register resource file.
 */

/** @defgroup gui_engine GUI basic graphic engine routines.
 * @ingroup gui
 */ 
  
//basic graphic engine 

/**
 * @brief Open the screen device.
 * @param [in] disp_ctrl_fd which is the handle of display control device driver. 
 * The screen device driver need this handle to attach the screen display control 
 * routine to control device driver.
 * See also
 * AWCloseScreen
 */
void AWOpenScreen(INT32S disp_ctrl_fd);

/**
 * Close the screen device driver.
 */
void AWCloseScreen(void);

/**
 * @param [in] is_hd [0|1] Set OSD to [SD|HD] mode. 
 */
void AWSetHDScreen(int is_hd);

/**
 * @brief Create screen display buffer according the widow size inputed.
 * @param [in] draw_area_num define the display area number of this window.
 * For OSD window, we can have multi separate display area, up to 4. 
 * @param [in] areas_coor define the display area's coordinate, widths and heights.
 * @param [in] area_pf_types define the display areas pixel's color format. 
 * @param [in] off_screen_flag define if this window need support off_screen featrue. 
 * If support, need another display buffer as a back up, so it need twice memory. 
 */  
void AWCreateDrawAreas(INT8U draw_area_num, RECT* areas_coor, INT32U *area_pf_types, INT8U off_screen_flag);

/*This function set the windows strat position
*     INT16U x is the start left pixel number
*     INT16U y is the start top pixel number
*/
void AWSetWinStart(INT16U x, INT16U y) ;


/*This function rotate the windows
*     INT8U flag is the rotate angle 0-->normal 1-->90  2-->180  3-->270
*     INT16U width is the screen width
*     INT16U height is the screen height
*/
void AWRotateScreen(INT8U flag, INT16U width, INT16U height) ;

/**
 * Free display buffer if the memory is dynamic malloced.
 */
void AWDestoryDrawAreas(void);

/**
 * @brief Draw a ellipse.
 * Draw a ellipse, (x,y) is the centre's coordinate of ellipse. rx is the radius at 
 * X coordinate. ry is the radius at Y coordinate. If rx equal to ry, this ellipse 
 * is a circular.
 */
void AWEllipse(COORD x, COORD y, COORD rx, COORD ry);

/**
 * @brief Draw a ellipse and fill it with current fore ground color.
 * Draw a ellipse, (x,y) is the centre's coordinate of ellipse. rx is the radius at 
 * X coordinate. ry is the radius at Y coordinate. If rx equal to ry, this ellipse 
 * is a circular.
 */
void AWFillEllipse(COORD x, COORD y, COORD rx, COORD ry);

/**
 * @brief Draw a polygon in the foreground color. 
 * The polygon is only closed if the first point is repeated at the end. However, 
 * internal crossings are not handled correctly.
 * @param [in] count define the polygon point number.
 * @param [in] points the array of points coordinate.
 */
void AWPoly(INT32S count, POINT *points);

/**
 * Draw a polygon and fill in the foreground color. The polygon is only 
 * closed if the first point is repeated at the end. However, internal crossings are 
 * not handled correctly.
 */
void AWFillPoly(INT32S count, POINT *points);


/**
 * @brief Draw a rectangle on screen.
 * Draw a rectangle using the current foreground color, left-top point coordinate is (x,y).
 * Same as draw four lines, from (x,y) to (x+width, y), 
 * from (x+width, y) to (x+width, y+ height), 
 * from (x,y) to (x, y+height), 
 * from (x, y+height) to (x+width, y+height).
 */
void AWRect(COORD x, COORD y, COORD width, COORD height);

/**
 * Draw a rectangle and fill the rectangle using the current foreground color,
 * left-top point coordinate is (x,y). 
 */
void AWFillRect(COORD x, COORD y, COORD width, COORD height);

/**
 * Draw an arbitrary line using the current foreground color, from point (x1,y1) 
 * to point (x2,y2), including point (x2, y2).
 */
void AWLine(COORD x1, COORD y1, COORD x2, COORD y2);

/**
 * Draw a point at given coordinate (x,y) using current fore ground color(pen color). 
 * See alse
 * AWSetBackground, AWSetForeground
 */
void AWPoint(COORD x, COORD y);

/**
 * @brief Draw a RLE compressed BMP data to screen.
 * The 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 
 *{	
 *		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 
 *}
 * @param [in] x define the draw position of X coordinate.
 * @param [in] y define the draw position of Y coordinate.
 * @param [in] imagebits the data point of RLE bmp.
 */
void AWRLEBitmap(COORD x, COORD y, INT8U *imagebits);

/**
 * Set the screen device's palette value.
 * @param [in] block_index For some screen device, which support multi display blcok, 
 * every block can have its own color palette, so this parameter define the block index 
 * which'll be set the palette. If block_index is 0, which means set the main palette. 
 * @param [in] pal_count indicate the color number of palette which will be set.
 * @param [in] palette This is an array of palette's color, should be palette[pal_count]. The 
 * data type of palette is a YUV compress data format, looks like 0x0UUUUYYYYYYYVVVV, which 
 * means the Y's value is 0xYYYYYYY0, U's value is 0xUUUU0000, V's value is 0xVVVV0000. 
 */
void AWSetPalette(INT8U block_index, INT8U pal_count, YUVENTRY *palette);

/**
 * @brief Set the alpha blending parameter. 
 * As we know, some screen device have multi layer and support Alpha blending. So the 
 * API is an interface of set the Alpha blend parameter.
 * @param [in] block_index For some screen device, which support multi display blcok, 
 * every block can have its own color palette, so this parameter define the block index 
 * which'll be set the palette. If block_index is 0, which means set the main palette.
 * @param [in] pal_count  indicate the Alpha blend parameter number of palette which will be set.
 * @param [in] palette which is an array of Alpha Blend parameter, should be palette[pal_count]. 
 * The data type of blend parameter is a short value, from 0x000 to 0xfff, 0x000 represent 
 * transparent, 0xfff means opaque.
 */
void AWSetAlphaMask(INT8U block_index, INT8U pal_count, YUVENTRY *palette);

/**
 * Set the back ground color when drawing text.
 * @param [in] bg back ground color, which can be the color index or RGB value if the device 
 * support true color.
 */
PIXELVAL AWSetBackground(PIXELVAL bg);

/**
 * Set the color value of pen. 
 * @param [in] fg Pen color, which can be the color index or RGB value if the device 
 * support true color.
 */
PIXELVAL AWSetForeground(PIXELVAL fg);

/**
 * Get the pen color used now. 
 */
PIXELVAL AWGetForeground(void) ;

/**
 * Get the back ground color used now. 
 */
PIXELVAL AWGetBackround(void);

/**
 * set the function cb when screen on and screen off
 * @param [in] on is the screen on cb
 * @param [in] off is the screen off cb
 */
void AWSetOnOffCB(OSDONOFFCB on, OSDONOFFCB off) ;

/**

⌨️ 快捷键说明

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