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

Comparing ray/src/common/image.c (file contents):
Revision 2.17 by greg, Tue Feb 25 02:47:21 2003 UTC vs.
Revision 2.28 by greg, Tue Jun 8 19:48:29 2004 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 < #include  "standard.h"
13 <
12 > #include  "rtio.h"
13 > #include  "rtmath.h"
14 > #include  "paths.h"
15   #include  "view.h"
16  
16 #include  "paths.h"
17  
18   #define  FEQ(x,y)       (fabs((x)-(y)) <= FTINY)
19   #define  VEQ(v,w)       (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \
# Line 21 | Line 21 | static const char      RCSid[] = "$Id$";
21  
22   VIEW  stdview = STDVIEW;                /* default view parameters */
23  
24 + static gethfunc gethview;
25  
26 +
27   char *
28   setview(v)              /* set hvec and vvec, return message on error */
29   register VIEW  *v;
# Line 271 | Line 273 | FVECT  p;
273  
274   void
275   pix2loc(loc, rp, px, py)        /* compute image location from pixel pos. */
276 < FLOAT  loc[2];
276 > RREAL  loc[2];
277   register RESOLU  *rp;
278   int  px, py;
279   {
# Line 394 | Line 396 | register char  *s;
396          int  na;
397          int  nvopts = 0;
398  
399 +        while (*s == ' ')
400 +                s++;
401          if (*s != '-')
402                  s = sskip2(s,1);
403          while (*s) {
404                  ac = 0;
405                  do {
406 <                        av[ac++] = s;
406 >                        if (ac || *s == '-')
407 >                                av[ac++] = s;
408                          while (*s && *s != ' ')
409                                  s++;
410                          while (*s == ' ')
# Line 489 | Line 494 | int
494   isview(s)                               /* is this a view string? */
495   char  *s;
496   {
497 <        static char  *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL};
497 >        static char  *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL};
498          extern char  *progname;
499          register char  *cp;
500          register char  **an;
# Line 521 | Line 526 | struct myview {
526  
527  
528   static int
529 < gethview(s, v)                          /* get view from header */
530 < char  *s;
531 < register struct myview  *v;
529 > gethview(                               /* get view from header */
530 >        char  *s,
531 >        void  *v
532 > )
533   {
534 <        if (isview(s) && sscanview(v->hv, s) > 0)
535 <                v->ok++;
534 >        if (isview(s) && sscanview(((struct myview*)v)->hv, s) > 0)
535 >                ((struct myview*)v)->ok++;
536          return(0);
537   }
538  
# Line 548 | Line 554 | RESOLU  *rp;
554          mvs.hv = vp;
555          mvs.ok = 0;
556  
557 <        getheader(fp, (int (*)(char *, char *))&gethview, (char *)&mvs);
557 >        getheader(fp, gethview, &mvs);
558  
559          if (rp != NULL && !fgetsresolu(rp, fp))
560                  mvs.ok = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines