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.10 by greg, Thu Aug 24 11:55:03 1995 UTC vs.
Revision 2.11 by greg, Wed Jan 10 19:25:57 1996 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1994 Regents of the University of California */
1 > /* Copyright (c) 1996 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 6 | Line 6 | static char SCCSid[] = "$SunId$ LBL";
6  
7   /*
8   *  image.c - routines for image generation.
9 *
10 *     10/17/85
9   */
10  
11   #include  "standard.h"
# Line 18 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "paths.h"
18  
19 + #define  FEQ(x,y)       (fabs((x)-(y)) <= FTINY)
20 + #define  VEQ(v,w)       (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \
21 +                                && FEQ((v)[2],(w)[2]))
22 +
23   VIEW  stdview = STDVIEW;                /* default view parameters */
24  
25  
# Line 425 | Line 427 | FILE  *fp;
427          fprintf(fp, " -vh %.6g -vv %.6g", vp->horiz, vp->vert);
428          fprintf(fp, " -vo %.6g -va %.6g", vp->vfore, vp->vaft);
429          fprintf(fp, " -vs %.6g -vl %.6g", vp->hoff, vp->voff);
430 + }
431 +
432 +
433 + char *
434 + viewopt(vp)                             /* translate to minimal view string */
435 + register VIEW  *vp;
436 + {
437 +        static char  vwstr[128];
438 +        register char  *cp = vwstr;
439 +
440 +        if (vp->type != stdview.type) {
441 +                sprintf(cp, " -vt%c", vp->type);
442 +                cp += strlen(cp);
443 +        }
444 +        if (!VEQ(vp->vp,stdview.vp)) {
445 +                sprintf(cp, " -vp %.6g %.6g %.6g",
446 +                                vp->vp[0], vp->vp[1], vp->vp[2]);
447 +                cp += strlen(cp);
448 +        }
449 +        if (!VEQ(vp->vdir,stdview.vdir)) {
450 +                sprintf(cp, " -vd %.6g %.6g %.6g",
451 +                                vp->vdir[0], vp->vdir[1], vp->vdir[2]);
452 +                cp += strlen(cp);
453 +        }
454 +        if (!VEQ(vp->vup,stdview.vup)) {
455 +                sprintf(cp, " -vu %.6g %.6g %.6g",
456 +                                vp->vup[0], vp->vup[1], vp->vup[2]);
457 +                cp += strlen(cp);
458 +        }
459 +        if (!FEQ(vp->horiz,stdview.horiz)) {
460 +                sprintf(cp, " -vh %.6g", vp->horiz);
461 +                cp += strlen(cp);
462 +        }
463 +        if (!FEQ(vp->vert,stdview.vert)) {
464 +                sprintf(cp, " -vv %.6g", vp->vert);
465 +                cp += strlen(cp);
466 +        }
467 +        if (!FEQ(vp->vfore,stdview.vfore)) {
468 +                sprintf(cp, " -vo %.6g", vp->vfore);
469 +                cp += strlen(cp);
470 +        }
471 +        if (!FEQ(vp->vaft,stdview.vaft)) {
472 +                sprintf(cp, " -va %.6g", vp->vaft);
473 +                cp += strlen(cp);
474 +        }
475 +        if (!FEQ(vp->hoff,stdview.hoff)) {
476 +                sprintf(cp, " -vs %.6g", vp->hoff);
477 +                cp += strlen(cp);
478 +        }
479 +        if (!FEQ(vp->voff,stdview.voff)) {
480 +                sprintf(cp, " -vl %.6g", vp->voff);
481 +                cp += strlen(cp);
482 +        }
483 +        return(vwstr);
484   }
485  
486  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines