/***** rmheader.c This program takes as input a rff image file, removes the header, and writes to a file the image pixel values as bytes. Usage: rmheader Log: Jan-24-91 mcdonald created To compile: cc rmheader.c rff.o -o rmheader -lpixrect *****/ #include #include main(argc,argv) int argc; char **argv; { struct pixrect *screen,*read_image(); colormap_t colormap; long *image,*new_image; FILE *in=stdin,*out,*fopen(); int x,y,new_y,dx,dy; if (argc<3) { fprintf(stderr,"usage: rmheader \n"); exit(1); } if ((in = fopen(argv[1],"r"))==NULL) { fprintf(stderr,"%s: Unable to open %s as input file\n",argv[0],argv[1]); exit(1); } out = fopen(argv[2],"w"); screen = read_image(in,&colormap); dx = screen -> pr_size.x; dy = screen -> pr_size.y; image = (long *)malloc(dx * dy * sizeof(long)); load_rff_image(screen,image); pr_close(screen); for (y=0;y