26 #define INTELLIGENT_RENDER_WITH_SCREEN_COORDS 41 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 42 #define DLA_struct _DLA4_Surface 43 #define DLA_Surface DLA4_Surface 44 #define DLA_FUNCTION(func) DLA_PC4_ ## func 45 #define DLAColor OSDColor 47 #if defined(OSD_16_BIT) || defined(OSD_8_BIT) 56 #define DLA_struct _DLA2_Surface 57 #define DLA_Surface DLA2_Surface 58 #define DLA_FUNCTION(func) DLA_PC2_ ## func 59 #define DLAColor HD2Color 70 #define DLA_struct _DLA1_Surface 71 #define DLA_Surface DLA1_Surface 72 #define DLA_FUNCTION(func) DLA_PC1_ ## func 73 #define DLAColor U8BIT 83 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 84 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 86 #ifdef INTELLIGENT_RENDER_WITH_SCREEN_COORDS 87 #define HD_SCALEUP_RECT(dli, x, y, w, h, lw) \ 88 if (mg_ctxt.osd_y.mlt != mg_ctxt.osd_y.div) \ 90 w = HD_X_SCALEUP(dli->sd_x + w + x); \ 91 x = HD_X_SCALEUP(dli->sd_x + x); \ 93 x -= HD_X_SCALEUP(dli->sd_x); \ 94 h = HD_Y_SCALEUP(dli->sd_y + h + y); \ 95 y = HD_Y_SCALEUP(dli->sd_y + y); \ 97 y -= HD_Y_SCALEUP(dli->sd_y); \ 99 lw = HD_W_SCALEUP(lw); \ 103 #define HD_SCALEUP_REGN(dli, l, t, r, b) \ 104 if (mg_ctxt.osd_y.mlt != mg_ctxt.osd_y.div) \ 106 r = HD_X_SCALEUP(dli->sd_x + r) - HD_X_SCALEUP(dli->sd_x); \ 107 l = HD_X_SCALEUP(dli->sd_x + l) - HD_X_SCALEUP(dli->sd_x); \ 108 t = HD_Y_SCALEUP(dli->sd_y + t) - HD_Y_SCALEUP(dli->sd_y); \ 109 b = HD_Y_SCALEUP(dli->sd_y + b) - HD_Y_SCALEUP(dli->sd_y); \ 114 #define HD_SCALEUP_RECT(dli, x, y, w, h, lw) \ 115 if (mg_ctxt.osd_y.mlt != mg_ctxt.osd_y.div) \ 117 w = HD_X_SCALEUP(w + x); \ 118 x = HD_X_SCALEUP(x); \ 120 h = HD_Y_SCALEUP(h + y); \ 121 y = HD_Y_SCALEUP(y); \ 124 lw = HD_W_SCALEUP(lw); \ 128 #define HD_SCALEUP_REGN(dli, l, t, r, b) \ 129 if (mg_ctxt.osd_y.mlt != mg_ctxt.osd_y.div) \ 131 r = HD_X_SCALEUP(r); \ 132 l = HD_X_SCALEUP(l); \ 133 t = HD_Y_SCALEUP(t); \ 134 b = HD_Y_SCALEUP(b); \ 139 #define LOCK_BUFFER( di, c_sz ) \ 140 if (di->canvas.col_buff == NULL) { \ 141 di->canvas.col_buff = STB_OSDMhegLockBuffer( di->canvas.hw_handle, &di->canvas.buff_pitch ); \ 144 #define UNLOCK_BUFFER( di ) \ 145 if (di->canvas.col_buff != NULL) { \ 146 STB_OSDMhegUnlockBuffer( di->canvas.hw_handle ); \ 147 di->canvas.col_buff = NULL; \ 164 #ifdef INTELLIGENT_RENDER_WITH_SCREEN_COORDS 203 if (OSD_IsColourOpaque(c_col))
239 if ((col >> 12) == 0xf)
259 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 273 if ((c_col >> 24) == MAX_ALPHA)
312 int line_width,
int bordered,
334 if (new_info != NULL)
336 TRACE(TGRAPHICS, (
"(%d,%d,%d,%d,lw=%d,b=%d,lcol=0x%x,fcol=0x%x)", x, y, w, h,
337 line_width, bordered, line_colour, fill_colour))
345 #ifdef INTELLIGENT_RENDER_WITH_SCREEN_COORDS 364 if (OSD_IsColourOpaque( col ))
372 col = OSD_FindNearestColourIndex( line_colour );
384 #if defined(OSD_16_BIT) 390 if ((col >> 12) == 0xf)
410 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 413 ConvertAlpha(fill_colour, f_col);
417 if ((f_col >> 24) == MAX_ALPHA)
457 assert( data != NULL );
470 #if defined(OSD_16_BIT) || defined(OSD_31_BIT) || defined(OSD_32_BIT) 500 int start_angle,
int arc_angle,
int line_width,
512 U8BIT c_ndx = OSD_FindNearestColourIndex(line_colour);
514 DLA_PC1_Arc((DLA1_Surface *)&dla_info->
canvas, x, y, w, h,
515 start_angle, arc_angle, line_width, c_ndx );
517 if (!OSD_IsColourOpaque(c_ndx))
530 DLA_PC2_Arc((DLA2_Surface *)&dla_info->
canvas, x, y, w, h,
531 start_angle, arc_angle, line_width,
MakeHD2Color(line_colour));
533 if ((line_colour >> 28) != 0xf)
542 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 544 ConvertAlpha(line_colour, l_col);
550 DLA_PC4_Arc((DLA4_Surface *)&dla_info->
canvas, x, y, w, h,
551 start_angle, arc_angle, line_width, l_col );
553 if ((l_col >> 24) != MAX_ALPHA)
591 U8BIT f_ndx = OSD_FindNearestColourIndex(fill_colour);
592 U8BIT l_ndx = OSD_FindNearestColourIndex(line_colour);
594 DLA_PC1_Ellipse((DLA1_Surface *)&dla_info->
canvas, x, y, w, h,
595 line_width, f_ndx, l_ndx );
597 if (!OSD_IsColourOpaque(f_ndx) || !OSD_IsColourOpaque(l_ndx))
610 DLA_PC2_Ellipse((DLA2_Surface *)&dla_info->
canvas, x, y, w, h,
613 if (((fill_colour >> 28) != 0xf) || ((line_colour >> 28) != 0xf))
622 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 624 ConvertAlpha(fill_colour, f_col);
625 ConvertAlpha(line_colour, l_col);
631 DLA_PC4_Ellipse((DLA4_Surface *)&dla_info->
canvas, x, y, w, h,
632 line_width, f_col, l_col );
634 if (((f_col >> 24) != MAX_ALPHA) || ((l_col >> 24) != MAX_ALPHA))
663 int start_angle,
int arc_angle,
int line_width,
675 U8BIT f_ndx = OSD_FindNearestColourIndex(fill_colour);
676 U8BIT l_ndx = OSD_FindNearestColourIndex(line_colour);
678 DLA_PC1_Sector((DLA1_Surface *)&dla_info->
canvas, x, y, w, h,
679 start_angle, arc_angle, line_width, f_ndx, l_ndx );
681 if (!OSD_IsColourOpaque(f_ndx) || !OSD_IsColourOpaque(l_ndx))
694 DLA_PC2_Sector((DLA2_Surface *)&dla_info->
canvas, x, y + 1, w, h,
695 start_angle, arc_angle, line_width,
698 if (((fill_colour >> 28) != 0xf) || ((line_colour >> 28) != 0xf))
707 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 709 ConvertAlpha(fill_colour, f_col);
710 ConvertAlpha(line_colour, l_col);
716 DLA_PC4_Sector((DLA4_Surface *)&dla_info->
canvas, x, y + 1, w, h,
717 start_angle, arc_angle, line_width, f_col, l_col );
719 if (((f_col >> 24) != MAX_ALPHA) || ((l_col >> 24) != MAX_ALPHA))
742 int line_width,
OSDColor line_colour)
755 U8BIT l_ndx = OSD_FindNearestColourIndex(line_colour);
757 DLA_PC1_Line((DLA1_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
760 if (!OSD_IsColourOpaque(l_ndx))
771 DLA_PC2_Line((DLA2_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
774 if ((line_colour >> 28) != 0xf)
783 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 785 ConvertAlpha(line_colour, l_col);
789 DLA_PC4_Line((DLA4_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
792 if ((l_col >> 24) != MAX_ALPHA)
845 #ifdef INTELLIGENT_RENDER_WITH_SCREEN_COORDS 884 U8BIT f_ndx = OSD_FindNearestColourIndex(fill_colour);
885 U8BIT l_ndx = OSD_FindNearestColourIndex(line_colour);
889 DLA_PC1_Polygon((DLA1_Surface *)&dla_info->
canvas, dla_info->
polygon,
890 line_width, f_ndx, l_ndx );
894 DLA_PC1_Polyline((DLA1_Surface *)&dla_info->
canvas, dla_info->
polygon,
898 if (!OSD_IsColourOpaque(f_ndx) || !OSD_IsColourOpaque(l_ndx))
914 DLA_PC2_Polygon((DLA2_Surface *)&dla_info->
canvas, dla_info->
polygon,
919 DLA_PC2_Polyline((DLA2_Surface *)&dla_info->
canvas, dla_info->
polygon,
922 if (((fill_colour >> 28) != 0xf) || ((line_colour >> 28) != 0xf))
931 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 933 ConvertAlpha(fill_colour, f_col);
934 ConvertAlpha(line_colour, l_col);
942 DLA_PC4_Polygon((DLA4_Surface *)&dla_info->
canvas, dla_info->
polygon,
943 line_width, f_col, l_col );
947 DLA_PC4_Polyline((DLA4_Surface *)&dla_info->
canvas, dla_info->
polygon,
950 if (((f_col >> 24) != MAX_ALPHA) || ((l_col >> 24) != MAX_ALPHA))
983 TRACE(TGRAPHICS, (
"sd(l=%d,t=%d,r=%d,b=%d)", x1, y1, x2, y2))
987 U8BIT f_ndx = OSD_FindNearestColourIndex(fill_colour);
988 U8BIT l_ndx = OSD_FindNearestColourIndex(line_colour);
990 DLA_PC1_Rectangle((DLA1_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
991 line_width, line_width, f_ndx, l_ndx );
993 if (!OSD_IsColourOpaque(f_ndx) || !OSD_IsColourOpaque(l_ndx))
1006 TRACE(TGRAPHICS, (
"hd(l=%d,t=%d,r=%d,b=%d)", x1, y1, x2, y2))
1007 DLA_PC2_Rectangle((DLA2_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
1011 if (((fill_colour >> 28) != 0xf) || ((line_colour >> 28) != 0xf))
1020 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 1022 ConvertAlpha(fill_colour, f_col);
1023 ConvertAlpha(line_colour, l_col);
1029 TRACE(TGRAPHICS, (
"hd(l=%d,t=%d,r=%d,b=%d)", x1, y1, x2, y2))
1030 DLA_PC4_Rectangle((DLA4_Surface *)&dla_info->
canvas, x1, y1, x2, y2,
1034 if (((f_col >> 24) != MAX_ALPHA) || ((l_col >> 24) != MAX_ALPHA))
1053 U16BIT x1_bw, y1_bw, x2_bw, y2_bw;
1062 x1_bw = y1_bw = x2_bw = y2_bw = dla_info->
border_width;
1066 #ifdef INTELLIGENT_RENDER_WITH_SCREEN_COORDS 1072 #error Be intelligent 1086 DLA_PC1_Border((DLA1_Surface *)&dla_info->
canvas, x1_bw, y1_bw, x2_bw, y2_bw,
1096 DLA_PC2_Border((DLA2_Surface *)&dla_info->
canvas, x1_bw, y1_bw, x2_bw, y2_bw,
1103 #if defined(OSD_31_BIT) || defined(OSD_32_BIT) 1109 DLA_PC4_Border((DLA4_Surface *)&dla_info->
canvas, x1_bw, y1_bw, x2_bw, y2_bw, b_col );
1120 #if defined(OSD_16_BIT) || defined(OSD_31_BIT) || defined(OSD_32_BIT)
#define FUNCTION_FINISH(name)
void OSDdrawEllipse(void *data, int x, int y, int w, int h, int line_width, OSDColor line_colour, OSDColor fill_colour)
Add a draw ellipse action to the action list.
void MG_OSDdisplayDynamicLineart(void *data, S_REGION *overlap, int x, int y)
Display dynamic lineart.
#define MakeHD2Color(osdcol)
#define COLOUR_FORMAT_ARGB4444
#define HD_SCALEUP_RECT(dli, x, y, w, h, lw)
void * STB_OSDMhegCreateSurface(U16BIT width, U16BIT height, BOOLEAN init, U32BIT colour)
Creates a hardware surface on which MHEG5 engine will draw an individual MHEG object. At its basic the function can just allocate the buffer to be returned by STB_OSDMhegLockBuffer(). It's size being: (width * height * bytes_per_pixel) Also, when 'init' is TRUE, function initialises surface buffer to the specified colour. For pixel colour format of less than four bytes, use least significant bits of 'colour'.
MHEG-5 Graphics: Dynamic Line-Art utility functions.
S_POINT_LIST * point_list
void OSDdrawDrawLine(void *data, int x1, int y1, int x2, int y2, int line_width, OSDColor line_colour)
Add a line draw action to the list.
#define OSD_DbgRemSurf(s)
void STB_OSDMhegDestroySurface(void *surface)
This function destroys surface and all data allocated by STB_OSDMhegCreateSurface() ...
void MG_DisplayImage(S_SURFACE *data, S_REGION *overlap, S32BIT x, S32BIT y)
Copy the image to the screen buffer.
#define OSD_DbgAddSurf(s)
#define UNLOCK_BUFFER(di)
void OSDclearDynamicLineart(void *data)
On screen display - clear dynamic line art.
void OSDdrawPolygon(void *data, int line_width, OSDColor line_colour, OSDColor fill_colour, int filled)
Add a draw polygon instruction to the action list.
void OSDdrawPolygonAdd(void *data, int x, int y)
Add co-ordinates that describe a polygon to draw to the action list.
struct _DLA_Info DLA_Info
#define COLOUR_FORMAT_PALETTE
#define HD_SCALEUP_REGN(dli, l, t, r, b)
#define LOCK_BUFFER(di, c_sz)
void OSDdrawSector(void *data, int x, int y, int w, int h, int start_angle, int arc_angle, int line_width, OSDColor line_colour, OSDColor fill_colour)
Add a draw sector action to the action list.
void OSDfreeDynamicLineart(void *data)
On screen display - free resources dla.
void OSDdrawPolygonStart(void *data)
Initialise a new draw polygon to add to the action list.
void * OSDinitDynamicLineart(int x, int y, int w, int h, int line_width, int bordered, OSDColor line_colour, OSDColor fill_colour)
On screen display - initialise dynamic line art.
void OSDdrawArc(void *data, int x, int y, int w, int h, int start_angle, int arc_angle, int line_width, OSDColor line_colour)
Add a draw arc action to the action list.
#define FUNCTION_START(name)
void OSDdrawRectangle(void *data, int x1, int y1, int x2, int y2, int line_width, OSDColor line_colour, OSDColor fill_colour)
Add a draw rectangle action to the action list.