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.3 by greg, Tue Sep 12 13:04:34 1989 UTC vs.
Revision 1.4 by greg, Fri Oct 20 20:36:04 1989 UTC

# Line 271 | Line 271 | picreadline3(y, l3)                    /* read in 3-byte scanline */
271   int  y;
272   register rgbpixel  *l3;
273   {
274 <        register BYTE   *l4;
275 <        register int    shift, c;
276 <        int     i;
274 >        register int    i;
275  
276 <        if (inpic->nexty != y) {                                /* find scanline */
276 >        if (inpic->nexty != y) {                        /* find scanline */
277                  if (inpic->bytes_line == 0) {
278                          if (inpic->pos.y[y] == 0) {
279                                  while (inpic->nexty < y) {
# Line 293 | Line 291 | register rgbpixel  *l3;
291                  quiterr("read error in picreadline3");
292          inpic->nexty = y+1;
293                                                          /* convert scanline */
294 <        for (l4=inline[0], i=xmax; i--; l4+=4, l3++) {
295 <                shift = l4[EXP] - COLXS;
296 <                if (shift >= 8) {
297 <                        l3->r = l3->g = l3->b = 255;
298 <                } else if (shift <= -8) {
301 <                        l3->r = l3->g = l3->b = 0;
302 <                } else if (shift > 0) {
303 <                        c = l4[RED] << shift;
304 <                        l3->r = c > 255 ? 255 : c;
305 <                        c = l4[GRN] << shift;
306 <                        l3->g = c > 255 ? 255 : c;
307 <                        c = l4[BLU] << shift;
308 <                        l3->b = c > 255 ? 255 : c;
309 <                } else if (shift < 0) {
310 <                        l3->r = l4[RED] >> -shift;
311 <                        l3->g = l4[GRN] >> -shift;
312 <                        l3->b = l4[BLU] >> -shift;
313 <                } else {
314 <                        l3->r = l4[RED];
315 <                        l3->g = l4[GRN];
316 <                        l3->b = l4[BLU];
317 <                }
294 >        normcolrs(inline, xmax);
295 >        for (i = 0; i < xmax; i++) {
296 >                l3[i].r = inline[i][RED];
297 >                l3[i].g = inline[i][GRN];
298 >                l3[i].b = inline[i][BLU];
299          }
300   }
301  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines