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

Comparing ray/src/px/ra_pr.c (file contents):
Revision 1.8 by greg, Mon Mar 12 15:14:40 1990 UTC vs.
Revision 1.10 by greg, Thu Apr 18 14:35:38 1991 UTC

# Line 114 | Line 114 | char  *argv[];
114                          quiterr("incompatible format");
115                                          /* put header */
116                  printargs(i, argv, stdout);
117 +                fputformat(COLRFMT, stdout);
118                  putchar('\n');
119                  fputresolu(YMAJOR|YDECR, xmax, ymax, stdout);
120                                          /* convert file */
# Line 185 | Line 186 | register struct rasterfile  *h;
186                  p->fp = stdin;
187          else if ((p->fp = fopen(fname, "r")) == NULL)
188                  return(NULL);
189 <                                        /* discard header */
190 <        getheader(p->fp, NULL);
191 <        if (fgetresolu(&xmax, &ymax, p->fp) != (YMAJOR|YDECR))
192 <                quiterr("bad picture size");
189 >                                        /* check header */
190 >        if (checkheader(p->fp, COLRFMT, NULL) < 0 ||
191 >                        fgetresolu(&xmax, &ymax, p->fp) != (YMAJOR|YDECR))
192 >                quiterr("bad picture format");
193          p->nexty = 0;
194          p->bytes_line = 0;              /* variable length lines */
195          p->pos.y = (long *)ecalloc(ymax, sizeof(long));
# Line 349 | Line 350 | colormap  map;
350          register int  i, val;
351  
352          for (i = 0; i < 256; i++) {
353 <                val = pow(i/256.0, 1.0/gamma) * 256.0;
353 >                val = pow((i+0.5)/256.0, 1.0/gamma) * 256.0;
354                  map[0][i] = map[1][i] = map[2][i] = val;
355          }
356   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines