ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/scan.c
Revision: 1.4
Committed: Sat Feb 22 02:07:28 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 1.3: +1 -4 lines
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id$";
3 #endif
4 /*
5 * writescan.c - fortran interface to picture output routines.
6 *
7 * 4/26/88
8 */
9
10 #include <stdio.h>
11
12
13 static FILE *outfp; /* output file pointer */
14 static char outfile[128]; /* output file name */
15
16
17 initscan_(fname, width, height) /* initialize output file */
18 char *fname;
19 int *width, *height;
20 {
21 extern char *strcpy();
22
23 if (fname == NULL || fname[0] == '\0') {
24 outfp = stdout;
25 strcpy(outfile, "<stdout>");
26 } else {
27 if ((outfp = fopen(fname, "w")) == NULL) {
28 perror(fname);
29 exit(1);
30 }
31 strcpy(outfile, fname);
32 }
33 fprintf(outfp, "%dx%d picture\n\n-Y %d +X %d\n",
34 *width, *height, *height, *width);
35 }
36
37
38 writescan_(scan, width) /* output scanline */
39 float *scan;
40 int *width;
41 {
42 if (fwritescan(scan, *width, outfp) < 0) {
43 perror(outfile);
44 exit(1);
45 }
46 }
47
48
49 donescan_() /* clean up */
50 {
51 if (fclose(outfp) < 0) {
52 perror(outfile);
53 exit(1);
54 }
55 }