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

Comparing ray/src/common/tonemap.c (file contents):
Revision 3.32 by greg, Thu Jul 3 03:35:10 2008 UTC vs.
Revision 3.33 by greg, Mon Feb 9 20:23:51 2009 UTC

# Line 419 | Line 419 | double La
419   }
420  
421  
422 static int
423 tmNewMap(                       /* allocate new tone-mapping array */
424 TMstruct        *tms
425 )
426 {
427        if (tms->lumap != NULL && (tms->mbrmax - tms->mbrmin) !=
428                                        (tms->hbrmax - tms->hbrmin)) {
429                free((MEM_PTR)tms->lumap);
430                tms->lumap = NULL;
431        }
432        tms->mbrmin = tms->hbrmin;
433        tms->mbrmax = tms->hbrmax;
434        if (tms->mbrmin > tms->mbrmax)
435                return 0;
436        if (tms->lumap == NULL)
437                tms->lumap = (unsigned short *)malloc(sizeof(unsigned short)*
438                                        (tms->mbrmax-tms->mbrmin+1));
439        return(tms->lumap != NULL);
440 }
441
442
422   int
423   tmFixedMapping(                 /* compute fixed, linear tone-mapping */
424   TMstruct        *tms,
# Line 615 | Line 594 | int    len
594   }
595  
596  
618
619
597   TMstruct *
598   tmDup(                          /* duplicate top tone mapping */
599   TMstruct        *tms
# Line 691 | Line 668 | tmMkMesofact()                         /* build mesopic lookup factor table
668                  tmMesofact[i-BMESLOWER] = 256. *
669                                  (tmLuminance(i) - LMESLOWER) /
670                                  (LMESUPPER - LMESLOWER);
671 + }
672 +
673 +
674 + int
675 + tmNewMap(                       /* allocate new tone-mapping array */
676 + TMstruct        *tms
677 + )
678 + {
679 +        if (tms->lumap != NULL && (tms->mbrmax - tms->mbrmin) !=
680 +                                        (tms->hbrmax - tms->hbrmin)) {
681 +                free((MEM_PTR)tms->lumap);
682 +                tms->lumap = NULL;
683 +        }
684 +        tms->mbrmin = tms->hbrmin;
685 +        tms->mbrmax = tms->hbrmax;
686 +        if (tms->mbrmin > tms->mbrmax)
687 +                return 0;
688 +        if (tms->lumap == NULL)
689 +                tms->lumap = (unsigned short *)malloc(sizeof(unsigned short)*
690 +                                        (tms->mbrmax-tms->mbrmin+1));
691 +        return(tms->lumap != NULL);
692   }
693  
694  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines