资源简介
均值滤波的C语言程序
代码片段和文件信息
#include
using namespace std;
#include
#include
#include “windows.h“
#include
unsigned char *pBmpBuf;
int bmpWidth;
int bmpHeight;
RGBQUAD *pColorTable;
int biBitCount;
int k;
bool readBmp(char *bmpName)
{
FILE *fp=fopen (bmpName“rb“);
if (fp==0)
return 0;
fseek(fpsizeof(BITMAPFILEHEADER)0);
BITMAPINFOHEADER head;
fread(&headsizeof(BITMAPINFOHEADER)1fp);
bmpWidth=head.biWidth;
bmpHeight=head.biHeight;
biBitCount=head.biBitCount;
int lineByte=(bmpWidth*biBitCount/8+3)/4*4;
if(biBitCount==8)
{
pColorTable=new RGBQUAD[256];
fread(pColorTablesizeof(RGBQUAD)256fp);
}
/*
if (biBitCount==24)
{
pColorTable=NULL;
}*/
pBmpBuf=new unsigned char [lineByte*bmpHeight];
fread(pBmpBu
- 上一篇:日程表管理 c语言
- 下一篇:提取、替换RPG游戏中图片的工具——RPGViewer
评论
共有 条评论