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

Comparing ray/src/px/ra_t8.c (file contents):
Revision 1.4 by greg, Thu Jan 18 23:58:24 1990 UTC vs.
Revision 1.8 by greg, Wed Nov 7 13:10:33 1990 UTC

# Line 59 | Line 59 | char  *progname;
59  
60   char  errmsg[128];
61  
62 < COLR    *inline;
62 > COLR    *inl;
63  
64   pixel   *tarData;
65  
# Line 124 | Line 124 | char  *argv[];
124                          quiterr(errmsg);
125                  }
126                                          /* put header */
127 <                printargs(argc, argv, stdout);
127 >                printargs(i, argv, stdout);
128                  putchar('\n');
129                  fputresolu(YMAJOR|YDECR, xmax, ymax, stdout);
130                                          /* convert file */
# Line 304 | Line 304 | register struct hdStruct  *h;
304          h->dataBits = 8;
305          h->imType = 0;
306                                          /* allocate scanline */
307 <        inline = (COLR *)emalloc(xmax*sizeof(COLR));
307 >        inl = (COLR *)emalloc(xmax*sizeof(COLR));
308                                          /* allocate targa data */
309          tarData = taralloc(h);
310  
# Line 368 | Line 368 | register rgbpixel  *l3;
368                  if (inpic->bytes_line == 0) {
369                          if (inpic->pos.y[y] == 0) {
370                                  while (inpic->nexty < y) {
371 <                                        if (freadcolrs(inline, xmax, inpic->fp) < 0)
371 >                                        if (freadcolrs(inl, xmax, inpic->fp) < 0)
372                                                  quiterr("read error in picreadline3");
373                                          inpic->pos.y[++inpic->nexty] = ftell(inpic->fp);
374                                  }
# Line 378 | Line 378 | register rgbpixel  *l3;
378                          quiterr("seek error in picreadline3");
379          } else if (inpic->bytes_line == 0 && inpic->pos.y[inpic->nexty] == 0)
380                  inpic->pos.y[inpic->nexty] = ftell(inpic->fp);
381 <        if (freadcolrs(inline, xmax, inpic->fp) < 0)    /* read scanline */
381 >        if (freadcolrs(inl, xmax, inpic->fp) < 0)       /* read scanline */
382                  quiterr("read error in picreadline3");
383          inpic->nexty = y+1;
384                                                          /* convert scanline */
385 <        normcolrs(inline, xmax);
385 >        normcolrs(inl, xmax, 0);
386          for (i = 0; i < xmax; i++) {
387 <                l3[i].r = inline[i][RED];
388 <                l3[i].g = inline[i][GRN];
389 <                l3[i].b = inline[i][BLU];
387 >                l3[i].r = inl[i][RED];
388 >                l3[i].g = inl[i][GRN];
389 >                l3[i].b = inl[i][BLU];
390          }
391   }
392  
# Line 465 | Line 465 | colormap  map;
465          register int  i, val;
466  
467          for (i = 0; i < 256; i++) {
468 <                val = pow(i/256.0, 1.0/gamma) * 256.0;
468 >                val = pow((i+0.5)/256.0, 1.0/gamma) * 256.0;
469                  map[0][i] = map[1][i] = map[2][i] = val;
470          }
471   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines