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.16 by greg, Fri Jan 7 20:33:02 2005 UTC vs.
Revision 3.17 by greg, Fri Jan 7 21:41:06 2005 UTC

# Line 22 | Line 22 | static const char      RCSid[] = "$Id$";
22   struct tmPackage        *tmPkg[TM_MAXPKG];
23   int     tmNumPkgs = 0;                  /* number of registered packages */
24  
25 int     tmLastError;                    /* last error incurred by library */
26 char    *tmLastFunction;                /* error-generating function name */
25  
28
26   TMstruct *
27   tmInit(                                 /* initialize new tone mapping */
28   int     flags,
# Line 78 | Line 75 | double gamval
75                                                  /* zero private data */
76          for (i = TM_MAXPKG; i--; )
77                  tmnew->pd[i] = NULL;
78 +        tmnew->lastError = TM_E_OK;
79 +        tmnew->lastFunc = "NoErr";
80                                                  /* return new TMstruct */
81          return(tmnew);
82   }
# Line 90 | Line 89 | RGBPRIMP       pri,
89   double  sf
90   )
91   {
92 <        static char     funcName[] = "tmSetSpace";
92 >        static const char funcName[] = "tmSetSpace";
93          int     i, j;
94                                                  /* error check */
95          if (tms == NULL)
# Line 167 | Line 166 | COLOR  *scan,
166   int     len
167   )
168   {
169 <        static char     funcName[] = "tmCvColors";
169 >        static const char funcName[] = "tmCvColors";
170          static COLOR    csmall = {.5*MINLUM, .5*MINLUM, .5*MINLUM};
171          COLOR   cmon;
172          double  lum, slum;
# Line 245 | Line 244 | float  *scan,
244   int     len
245   )
246   {
247 <        static char     funcName[] = "tmCvGrays";
247 >        static const char funcName[] = "tmCvGrays";
248          double  d;
249          int     i;
250  
# Line 272 | Line 271 | int    len,
271   int     wt
272   )
273   {
274 <        static char     funcName[] = "tmAddHisto";
274 >        static const char funcName[] = "tmAddHisto";
275          int     oldorig=0, oldlen, horig, hlen;
276          int     i, j;
277  
# Line 375 | Line 374 | double expmult,
374   double  gamval
375   )
376   {
377 <        static char     funcName[] = "tmFixedMapping";
377 >        static const char funcName[] = "tmFixedMapping";
378          double          d;
379          int     i;
380          
# Line 402 | Line 401 | double Lddyn,
401   double  Ldmax
402   )
403   {
404 <        static char     funcName[] = "tmComputeMapping";
404 >        static const char funcName[] = "tmComputeMapping";
405          int     *histo;
406          float   *cumf;
407          int     brt0, histlen, threshold, ceiling, trimmings;
# Line 510 | Line 509 | BYTE   *cs,
509   int     len
510   )
511   {
512 <        static char     funcName[] = "tmMapPixels";
512 >        static const char funcName[] = "tmMapPixels";
513          int32   li, pv;
514  
515          if (tms == NULL || tms->lumap == NULL)
# Line 622 | Line 621 | tmMkMesofact()                         /* build mesopic lookup factor table
621  
622   int
623   tmErrorReturn(                          /* error return (with message) */
624 < char    *func,
624 > const char      *func,
625   TMstruct        *tms,
626   int     err
627   )
628   {
629 <        tmLastFunction = func;
630 <        tmLastError = err;
631 <        if (tms != NULL && tms->flags & TM_F_NOSTDERR)
632 <                return(err);
629 >        if (tms != NULL) {
630 >                tms->lastFunc = func;
631 >                tms->lastError = err;
632 >                if (tms->flags & TM_F_NOSTDERR)
633 >                        return(err);
634 >        }
635          fputs(func, stderr);
636          fputs(": ", stderr);
637          fputs(tmErrorMessage[err], stderr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines