/******************************************* * Copyright (C) 1990 by Christopher R. Wren and * the Massachusetts Institute of Technology * * COMMERCIAL DISCLAIMER: * * This software is intended for research purposes only and contains * unlicensed software, in original and modified forms, from various * sources including the Free Software Foundation. These programs * shall not be used, rewritten, or adapted as the basis of a * commercial software or hardware product without first obtaining * appropriate licenses from the owners of the original software * copyrights. * * In the case of copyrighted software fragments obtained from the * Free Software Foundation: you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as * published by the Free Software Foundation. This software is * distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General * Public License for more details. You should have received a copy * of the GNU Library General Public License and the GNU General * Public License along with this software; if not, write to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * Developed by Christopher R. Wren at the * Media Laboratory, MIT, Cambridge, Massachusetts. * *******************************************/ #include #include #include #include int next_char(FILE *datafile, char *c) { static char buf[1000]; static int n = 0; static int idx = 0; if (idx == n) { n = fread(buf,sizeof(char),1000,datafile); if (n) { idx = 0; } else { *c = 0; fprintf(stderr,"Unexpected end of file\n"); return (0); } } *c = buf[idx++]; return (1); } main(argc,argv) int argc; char *argv[]; { int width; int height; // float xupper; float xlower; float yupper; float ylower; int x,y,i; int RESO; FILE *datafile, *fopen(); char t,t1,type(); if (!strcmp(argv[1],"-")) { datafile = stdin; } else { datafile = fopen(argv[1],"r"); } fscanf(datafile, "%f%f%f%f%d%d%d", &xupper, &ylower, &xupper, &yupper, &width, &height, &RESO); printf("Plotting %dx%d image at res=%d\n",width, height, RESO); init_display(&argc,argv,width,height,RESO); { char c; for(y=0;y