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

Comparing ray/src/cv/bsdf2ttree.c (file contents):
Revision 2.40 by greg, Fri Feb 17 22:31:49 2017 UTC vs.
Revision 2.41 by greg, Wed May 31 17:25:21 2017 UTC

# Line 19 | Line 19 | static const char RCSid[] = "$Id$";
19   #include "bsdfrep.h"
20                                  /* global argv[0] */
21   char                    *progname;
22 +                                /* reciprocity averaging option */
23 + static const char       *recip = " -a";
24                                  /* percentage to cull (<0 to turn off) */
25   static double           pctcull = 90.;
26                                  /* sampling order */
# Line 135 | Line 137 | eval_isotropic(char *funame)
137          float           bsdf, uv[2];
138  
139          if (pctcull >= 0) {
140 <                sprintf(cmd, "rttree_reduce -a -h -ff -r 3 -t %f -g %d > %s",
141 <                                pctcull, samp_order, create_component_file(0));
140 >                sprintf(cmd, "rttree_reduce%s -h -ff -r 3 -t %f -g %d > %s",
141 >                                recip, pctcull, samp_order, create_component_file(0));
142                  ofp = popen(cmd, "w");
143                  if (ofp == NULL) {
144                          fprintf(stderr, "%s: cannot create pipe to rttree_reduce\n",
# Line 149 | Line 151 | eval_isotropic(char *funame)
151   #endif
152                  if (rbf_colorimetry == RBCtristimulus) {
153                          double  uvcull = 100. - (100.-pctcull)*.25;
154 <                        sprintf(cmd, "rttree_reduce -a -h -ff -r 3 -t %f -g %d > %s",
155 <                                        uvcull, samp_order, create_component_file(1));
154 >                        sprintf(cmd, "rttree_reduce%s -h -ff -r 3 -t %f -g %d > %s",
155 >                                        recip, uvcull, samp_order, create_component_file(1));
156                          uvfp[0] = popen(cmd, "w");
157 <                        sprintf(cmd, "rttree_reduce -a -h -ff -r 3 -t %f -g %d > %s",
158 <                                        uvcull, samp_order, create_component_file(2));
157 >                        sprintf(cmd, "rttree_reduce%s -h -ff -r 3 -t %f -g %d > %s",
158 >                                        recip, uvcull, samp_order, create_component_file(2));
159                          uvfp[1] = popen(cmd, "w");
160                          if ((uvfp[0] == NULL) | (uvfp[1] == NULL)) {
161                                  fprintf(stderr, "%s: cannot open pipes to uv output\n",
# Line 321 | Line 323 | eval_anisotropic(char *funame)
323  
324          if (pctcull >= 0) {
325                  const char      *avgopt = (input_orient>0 ^ output_orient>0)
326 <                                                ? "" : " -a";
326 >                                                ? "" : recip;
327                  sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d > %s",
328                                  avgopt, pctcull, samp_order,
329                                  create_component_file(0));
# Line 563 | Line 565 | main(int argc, char *argv[])
565          esupport &= ~(E_INCHAN|E_OUTCHAN);
566          scompile("PI:3.14159265358979323846", NULL, 0);
567          biggerlib();
568 <        for (i = 1; i < argc-1 && (argv[i][0] == '-') | (argv[i][0] == '+'); i++)
568 >        for (i = 1; i < argc && (argv[i][0] == '-') | (argv[i][0] == '+'); i++)
569                  switch (argv[i][1]) {           /* get options */
570                  case 'e':
571                          scompile(argv[++i], NULL, 0);
# Line 578 | Line 580 | main(int argc, char *argv[])
580                          } else
581                                  dofwd = (argv[i][0] == '+');
582                          break;
583 +                case 'a':
584 +                        recip = (argv[i][0] == '+') ? " -a" : "";
585 +                        break;
586                  case 'b':
587                          dobwd = (argv[i][0] == '+');
588                          break;
# Line 693 | Line 698 | main(int argc, char *argv[])
698          return(wrap_up());
699   userr:
700          fprintf(stderr,
701 <        "Usage: %s [-g Nlog2][-t pctcull][-l maxlobes] [bsdf.sir ..] > bsdf.xml\n",
701 >        "Usage: %s [{+|-}a][-g Nlog2][-t pctcull][-l maxlobes] [bsdf.sir ..] > bsdf.xml\n",
702                                  progname);
703          fprintf(stderr,
704 <        "   or: %s -t{3|4} [-g Nlog2][-t pctcull][{+|-}for[ward]][{+|-}b[ackward]][-e expr][-f file] bsdf_func > bsdf.xml\n",
704 >        "   or: %s -t{3|4} [{+|-}a][-g Nlog2][-t pctcull][{+|-}for[ward]][{+|-}b[ackward]][-e expr][-f file] bsdf_func > bsdf.xml\n",
705                                  progname);
706          return(1);
707   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines