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

Comparing ray/src/px/ra_pr24.c (file contents):
Revision 1.3 by greg, Sat Oct 20 11:41:29 1990 UTC vs.
Revision 1.5 by greg, Thu Apr 18 14:35:40 1991 UTC

# Line 75 | Line 75 | char  *argv[];
75                          quiterr("incompatible format");
76                                          /* put header */
77                  printargs(i, argv, stdout);
78 +                fputformat(COLRFMT, stdout);
79                  putchar('\n');
80                  fputresolu(YMAJOR|YDECR, xmax, ymax, stdout);
81                                          /* convert file */
82                  pr2ra();
83          } else {
84 <                                        /* discard input header */
85 <                getheader(stdin, NULL);
86 <                                        /* get resolution */
87 <                if (fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR))
87 <                        quiterr("bad picture size");
84 >                                        /* get header info. */
85 >                if (checkheader(stdin, COLRFMT, NULL) < 0 ||
86 >                        fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR))
87 >                        quiterr("bad picture format");
88                                          /* write rasterfile header */
89                  head.ras_magic = RAS_MAGIC;
90                  head.ras_width = xmax;
# Line 129 | Line 129 | pr2ra()                        /* convert 24-bit scanlines to Radiance pict
129                                                  /* convert image */
130          for (y = ymax-1; y >= 0; y--) {
131                  for (x = 0; x < xmax; x++) {
132                        scanout[x][RED] = getc(stdin);
133                        scanout[x][GRN] = getc(stdin);
132                          scanout[x][BLU] = getc(stdin);
133 +                        scanout[x][GRN] = getc(stdin);
134 +                        scanout[x][RED] = getc(stdin);
135                  }
136                  if (feof(stdin) || ferror(stdin))
137                          quiterr("error reading rasterfile");
# Line 159 | Line 159 | ra2pr()                        /* convert Radiance scanlines to 24-bit rast
159                          quiterr("error reading Radiance picture");
160                  colrs_gambs(scanin, xmax);
161                  for (x = 0; x < xmax; x++) {
162                        putc(scanin[x][RED], stdout);
163                        putc(scanin[x][GRN], stdout);
162                          putc(scanin[x][BLU], stdout);
163 +                        putc(scanin[x][GRN], stdout);
164 +                        putc(scanin[x][RED], stdout);
165                  }
166                  if (ferror(stdout))
167                          quiterr("error writing rasterfile");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines