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

Comparing ray/src/util/radcompare.c (file contents):
Revision 2.21 by greg, Thu Aug 15 17:28:45 2019 UTC vs.
Revision 2.24 by greg, Tue Jun 30 22:53:05 2020 UTC

# Line 224 | Line 224 | color_check(COLOR c1, COLOR c2)
224   static int
225   norm_check(FVECT nv1, FVECT nv2)
226   {
227 <        double  max2 = nv1[2]*nv1[2];
227 >        double  max2 = nv1[2]*nv2[2];
228          int     imax = 2;
229          int     i = 2;
230                                          /* identify largest component */
231          while (i--) {
232 <                double  tm2 = nv1[i]*nv1[i];
232 >                double  tm2 = nv1[i]*nv2[i];
233                  if (tm2 > max2) {
234                          imax = i;
235                          max2 = tm2;
# Line 317 | Line 317 | equiv_string(char *s1, char *s2)
317   static int
318   setheadvar(char *val, void *p)
319   {
320 +        char    newval[128];
321          LUTAB   *htp = (LUTAB *)p;
322          LUENT   *tep;
323          char    *key;
# Line 359 | Line 360 | setheadvar(char *val, void *p)
360                  return(-1);     /* memory allocation error */
361          if (!tep->key)
362                  tep->key = strcpy(malloc(kln+1), key);
363 <        if (tep->data)
363 >        if (tep->data) {        /* check for special cases */
364 >                if (!strcmp(key, "EXPOSURE")) {
365 >                        sprintf(newval, "%f", atof(tep->data)*atof(val));
366 >                        vln = strlen(val = newval);
367 >                }
368                  free(tep->data);
369 +        }
370          tep->data = strcpy(malloc(vln+1), val);
371          return(1);
372   }
# Line 696 | Line 702 | set_refdepth(DEPTHCODEC *dcp, LUTAB *htp)
702          static char     depthvar[] = DEPTHSTR;
703          const char      *drval;
704  
705 <        depthvar[LDEPTHSTR] = '\0';
705 >        depthvar[LDEPTHSTR-1] = '\0';
706          drval = (const char *)lu_find(htp, depthvar)->data;
707          if (!drval)
708                  return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines