河海大学计算机与信息学院——DSP课程设计报告 getw(fp); y=yl-1; for(sp=st,n=0;n0x80) { len=(*sp++) & 0x7f; if(!(*sp)) { x+=len; continue; } setcolor(*sp++); moveto(x,y); linerel(len,0); x+=len; continue; } else { len=*sp++; for(j=0;j #define MODEPHOTO1 1 #define MODEPHOTO2 2 #define GRAYBARLEVEL 16 void ReadImage(unsigned char*pImage,char*cFileName,int nWidth,int nHeight); 14 河海大学计算机与信息学院——DSP课程设计报告 void InitImage(unsigned int nMode,unsigned char*pImage,int nWidth,int nHeight) { swich(nMode) { case MODEPHOTO1: Readimage(pImage,\ break; case MODEPHOTO2: ReadImage(pImage,\ break; default: break; } } void ReadImage(unsigned char*cFileName,int nWidth,int nHeight) { int j; unsigned char*pWork; FILE*fp; if(fp=fopen(cFileName,\ { fseek(fp,1078L,SEEK_SET); pWork=pImage+(nHeight-1)*nWidth; for(j=0;j