吾现在有一个一维数组,试图转换为bit。
数组为14x14:
static char word_bitmap[] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
转换为bit数组14x2:
//picth 为一行的字节数
static char* byteToBit(char* pBuffer, int w, int h, int pitch)
{
int i=0;
int j=0;
int size = h * pitch;
char* bits = (char*)malloc(size);
memset(bits, 0, size);
char* pRaw = bits;
for (i=0; i
关注
打赏
热门博文
- 历史最高名次:17
- 日常收集的妙语
- git更新:Your local changes to the following files would be overwritten by merge
- Github通过PR提交代码到开源库
- Github参与OpenJDK8的开发指南
- FreeType可以指定斜体值了!祝贺修改代码整合进入FreeType
- JDK/FreeType中关于斜的英文有哪些
- WINDOWS编译ffmpeg:LINK : fatal error LNK1104: 无法打开文件“LIBCMT.lib”
- 全网首发:编译ffmpeg: error: ‘VFW_E_NOT_FOUND‘ undeclared ; did you mean ‘NTE_NOT_FOUND‘?
- WINDOWS+VS2012+msys2编译ffmpeg成功,DLL不能用