/**************************************************************************** * Copyright (c) 2004 DST Technologies Inc. All Rights Reserved. * * Module: dsthhalgfx.h * ***************************************************************************/ #if !defined (_DSTHAL_GFX_H_) #define _DSTHAL_GFX_H_ #define DHL_GFX_FMT8 8 #define DHL_GFX_FMT16 16 #define DHL_GFX_FMT32 32 #define PLANE_OSD 0 #define PLANE_CC 1 #define PLANE_PIP 2 #define MAX_PLANE 3 #define DHL_GFX_FORMAT (DHL_GFX_FMT32) #if (DHL_GFX_FMT8 == DHL_GFX_FORMAT) #define DS_PIXEL_t DS_U8 #elif (DHL_GFX_FMT16 == DHL_GFX_FORMAT) #define DS_PIXEL_t DS_U16 #elif (DHL_GFX_FMT32 == DHL_GFX_FORMAT) #define DS_PIXEL_t DS_U32 #else # error DHL_GFX_FORMAT shall be defined! #endif #define DHL_GFX_GetPixelFormat() DHL_GFX_FORMAT #if 1 typedef enum tag_ColorNum_t { COLOR_BLACK=1, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE, COLOR_T_BLACK, COLOR_T_RED, COLOR_T_GREEN, COLOR_T_YELLOW, COLOR_T_BLUE, COLOR_T_MAGENTA, COLOR_T_CYAN, COLOR_T_WHITE, COLOR_MASK=COLOR_BLACK } ColorNum_t; #else #define COLOR_BLACK RGB555( 0, 0, 1) #define COLOR_RED RGB555( 31, 0, 0) #define COLOR_GREEN RGB555( 0, 31, 0) #define COLOR_YELLOW RGB555( 31, 31, 0) #define COLOR_BLUE RGB555( 0, 0, 31) #define COLOR_MAGENTA RGB555( 31, 0, 31) #define COLOR_CYAN RGB555( 0, 31, 31) #define COLOR_WHITE RGB555( 31, 31, 31) #define COLOR_T_BLACK ARGB555( 0, 0, 1) #define COLOR_T_RED ARGB555( 31, 0, 0) #define COLOR_T_GREEN ARGB555( 0, 31, 0) #define COLOR_T_YELLOW ARGB555( 31, 31, 0) #define COLOR_T_BLUE ARGB555( 0, 0, 31) #define COLOR_T_MAGENTA ARGB555( 31, 0, 31) #define COLOR_T_CYAN ARGB555( 0, 31, 31) #define COLOR_T_WHITE ARGB555( 31, 31, 31) #define COLOR_MASK ARGB555( 0, 0, 0) #endif typedef enum { /* * Graphics formats suppported by the DPC and BLT */ PF_RGB32 = 0, // aRGB32(8,8,8,8) PF_INDEX8 = 7, // ³»ºÎÀûÀ¸·Î´Â RGB32·Î ÀúÀå PF_CC_TEMP_INDEX8, // ½ºÅ©·ÑÀ» À§ÇÑ CC Àӽà Pixel Buffer PF_RECT_BOX, // ƯÁ¤»öÀÇ »ç°¢Çü ¹Ú½º¸¦ ±×¸®±â À§ÇÑ Æ÷¸ä, ±×·¡ÇÈ ¸Þ¸ð¸®´Â »ý¼º½ÃŰÁö ¾Ê´Â´Ù. PF_RGB16 , // aRGB16 (1,5,5,5) : for BGT GUI plane (0) PF_CC_RGB16 // aRGB16 (1,5,5,5) : for BGT CC plane (1) } PIXEL_FORMATS_t; #define PLANE_OSD 0 #define PLANE_CC 1 #define PLANE_PIP 2 #define MAX_PLANE 3 typedef struct tag_RECT_t { int x; int y; int w; /* Should not be negative but signed for calculation */ int h; /* Should not be negative but signed for calculation */ } RECT_t; #ifndef SETRECT #define SETRECT(rect, xx, yy, ww, hh) { \ (rect)->x = (xx); \ (rect)->y = (yy); \ (rect)->w = (ww); \ (rect)->h = (hh); \ } #endif typedef struct tag_PIXMAP_t { RECT_t InRect; RECT_t OutRect; RECT_t rectVisible; /* È­¸é¿¡ º¸¿©Áú ¿µ¿ª (ÀϹÝÀûÀ¸·Î x,y,w,h¿Í °°´Ù)*/ RECT_t rectTarget; /* È­¸é¿¡ ÂïÇôÁú Blit ¿µ¿ª (ÀϹÝÀûÀ¸·Î x,y,w,h¿Í °°´Ù) */ DS_U8 visible; /* Visible Flag 1: visible, 0: not visible */ DS_U8 plane; /* Add by PKH 2004.06.12 */ DS_U8 fmt; /* pixel format: RGB32, INDEX8 */ DS_U8 psize; /* number of bits per pixel */ DS_U8 blending; /* Blending Type 1:blending On, 0:blending Off (Copy)*/ DS_PIXEL_t *baseAddr; /* Starting address of pixel buffer */ DS_U8 *FBAddr; /* Starting address of pixel buffer */ DS_U16 *clut; /* optional color lookup table for indexed formats */ DS_U8 *baseIO; } PIXMAP_t; typedef struct tag_OSDMAP_t { RECT_t MenuInRect; RECT_t MenuOutRect; RECT_t CCInRect; RECT_t CCOutRect; RECT_t PIPInRect; RECT_t PIPOutRect; DS_U8 bInterlaced; DS_U16 *baseAddr; /* Starting address of pixel buffer */ DS_U8 *FBAddr; /* Starting address of pixel buffer */ DS_U16 *clut; /* optional color lookup table for indexed formats */ DS_U8 *baseIO; int bInit; } OSDMAP_t, *P_OSDMAP_t; #if defined __cplusplus extern "C" { #endif // // Basic APIs // DHL_RESULT DHL_GFX_Init(int Plane, DS_U16 osd_x, DS_U16 osd_y, DS_U16 osd_w, DS_U16 osd_h, DS_U16 osd_wo, DS_U16 osd_ho, int Fmt, DS_U32 *pBufferId ); DHL_RESULT DHL_GFX_Close(void); DS_BOOL DHL_GFX_IsInit(int Plane); DS_U8 *DHL_GFX_GetVRAM(int Plane); int DHL_GFX_EnablePlane(int Plane, int OnOff); DS_BOOL DHL_GFX_IsEnabled(int Plane); DHL_RESULT DHL_GFX_PresetOSDParam(DHL_VIDEO_FORMAT iVidOutFmt, int Plane, DS_U16 HStart, DS_U16 VStart, DS_U16 InHWidth, DS_U16 InVLength, DS_U16 OutHWidth,DS_U16 OutVLength,DS_U8 bInterlaced); DHL_RESULT DHL_GFX_ChangeOSDParam(int Plane, DS_U16 HStart, DS_U16 VStart, DS_U16 InHWidth, DS_U16 InVLength, DS_U16 OutHWidth,DS_U16 OutVLength,DS_U8 bInterlaced); DHL_RESULT DHL_GFX_ApplyOSDVidOutFmt(DHL_VIDEO_FORMAT iVidOutFmt); DHL_RESULT DHL_GFX_AllocFrameBuffer( DS_U32 *pBufferId, DS_U16 width, DS_U16 height, int fmt ); DHL_RESULT DHL_GFX_FreeFrameBuffer( DS_U32 pBufferId ); DS_U8 *DHL_GFX_GetFBRAM(int Plane); DS_U8 *DHL_GFX_GetIOAddr(int Plane); DS_U8 *DHL_GFX_GetTempVAddr(void); DS_U8 *DHL_GFX_GetTempFBAddr(void); DS_U32 DHL_GFX_GetPhysicalFrameBuffer(void); DS_U32 DHL_GFX_GetBaseAddr(DS_U32 bufferId); // // Blend / Palette // void DHL_GFX_SetBlendPixMap(int Plane, char foreground, char background); int DHL_GFX_SetPallete(int Plane, int StartIdx, int Length, DS_PIXEL_t *pal); // // Utility APIs // void BlockFill(int Plane, DS_U16 src, int x, int y, int w, int h); void BlockCopyEx(int Plane, const DS_U8 *src, int x, int y, int w, int h); void DHL_GFX_DrawBox( DS_U32 pBufferId, int x, int y, int w, int h, DS_PIXEL_t color ); void DHL_GFX_DrawPixels( DS_U32 pBufferId, int offsetX, int offsetY, int w, DS_PIXEL_t *pPixels ); void DHL_GFX_ReadPixels( DS_U32 pBufferId, int offsetX, int offsetY, int w, int h, DS_PIXEL_t *pPixels ); void DHL_GFX_DrawImage( DS_U32 pBufferId, int x, int y, int w, int h, DS_PIXEL_t *pPixels); void DHL_GFX_CopyBlock(DS_U32 p_src_buffer_id, DS_U32 p_dst_buffer_id, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h); DS_U32 DHL_GFX_GetPhysicalFrameBuffer(void); DS_U32 DHL_GFX_GetBaseAddr(DS_U32 bufferId); void DHL_GFX_PutString(DS_U32 bufferId, int x, int y, const char *str); void DHL_GFX_UpdateScreen(int Plane); void DHL_GFX_CopyBlock(DS_U32 p_src_buffer_id, DS_U32 p_dst_buffer_id, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h); #if defined __cplusplus } #endif #endif /* _DSTHAL_GFX_H_ */