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

Comparing ray/src/cv/bsdfpeaks.c (file contents):
Revision 2.2 by greg, Wed May 21 21:21:25 2025 UTC vs.
Revision 2.6 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id$";
13   #include "bsdfrep.h"
14  
15   typedef struct {
16 <        float   peakv;          /* peak BSDF value */
17 <        float   width;          /* smallest FWHM (deg) */
18 <        RBFNODE *rbs;           /* incident system */
19 <        int     ndx;            /* peak index for RBFVAL */
16 >        float           peakv;          /* peak BSDF value */
17 >        float           width;          /* smallest FWHM (deg) */
18 >        const RBFNODE   *rbs;           /* incident system */
19 >        int             ndx;            /* peak index for RBFVAL */
20   } FWHM;                 /* struct to hold peak value */
21  
22   typedef double  eval_f(const FVECT vin, const FVECT vout, const void *p);
23  
24 char    *progname;              /* needed by bsdfrep.c */
25
24   /* Comparison function to put larger peaks first */
25   int
26   cmpFWHM(const void *p0, const void *p1)
# Line 90 | Line 88 | getFWHM(const FVECT vin, const FVECT vc, double rad0,
88   void
89   getOutDir(FVECT vo, FWHM *dp)
90   {
91 <        RBFVAL  *vp = dp->rbs->rbfa + dp->ndx;
91 >        const RBFVAL    *vp = dp->rbs->rbfa + dp->ndx;
92  
93          ovec_from_pos(vo, vp->gx, vp->gy);
94   }
95  
96   /* Assign FWHM record for specified RBF system */
97   void
98 < assignFWHM(FWHM *dp, RBFNODE *rbf)
98 > assignFWHM(FWHM *dp, const RBFNODE *rbf)
99   {
100          FVECT   vo;
101          int     j;
# Line 121 | Line 119 | assignFWHM(FWHM *dp, RBFNODE *rbf)
119   int
120   main(int argc, char *argv[])
121   {
122 <        RBFNODE *rbf;
123 <        SDData  *sdp;
124 <        FILE    *fp;
125 <        int     ndirs;
126 <        FWHM    *peaka;
127 <        int     i;
128 <
129 <        progname = argv[0];
122 >        const RBFNODE   *rbf;
123 >        SDData          *sdp;
124 >        FILE            *fp;
125 >        int             ndirs;
126 >        FWHM            *peaka;
127 >        int             i;
128 >                                                /* set global progname */
129 >        fixargv0(argv[0]);
130          if (argc < 2)
131                  goto userr;
132  
# Line 194 | Line 192 | main(int argc, char *argv[])
192                          printf("\t%.1f", 180./M_PI * getFWHM(peaka[i].rbs->invec,
193                                                  vout, sqrt(psa/M_PI),
194                                                  bsdf_eval, sd));
195 +                        SDfreeCache(sd);
196                  }
197                  fputc('\n', stdout);
198          }
199 +        /*                      we're exiting, anyway...
200 +        SDfreeCache(NULL);
201 +        clear_bsdf_rep();
202 +        */
203          return(0);
204   userr:
205          fprintf(stderr, "Usage: %s bsdf.sir [bsdfrep1.xml ..]\n", progname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines