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

Comparing ray/src/px/pvalue.c (file contents):
Revision 2.34 by greg, Thu Aug 2 18:33:46 2018 UTC vs.
Revision 2.35 by greg, Mon Jul 15 22:39:50 2019 UTC

# Line 419 | Line 419 | checkhead(                             /* deal with line from header */
419   static void
420   pixtoval(void)                          /* convert picture to values */
421   {
422 <        register COLOR  *scanln;
422 >        COLOR   *scanln;
423          int  dogamma;
424          COLOR  lastc;
425          RREAL  hv[2];
426          int  startprim, endprim;
427          long  startpos;
428 <        int  y;
429 <        register int  x;
428 >        int  x, y;
429  
430          scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR));
431          if (scanln == NULL) {
# Line 493 | Line 492 | pixtoval(void)                         /* convert picture to values */
492   static void
493   valtopix(void)                  /* convert values to a pixel file */
494   {
495 <        int  dogamma;
496 <        register COLOR  *scanln;
497 <        int  y;
498 <        register int  x;
495 >        int     dogamma;
496 >        COLOR   *scanln;
497 >        COLR    rgbe;
498 >        int     x, y;
499  
500          scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR));
501          if (scanln == NULL) {
# Line 525 | Line 524 | valtopix(void)                 /* convert values to a pixel file */
524                                          pow(colval(scanln[x],BLU), gamcor));
525                          if (doexposure)
526                                  multcolor(scanln[x], exposure);
527 +                        if (uniq) {             /* uncompressed? */
528 +                                setcolr(rgbe,   scanln[x][RED],
529 +                                                scanln[x][GRN],
530 +                                                scanln[x][BLU]);
531 +                                if (putbinary(rgbe, sizeof(COLR), 1, stdout) != 1)
532 +                                        goto writerr;
533 +                        }
534                  }
535 <                if (fwritescan(scanln, scanlen(&picres), stdout) < 0) {
536 <                        fprintf(stderr, "%s: write error\n", progname);
537 <                        quit(1);
532 <                }
535 >                                                /* write scan if compressed */
536 >                if (!uniq && fwritescan(scanln, scanlen(&picres), stdout) < 0)
537 >                        goto writerr;
538          }
539          free((void *)scanln);
540 +        return;
541 + writerr:
542 +        fprintf(stderr, "%s: write error\n", progname);
543 +        quit(1);
544   }
545  
546  
# Line 939 | Line 948 | putbbyte(                      /* put a byte brightness to stdout */
948          COLOR  col
949   )
950   {
951 <        register int  i;
951 >        int  i;
952          uby8  vb;
953  
954          i = (*mybright)(col)*256.;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines