資源簡介
YUV圖像OSD字幕信息疊加功能

代碼片段和文件信息
#include
#include?“TimeNewRoman.h“
#define??TNR????0x00???????//Time?New?Roman.
#define??ST??????0x01???????//Song?Ti.
#define??FST????0x02???????//?Fang?Song?Ti.
#define??YY??????0x03??????//?You?Yuan.
char?OsdY?=?0;
char?OsdU?=?0;
char?OsdV?=?0;
char?*currentENFront;
char?OSDCharYUV422(int?column?int?row?int?imageWidth?int?imageHeight?char?ascii??char?*buffer)????//column?列?row?行
{
{
?????int??MapAddress?=?0;
?????int??pixelCount????=?0;
?????int??charHeight???=?0;
?????int??charWidth?????=?0;
?????int??multiple????????=?0;
?????int??indexij;
?????char?*frontBuffer;
?
?ascii?-=?0x20;
?charHeight???=?currentENFront[7];
?charWidth????=?currentENFront[ascii*4+9];
?MapAddress?=?currentENFront[ascii*4+10]+currentENFront[ascii*4+11]*256;
?frontBuffer?=?¤tENFront[MapAddress];
????????multiple?=?(charWidth-1)/8+1;
????????if(((imageWidth-column) ??????????return?-1;
?
?for(index?=?0;?index?????????{
???????????pixelCount?=?0;
??
????for(j=0;j<(multiple-1);j++)
???????for(i=0;i<8;i++)
??????????????{
?????????????????if((frontBuffer[index*multiple+j]&(0x80>>i))?!=?0x00)
?????????????????{
??????????????????????buffer[((index+row)*imageWidth+column+pixelCount)*2]?=?OsdU;
?buffer[((index+row)*imageWidth+column+pixelCount)*2+1]?=?OsdY; ?
?????????????????}
???????????????
????pixelCount++;?
??????????????}
???
????for(i=0;i<(charWidth-(multiple-1)*8);i++)
???????????{
??????????????if((frontBuffer[index*multiple+j]&(0x80>>i))?!=?0x00)
?????????????{
?????????????????buffer[((index+row)*imageWidth+column+pixelCount)*2]?=?OsdU;
??????????buffer[((index+row)*imageWidth+column+pixelCount)*2+1]?=?OsdY;
?????????????}
????????????????pixelCount++;?
????}
}
?return?0;
}
???
/*******************************************************************************
*?Function?Name??:?FrontSetup
*?Description????:?Setup?a?Front?LIB?on?OSD.
*?Input??????????:?-?FontID:?This?parameter?can?be?one?of?the?following?values:
*????????????????????:
*?Output?????????:?None
*?Return?????????:?None
*******************************************************************************/
void?FrontSetup(char?FontID)
{
??switch(FontID)
??{
????case?TNR:?????//Time?New?Roman.
????????currentENFront?=?(char?*)TimeNewRoman;?
?break;
case?ST:??????//Song?Ti.
?????//CurrentCHFront?=?ASCII_chinese_Table;
?break;
case?FST: ?//?Fang?Song?Ti.
?????
?break;
case?YY: ?//?You?Yuan.
?????
?break;?
??}??
}??
void?OSDSetTextColor(char?OsdR?char?OsdG?char?OsdB)
{
?????OsdY?=?0.25*OsdR+0.504*OsdG+0.098*OsdB+16;
?????OsdU?=?-0.148*OsdR-0.291*OsdG+0.439*OsdB+128;
?????OsdV?=?0.439*OsdR-0.368*OsdG-0.071*OsdB+128;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2739??2009-09-14?16:26??YUV圖像OSD字幕信息疊加功能\Osdchar.c
?????文件???????4150??2009-09-14?16:29??YUV圖像OSD字幕信息疊加功能\Signal.c
?????文件??????16781??2009-03-09?17:05??YUV圖像OSD字幕信息疊加功能\TimeNewRoman.h
?????文件??????22016??2009-09-14?16:35??YUV圖像OSD字幕信息疊加功能\YUV圖像OSD字幕信息疊加功能說明.doc
?????文件?????267616??2002-09-16?11:02??YUV圖像OSD字幕信息疊加功能\字摸提取工具\HZK16.dat
?????文件??????69632??2005-11-01?15:04??YUV圖像OSD字幕信息疊加功能\字摸提取工具\字模.exe
?????目錄??????????0??2009-09-14?16:36??YUV圖像OSD字幕信息疊加功能\字摸提取工具
?????目錄??????????0??2009-09-15?16:16??YUV圖像OSD字幕信息疊加功能
-----------?---------??----------?-----??----
???????????????382934????????????????????8
- 上一篇:ListView中Spinner的使用
- 下一篇:華為pcb設計規(guī)范
評論
共有 條評論