ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_avs.c
(Generate patch)

Comparing ray/src/px/ra_avs.c (file contents):
Revision 2.4 by greg, Mon Jul 12 12:41:13 1993 UTC vs.
Revision 2.8 by greg, Sun Feb 27 10:17:30 1994 UTC

# Line 65 | Line 65 | char  *argv[];
65                  exit(1);
66          }
67          if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) {
68 <                fprintf(stderr, "can't open output \"%s\"\n",
68 >                fprintf(stderr, "%s: can't open output \"%s\"\n",
69                                  progname, argv[i+1]);
70                  exit(1);
71          }
# Line 78 | Line 78 | char  *argv[];
78                                          /* get their image resolution */
79                  xmax = getint(4, stdin);
80                  ymax = getint(4, stdin);
81 +                if (feof(stdin))
82 +                        quiterr("empty input file");
83                                          /* put our header */
84 +                newheader("RADIANCE", stdout);
85                  printargs(i, argv, stdout);
86                  fputformat(COLRFMT, stdout);
87                  putchar('\n');
# Line 127 | Line 130 | avs2ra()               /* convert 24-bit scanlines to Radiance pict
130                  quiterr("out of memory in avs2ra");
131                                                  /* convert image */
132          for (y = ymax-1; y >= 0; y--) {
133 <                (void)getc(stdin);                      /* toss alpha */
134 <                scanout[x][RED] = getc(stdin);
135 <                scanout[x][GRN] = getc(stdin);
136 <                scanout[x][BLU] = getc(stdin);
137 <                if (feof(stdin) || ferror(stdin))
133 >                for (x = 0; x < xmax; x++) {
134 >                        (void)getc(stdin);                      /* toss alpha */
135 >                        scanout[x][RED] = getc(stdin);
136 >                        scanout[x][GRN] = getc(stdin);
137 >                        scanout[x][BLU] = getc(stdin);
138 >                }
139 >                if (feof(stdin) | ferror(stdin))
140                          quiterr("error reading AVS image");
141                                                  /* undo gamma */
142                  gambs_colrs(scanout, xmax);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines