本文中的代码是根据《朱有鹏老师海思项目》中提取出的代码,如有侵权请及时告知。
函数中的注释根据这幅图片来理解
/******************************************************************************
* 函数名称: HH_OSD_DrawBitmapBit(hzPos, bitmap, fColor, bColor, bmpBuffer, fontSize)
* 功能描述: 将汉字的点阵转换为bmp写入缓冲区
* 其他说明:
*******************************************************************************/
int HI_OSD_DrawBitmapBit(int x_pos, HI_U8* bitmap, HI_U16 fColor,
HI_U16 bColor, HI_U16 edgeColor, HI_U8 *bmpBuffer, HI_U16 bmpWidth,
HI_U16 fontSize)
{
int i, j;
int w, h;
int startTop = 0;
unsigned char *pBuf = bmpBuffer;
unsigned short *pData = NULL;
unsigned char index;
int charwidth = 2;
int lineWidth = bmpWidth <<