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

📄 osd_bmpui.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 3 页
字号:
    		        if(OSD_ShowBottomDisp() == 1)
                        uCurByte = (DISP_SHADOW_CDROM<<4) | DISP_SHADOW_CDROM;
			        else
    			    #endif//DISP_VARIABLE_REGION	            
                        uCurByte = (DISP_SHADOW << 4) | DISP_SHADOW;
                }	
               // when high 4bit is 0 and low 4bit is 0 , for bmp matrix date,fill background color to transparent area of the bmp icon , because of 4bit represent a color for 16_color bmp.zhuyf 20/12/2004 15:31
		        else if((uCurByte & 0xf0) == 0)
		        {                    
		            if(OSD_ShowBottomDisp() == 1)
                        uCurByte = (DISP_SHADOW_CDROM<<4) | (uCurByte& 0x0f);
			        else
                        uCurByte = (DISP_SHADOW << 4) | (uCurByte& 0x0f);                                         
                }			                  
		        else if((uCurByte & 0x0f) == 0)
		         {                 
		            if(OSD_ShowBottomDisp() == 1)
                        uCurByte = (DISP_SHADOW_CDROM) | (uCurByte& 0xf0);
			        else
                        uCurByte = (DISP_SHADOW ) | (uCurByte& 0xf0);                                                       
                }			        

		        if(((uCurByte & 0xff) == 0)&&((uCurByte & 0x0f) == 0)&&((uCurByte & 0xf0) == 0))
		            continue;
                //there is error in the underside ,marked ,instead by the above part. zhuyf  20/12/2004 15:33
                /*
		        if((uCurByte & 0xf0) == 0)
                {
			        uiBit32 = (uiBit32 & (~( 0xf0<<k*8))) |(uCurByte<<(k*8));
		        }
		            else if((uCurByte & 0x0f) == 0)
		        {
			        uiBit32 = (uiBit32 & (~( 0x0f<<k*8))) |(uCurByte<<(k*8));
		        }
		        */
		        
		            else
                {	
                    uiBit32 = (uiBit32 & (~( 0xff <<k*8))) |(uCurByte<<(k*8));
                }
                //if curBYTE == 0x00,not dispose it.
            }//end for (k=0;k < 4;k++)
            buf[iDispLoc + i] =  uiBit32;//fill 32bits to osd temp buf
        }//end for (i=0; i<uExeTimes; i++)
	    yStart++; //next line
	}//for bmp height ,end for (j=0; j<iBmpHeight; j++)
}//end osd_draw_bmp_display()
#endif //OSD_BMP_DISPLAY

#ifdef OSD_BMP

/* 
 *Funciton Description:  
 * 	Draw little string on osd
 *  
 * INPUT:
 *   xStart,yStart     --> the start of string,
 *   str               --> string 
 *   fontColor,bkColor --> the string font color and background color
 *   r                 --> region
 * 
 * NOTE:
 *  its size is 1/4 size of normal string
 *  
 *  suqiaoli add 2004-11
 */

void osd_Draw_Bmp_Little_RegionString(UINT32 xStart, UINT32 yStart, const BYTE *str, BYTE fontColor, BYTE bkColor, BYTE r)
{
    BYTE    *pFont, c;
    UINT8  *pTopLine, *pBtmLine;
    UINT32  iDispLoc, iStrLoc;
    int     i, j, k;
    int     iFontWidth, iFontHigh;
    int     iRegionWidth = region[r].osd_w;

    osd_tog_region(r, OSD_ON);  
    
#ifdef OSD_VARIABLE_TEMP_DISPLAY_BUF	
	OSD_GetTrueDispRegion();
	osd_tog_region(temp_region,OSD_OFF);
#endif
    
    //initialize buffer start
    pTopLine = (UINT8 *)get_osdbuf_region_ptr(r,0);
    pBtmLine = (UINT8 *)get_osdbuf_region_ptr(r,1);
    iStrLoc = 0;
       
    if (p_scan==1)
    {
#ifdef NEWSTYLE_WINDOW   //xiongyuyue
        if(full_scrn&MESSAGE)
            iDispLoc = (yStart*iRegionWidth) + (xStart);
        else
#endif
        	//iDispLoc = (yStart*iRegionWidth) + (xStart*16/8)+(iRegionWidth/2);
        	iDispLoc = yStart*iRegionWidth + xStart/2;
    }
    else
    {
#ifdef NEWSTYLE_WINDOW   //xiongyuyue
    if(full_scrn&MESSAGE)
        iDispLoc = (yStart*iRegionWidth/2) + (xStart);
    else
#endif
	 	iDispLoc = (yStart*iRegionWidth+xStart)/2;
    }
    
    iDispLoc = iDispLoc*2;
    //skip n blank line on top(in pixel)
    //for interlace mode, we will skip n/2 blank lines, for example 4/2=2
    //iDispLoc += (iRegionWidth/4 * 2);
    
    //process each charactor until string ending('\0')
    while ( (c = ((BYTE *)str)[iStrLoc]) != '\0' ) 
    {
        BYTE curByte = 0;
        UINT32 pixel8;
        UINT32 pos;
        
        iStrLoc++;
        
        if (c == '\r') 
        { //prefix characher:to use font_table2
            if ( (c = ((BYTE *)str)[iStrLoc])=='\0' )
                break;
            
            iStrLoc++;
            if ((pFont = get_font_entry(1,c))==NULL) continue;
        }

#if defined(NEWSTYLE_WINDOW)||defined(NEW_STYLE_SETUP)  || defined(SUPPORT_REP_READ) //maoyong add 0915
        else if(c == '\a')
        {
            if ( (c=((BYTE *)str)[iStrLoc])=='\0' ) break;
            
            iStrLoc++;

            if ((pFont = get_font_entry(3,c))==NULL) continue;

        }
#endif 
		else if(c>='a' && c<='z')
		{
		    pFont=get_font_entry(0,c-'a'+0xc0);
		}
	    else 
        	//get current char entry
        	pFont = get_font_entry(0,c);
  
	    //start to process
	    pos = 3;
	    //get font information
	    iFontWidth = (int)pFont[0];
	    iFontHigh = (int)pFont[1];

		if(p_scan==0)
			iFontHigh>>=1;
          
        //start to draw        
		for (j=0; j<iFontHigh; j++) 
		{
            //For every string line = 1 blank line(in pixel) + OSD_FONT_HEIGHT-line strings + 1 blank line
            //draw top line
            for (i=0; i<iFontWidth/2; i++) 
            {
				BYTE c;
				c=pFont[pos+i/4];
				pixel8 = pTopLine[iDispLoc+i];//zhao add 2004-2-27 14:41

	          	switch(i%4)
          	   	{
          	   	case 0:
					curByte=(c&0xc0)>>6;
					break;
				case 1:
					curByte=(c&0x30)>>4;
	            	break;
				case 2:	
	            	curByte=(c&0x0c)>>2;
              		break;
              	case 3:	
              		curByte=(c&0x03);
              		break;
          		}
          	
				for (k=0; k<2; k++) 
				{
	            	if ( (1<<k) & curByte ) 
	            	{          
	            		pixel8 = (pixel8 & (~( 0x0f<<k*4))) |(fontColor<<(k*4));//zhao add 2004-2-27 14:41
	            	} 
	            	else 
	           		{
	                	if(bkColor != 0)//if color index is 0, no need to change the vlaue fo pixel8
	                	pixel8 = (pixel8 & (~( 0x0f<<k*4))) | (bkColor<<(k*4));//zhao add 2004-2-27 14:41
	           		}
				}
           		if((i % 2 == 0) &&(j % 2 == 0)) //four dots ---> one dot
             		 pTopLine[(iDispLoc+i)/2] = pixel8;
            }

        	if(iFontWidth%8)
				pos=pos+iFontWidth/8+1;
        	else
        		pos=pos+iFontWidth/8;
      
            if(p_scan==0)
            {
               //draw bottom line
               for (i=0; i<iFontWidth/2; i++) 
               {
                	BYTE c;
					c=pFont[pos+i/4];
                	pixel8 = pBtmLine[iDispLoc+i];//zhao add 2004-2-27 14:41

					switch(i%4)
					{
          			case 0:
						curByte=(c&0xc0)>>6;
						break;
					case 1:
						curByte=(c&0x30)>>4;
	                     break;
	                case 2:	
	                	curByte=(c&0x0c)>>2;
              			break;
              		case 3:	
              			curByte=(c&0x03);
              			break;
					}
					for (k=0; k<2; k++) 
					{          
						if ( (1<<k) & curByte ) 
                    	{
                			pixel8 = (pixel8 & (~( 0x0f<<k*4))) |(fontColor<<(k*4));//zhao add 2004-2-27 14:41
			  			} else
			  			{
                        	if(bkColor != 0)//if color index is 0, no need to change the vlaue fo pixel8
                        	pixel8 = (pixel8 & (~( 0x0f<<k*4))) | (bkColor<<(k*4));//zhao add 2004-2-27 14:41
                    	}
                 	 }
           			if((i % 2 == 0) &&(j % 2 == 0)) //four dots ---> one dot
        	        	pBtmLine[(iDispLoc+i)/2] = pixel8;
               }
            
   			if(iFontWidth%8)
				pos=pos+iFontWidth/8+1;
        	else
        		pos=pos+iFontWidth/8;
        		
            }
            
            iDispLoc += iRegionWidth;
            

        }//for charactor heigh  
        
         //move to next character and move up to first line of this string
        iDispLoc = iDispLoc + (iFontWidth/2) - (iRegionWidth*iFontHigh);
    
    } // end of while ( (c=((BYTE *)str)[unFontLoc])!='\0' )
    
    //timeout_osd[r] = 0;//zhaoyanhua mask it. 
}
/*
 *Funciton Description:  
 * 	Draw  string on osd
 *  
 * 
 * INPUT:
 *   xStart,yStart     --> the start of string,
 *   str               --> string 
 *   fontColor,bkColor --> the string font color and background color
 *   r                 --> region
 *   
 * suqiaoli add 2004-11
 */

void osd_Draw_Bmp_RegionString(UINT32 xStart, UINT32 yStart, const BYTE *str, BYTE fontColor, BYTE bkColor, BYTE r)
{
    BYTE    *pFont, c;
    UINT8  *pTopLine, *pBtmLine;
    UINT32  iDispLoc, iStrLoc;
    int     i, j, k;
    int     iFontWidth, iFontHigh;
    int     iRegionWidth = region[r].osd_w;

    osd_tog_region(r, OSD_ON);  
    
#ifdef OSD_VARIABLE_TEMP_DISPLAY_BUF	
	OSD_GetTrueDispRegion();
	osd_tog_region(temp_region,OSD_OFF);
#endif 
    
    //initialize buffer start
    pTopLine = (UINT8 *)get_osdbuf_region_ptr(r,0);
    pBtmLine = (UINT8 *)get_osdbuf_region_ptr(r,1);
    iStrLoc = 0;
       
    if (p_scan==1)
    {
#ifdef NEWSTYLE_WINDOW   //xiongyuyue
        if(full_scrn&MESSAGE)
            iDispLoc = (yStart*iRegionWidth) + (xStart);
        else
#endif
            //iDispLoc = (yStart*iRegionWidth) + (xStart*16/8)+(iRegionWidth/2);
            iDispLoc = yStart*iRegionWidth+ xStart/2;
    }
    else
    {
#ifdef NEWSTYLE_WINDOW   //xiongyuyue
    if(full_scrn&MESSAGE)
        iDispLoc = (yStart*iRegionWidth/2) + (xStart);
    else
#endif
	    iDispLoc = (yStart*iRegionWidth+xStart)/2;
    }
    //skip n blank line on top(in pixel)
    //for interlace mode, we will skip n/2 blank lines, for example 4/2=2
    //iDispLoc += (iRegionWidth/4 * 2);
    
    //process each charactor until string ending('\0')
    while ( (c = ((BYTE *)str)[iStrLoc]) != '\0' ) 
    {
        BYTE curByte = 0;
        UINT32 pixel8;
        UINT32 pos;
        
        iStrLoc++;
        
        if (c == '\r') 
        { //prefix characher:to use font_table2
            if ( (c = ((BYTE *)str)[iStrLoc])=='\0' )
                break;
            
            iStrLoc++;
            if ((pFont = get_font_entry(1,c))==NULL) continue;
        }

#if defined(NEWSTYLE_WINDOW)||defined(NEW_STYLE_SETUP)  || defined(SUPPORT_REP_READ) //maoyong add 0915
        else if(c == '\a')
        {
            if ( (c=((BYTE *)str)[iStrLoc])=='\0' ) break;
            
            iStrLoc++;

            if ((pFont = get_font_entry(3,c))==NULL) continue;

        }
#endif 
		else if(c>='a' && c<='z')
			pFont=get_font_entry(0,c-'a'+0xc0);
	    else
	        //get current char entry
	        pFont = get_font_entry(0,c);

   
        //start to process
        pos = 3;
        //get font information
        iFontWidth = (int)pFont[0];
        iFontHigh = (int)pFont[1];

        if(p_scan==0)
          iFontHigh>>=1;
          
        //start to draw        
        for (j=0; j<iFontHigh; j++) 
        {
            //For every string line = 1 blank line(in pixel) + OSD_FONT_HEIGHT-line strings + 1 blank line
            //draw top line
            for (i=0; i<iFontWidth/2; i++) 
            {
                BYTE c;
                c=pFont[pos+i/4];
                pixel8 = pTopLine[iDispLoc+i];//zhao add 2004-2-27 14:41
	          	
	          	switch(i%4)
          	   	{
          	   	case 0:
				    curByte=(c&0xc0)>>6;
				    break;
			    case 1:
				    curByte=(c&0x30)>>4;
	                break;
	            case 2:	
	                curByte=(c&0x0c)>>2;
              		break;
              	case 3:	
              		curByte=(c&0x03);
              		break;
          		}
          	
                for (k=0; k<2; k++) 
                {
	                if ( (1<<k) & curByte ) 
	                    pixel8 = (pixel8 & (~( 0x0f<<k*4))) |(fontColor<<(k*4));//zhao add 2004-2-27 14:41
	                else 
	                {
	                    if(bkColor != 0)//if color index is 0, no need to change the vlaue fo pixel8
	                    pixel8 = (pixel8 & (~( 0x0f<<k*4))) | (bkColor<<(k*4));//zhao add 2004-2-27 14:41
	                }

⌨️ 快捷键说明

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