/* demoras.c: This demo demonstrates how to read/save pbm files using pbm.c routines. Created by: Hai Pham and Don Quon */ #include #include #include "pbm.h" int main(void){ long i,j; long *finalimage; long *image; long *image2; int dx,dy; int dx2,dy2; char infilename[60]; char outfilename[60]; printf("enter input filename: "); scanf("%s",infilename); printf("enter output filename: "); scanf("%s",outfilename); /* read in the image */ readpbm(infilename,&image,&dx,&dy); /*allocate memory for new image*/ finalimage=(long *)malloc(dx*dy*sizeof(long)); if (finalimage==NULL){ printf("error allocating memory\n"); return 0; }/* end if*/ /* copy old image into new image */ for (i=0;i