| 1 |
– |
/* Copyright (c) 1996 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Radiance animation control program |
| 6 |
+ |
* |
| 7 |
+ |
* The main difference between this program and ranimove is that |
| 8 |
+ |
* we have many optimizations here for camera motion in static |
| 9 |
+ |
* environments, calling rpict and pinterp on multiple processors, |
| 10 |
+ |
* where ranimove puts its emphasis on object motion, and does |
| 11 |
+ |
* not use any external programs for image generation. |
| 12 |
+ |
* |
| 13 |
+ |
* See the ranimate(1) man page for further details. |
| 14 |
|
*/ |
| 15 |
|
|
| 16 |
< |
#include "standard.h" |
| 16 |
> |
#include "copyright.h" |
| 17 |
> |
|
| 18 |
|
#include <ctype.h> |
| 13 |
– |
#include <sys/types.h> |
| 19 |
|
#include <sys/stat.h> |
| 20 |
+ |
|
| 21 |
+ |
#include "standard.h" |
| 22 |
+ |
#include "paths.h" |
| 23 |
|
#include "view.h" |
| 24 |
|
#include "vars.h" |
| 25 |
|
#include "netproc.h" |
| 26 |
+ |
/* default blur samples */ |
| 27 |
+ |
#ifndef DEF_NBLUR |
| 28 |
+ |
#define DEF_NBLUR 5 |
| 29 |
+ |
#endif |
| 30 |
|
/* default remote shell */ |
| 19 |
– |
#ifdef _AUX_SOURCE |
| 20 |
– |
#define REMSH "remsh" |
| 21 |
– |
#else |
| 31 |
|
#define REMSH "rsh" |
| 32 |
< |
#endif |
| 33 |
< |
/* input variables */ |
| 34 |
< |
#define HOST 0 /* rendering host machine */ |
| 35 |
< |
#define RENDER 1 /* rendering options */ |
| 36 |
< |
#define PFILT 2 /* pfilt options */ |
| 37 |
< |
#define PINTERP 3 /* pinterp options */ |
| 38 |
< |
#define OCTREE 4 /* octree file name */ |
| 39 |
< |
#define DIRECTORY 5 /* working (sub)directory */ |
| 40 |
< |
#define BASENAME 6 /* output image base name */ |
| 41 |
< |
#define VIEWFILE 7 /* animation frame views */ |
| 42 |
< |
#define START 8 /* starting frame number */ |
| 43 |
< |
#define END 9 /* ending frame number */ |
| 44 |
< |
#define RIF 10 /* rad input file */ |
| 45 |
< |
#define NEXTANIM 11 /* next animation file */ |
| 46 |
< |
#define ANIMATE 12 /* animation command */ |
| 47 |
< |
#define TRANSFER 13 /* frame transfer command */ |
| 48 |
< |
#define ARCHIVE 14 /* archiving command */ |
| 49 |
< |
#define INTERP 15 /* # frames to interpolate */ |
| 50 |
< |
#define OVERSAMP 16 /* # times to oversample image */ |
| 51 |
< |
#define MBLUR 17 /* samples for motion blur */ |
| 52 |
< |
#define RTRACE 18 /* use rtrace with pinterp? */ |
| 53 |
< |
#define DISKSPACE 19 /* how much disk space to use */ |
| 54 |
< |
#define RESOLUTION 20 /* desired final resolution */ |
| 55 |
< |
#define EXPOSURE 21 /* how to compute exposure */ |
| 47 |
< |
#define RSH 22 /* remote shell script or program */ |
| 32 |
> |
/* input variables (alphabetical by name) */ |
| 33 |
> |
#define ANIMATE 0 /* animation command */ |
| 34 |
> |
#define ARCHIVE 1 /* archiving command */ |
| 35 |
> |
#define BASENAME 2 /* output image base name */ |
| 36 |
> |
#define DIRECTORY 3 /* working (sub)directory */ |
| 37 |
> |
#define DISKSPACE 4 /* how much disk space to use */ |
| 38 |
> |
#define END 5 /* ending frame number */ |
| 39 |
> |
#define EXPOSURE 6 /* how to compute exposure */ |
| 40 |
> |
#define HOST 7 /* rendering host machine */ |
| 41 |
> |
#define INTERP 8 /* # frames to interpolate */ |
| 42 |
> |
#define MBLUR 9 /* motion blur parameters */ |
| 43 |
> |
#define NEXTANIM 10 /* next animation file */ |
| 44 |
> |
#define OCTREE 11 /* octree file name */ |
| 45 |
> |
#define OVERSAMP 12 /* # times to oversample image */ |
| 46 |
> |
#define PFILT 13 /* pfilt options */ |
| 47 |
> |
#define PINTERP 14 /* pinterp options */ |
| 48 |
> |
#define RENDER 15 /* rendering options */ |
| 49 |
> |
#define RESOLUTION 16 /* desired final resolution */ |
| 50 |
> |
#define RIF 17 /* rad input file */ |
| 51 |
> |
#define RSH 18 /* remote shell script or program */ |
| 52 |
> |
#define RTRACE 19 /* use rtrace with pinterp? */ |
| 53 |
> |
#define START 20 /* starting frame number */ |
| 54 |
> |
#define TRANSFER 21 /* frame transfer command */ |
| 55 |
> |
#define VIEWFILE 22 /* animation frame views */ |
| 56 |
|
|
| 57 |
|
int NVARS = 23; /* total number of variables */ |
| 58 |
|
|
| 59 |
|
VARIABLE vv[] = { /* variable-value pairs */ |
| 52 |
– |
{"host", 4, 0, NULL, NULL}, |
| 53 |
– |
{"render", 3, 0, NULL, catvalues}, |
| 54 |
– |
{"pfilt", 2, 0, NULL, catvalues}, |
| 55 |
– |
{"pinterp", 2, 0, NULL, catvalues}, |
| 56 |
– |
{"OCTREE", 3, 0, NULL, onevalue}, |
| 57 |
– |
{"DIRECTORY", 3, 0, NULL, onevalue}, |
| 58 |
– |
{"BASENAME", 3, 0, NULL, onevalue}, |
| 59 |
– |
{"VIEWFILE", 2, 0, NULL, onevalue}, |
| 60 |
– |
{"START", 2, 0, NULL, intvalue}, |
| 61 |
– |
{"END", 2, 0, NULL, intvalue}, |
| 62 |
– |
{"RIF", 3, 0, NULL, onevalue}, |
| 63 |
– |
{"NEXTANIM", 3, 0, NULL, onevalue}, |
| 60 |
|
{"ANIMATE", 2, 0, NULL, onevalue}, |
| 65 |
– |
{"TRANSFER", 2, 0, NULL, onevalue}, |
| 61 |
|
{"ARCHIVE", 2, 0, NULL, onevalue}, |
| 62 |
+ |
{"BASENAME", 3, 0, NULL, onevalue}, |
| 63 |
+ |
{"DIRECTORY", 3, 0, NULL, onevalue}, |
| 64 |
+ |
{"DISKSPACE", 3, 0, NULL, fltvalue}, |
| 65 |
+ |
{"END", 2, 0, NULL, intvalue}, |
| 66 |
+ |
{"EXPOSURE", 3, 0, NULL, onevalue}, |
| 67 |
+ |
{"host", 4, 0, NULL, NULL}, |
| 68 |
|
{"INTERPOLATE", 3, 0, NULL, intvalue}, |
| 68 |
– |
{"OVERSAMPLE", 2, 0, NULL, fltvalue}, |
| 69 |
|
{"MBLUR", 2, 0, NULL, onevalue}, |
| 70 |
< |
{"RTRACE", 2, 0, NULL, boolvalue}, |
| 71 |
< |
{"DISKSPACE", 3, 0, NULL, fltvalue}, |
| 70 |
> |
{"NEXTANIM", 3, 0, NULL, onevalue}, |
| 71 |
> |
{"OCTREE", 3, 0, NULL, onevalue}, |
| 72 |
> |
{"OVERSAMPLE", 2, 0, NULL, fltvalue}, |
| 73 |
> |
{"pfilt", 2, 0, NULL, catvalues}, |
| 74 |
> |
{"pinterp", 2, 0, NULL, catvalues}, |
| 75 |
> |
{"render", 3, 0, NULL, catvalues}, |
| 76 |
|
{"RESOLUTION", 3, 0, NULL, onevalue}, |
| 77 |
< |
{"EXPOSURE", 3, 0, NULL, onevalue}, |
| 77 |
> |
{"RIF", 3, 0, NULL, onevalue}, |
| 78 |
|
{"RSH", 3, 0, NULL, onevalue}, |
| 79 |
+ |
{"RTRACE", 2, 0, NULL, boolvalue}, |
| 80 |
+ |
{"START", 2, 0, NULL, intvalue}, |
| 81 |
+ |
{"TRANSFER", 2, 0, NULL, onevalue}, |
| 82 |
+ |
{"VIEWFILE", 2, 0, NULL, onevalue}, |
| 83 |
|
}; |
| 84 |
|
|
| 85 |
|
#define SFNAME "STATUS" /* status file name */ |
| 124 |
|
|
| 125 |
|
VIEW *getview(); |
| 126 |
|
char *getexp(), *dirfile(); |
| 127 |
+ |
int getblur(); |
| 128 |
|
|
| 129 |
< |
extern time_t fdate(), time(); |
| 129 |
> |
extern time_t time(); |
| 130 |
|
|
| 131 |
|
|
| 132 |
|
main(argc, argv) |
| 478 |
|
pippt = NULL; |
| 479 |
|
} |
| 480 |
|
if (pippt != NULL) |
| 481 |
< |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
| 481 |
> |
strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */ |
| 482 |
|
else { |
| 483 |
|
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
| 484 |
|
cp += 11; /* point to file name */ |
| 485 |
|
} |
| 486 |
< |
if (system(combuf)) { |
| 478 |
< |
fprintf(stderr, "%s: error executing rad command:\n\t%s\n", |
| 479 |
< |
progname, combuf); |
| 480 |
< |
quit(1); |
| 481 |
< |
} |
| 486 |
> |
system(combuf); /* ignore exit code */ |
| 487 |
|
if (pippt == NULL) { /* load variables and remove file */ |
| 488 |
|
loadvars(cp); |
| 489 |
|
unlink(cp); |
| 521 |
|
progname, vnam(INTERP)); |
| 522 |
|
vval(INTERP) = "0"; |
| 523 |
|
} |
| 524 |
< |
if (atoi(vval(MBLUR))) { /* can't handle this yet */ |
| 524 |
> |
if (strcmp(vval(MBLUR),"0")) { /* can't handle this */ |
| 525 |
|
if (!nowarn) |
| 526 |
|
fprintf(stderr, |
| 527 |
|
"%s: resetting %s=0 for animation\n", |
| 531 |
|
} |
| 532 |
|
/* figure # frames per batch */ |
| 533 |
|
d1 = mult*xres*mult*yres*4; /* space for orig. picture */ |
| 534 |
< |
if ((i=vint(INTERP)) || atoi(vval(MBLUR))) |
| 534 |
> |
if ((i=vint(INTERP)) || getblur(NULL) > 1) |
| 535 |
|
d1 += mult*xres*mult*yres*sizeof(float); /* Z-buffer */ |
| 536 |
|
d2 = xres*yres*4; /* space for final picture */ |
| 537 |
|
frames_batch = (i+1)*(vflt(DISKSPACE)*1048576.-d1)/(d1+i*d2); |
| 627 |
|
if (astat.tnext < astat.fnext) /* other work to do first */ |
| 628 |
|
return; |
| 629 |
|
/* filter each view */ |
| 630 |
< |
for (i = astat.fnext; i < astat.rnext; i++) { |
| 631 |
< |
if ((vp = getview(i)) == NULL) { /* get view i */ |
| 632 |
< |
fprintf(stderr, |
| 628 |
< |
"%s: unexpected error reading view for frame %d\n", |
| 629 |
< |
progname, i); |
| 630 |
< |
quit(1); |
| 631 |
< |
} |
| 632 |
< |
dofilt(i, vp, getexp(i), 0); /* filter frame */ |
| 633 |
< |
} |
| 630 |
> |
for (i = astat.fnext; i < astat.rnext; i++) |
| 631 |
> |
dofilt(i, 0); |
| 632 |
> |
|
| 633 |
|
bwait(0); /* wait for filter processes */ |
| 634 |
|
archive(); /* archive originals */ |
| 635 |
|
astat.fnext = i; /* update status */ |
| 699 |
|
int first, last; |
| 700 |
|
char *vfn; |
| 701 |
|
{ |
| 702 |
+ |
double blurf; |
| 703 |
+ |
int nblur = getblur(&blurf); |
| 704 |
|
char combuf[2048]; |
| 705 |
< |
char *inspoint; |
| 705 |
> |
register char *inspoint; |
| 706 |
|
register int i; |
| 707 |
|
|
| 708 |
|
if (!noaction && vint(INTERP)) /* create dummy frames */ |
| 713 |
|
close(open(combuf, O_RDONLY|O_CREAT, 0666)); |
| 714 |
|
} |
| 715 |
|
/* create command */ |
| 716 |
< |
sprintf(combuf, "rpict%s -w0", rendopt); |
| 717 |
< |
if (vint(INTERP) || atoi(vval(MBLUR))) |
| 718 |
< |
sprintf(combuf+strlen(combuf), " -z %s.zbf", vval(BASENAME)); |
| 719 |
< |
sprintf(combuf+strlen(combuf), " -o %s.unf %s -S %d", |
| 716 |
> |
sprintf(combuf, "rpict%s%s -w0", rendopt, |
| 717 |
> |
viewopt(getview(first>1 ? first-1 : 1))); |
| 718 |
> |
inspoint = combuf; |
| 719 |
> |
while (*inspoint) inspoint++; |
| 720 |
> |
if (nblur) { |
| 721 |
> |
sprintf(inspoint, " -pm %.3f", blurf/nblur); |
| 722 |
> |
while (*inspoint) inspoint++; |
| 723 |
> |
} |
| 724 |
> |
if (nblur > 1 || vint(INTERP)) { |
| 725 |
> |
sprintf(inspoint, " -z %s.zbf", vval(BASENAME)); |
| 726 |
> |
while (*inspoint) inspoint++; |
| 727 |
> |
} |
| 728 |
> |
sprintf(inspoint, " -o %s.unf %s -S %d", |
| 729 |
|
vval(BASENAME), rresopt, first); |
| 730 |
< |
inspoint = combuf + strlen(combuf); |
| 730 |
> |
while (*inspoint) inspoint++; |
| 731 |
|
sprintf(inspoint, " %s < %s", vval(OCTREE), vfn); |
| 732 |
|
/* run in parallel */ |
| 733 |
|
i = (last-first+1)/(vint(INTERP)+1); |
| 753 |
|
{ |
| 754 |
|
static int *rfrm; /* list of recovered frames */ |
| 755 |
|
static int nrfrms = 0; |
| 756 |
+ |
double blurf; |
| 757 |
+ |
int nblur = getblur(&blurf); |
| 758 |
|
char combuf[2048]; |
| 759 |
|
char fname[128]; |
| 760 |
|
register char *cp; |
| 770 |
|
vval(ANIMATE), frame, rendopt); |
| 771 |
|
else |
| 772 |
|
sprintf(combuf, "rpict%s -w0", rendopt); |
| 773 |
< |
cp = combuf + strlen(combuf); |
| 774 |
< |
if (vint(INTERP) || atoi(vval(MBLUR))) { |
| 773 |
> |
cp = combuf; |
| 774 |
> |
while (*cp) cp++; |
| 775 |
> |
if (nblur) { |
| 776 |
> |
sprintf(cp, " -pm %.3f", blurf/nblur); |
| 777 |
> |
while (*cp) cp++; |
| 778 |
> |
} |
| 779 |
> |
if (nblur > 1 || vint(INTERP)) { |
| 780 |
|
sprintf(cp, " -z %s.zbf", fname); |
| 781 |
|
while (*cp) cp++; |
| 782 |
|
} |
| 790 |
|
return(1); |
| 791 |
|
/* add frame to recovered list */ |
| 792 |
|
if (nrfrms) |
| 793 |
< |
rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int)); |
| 793 |
> |
rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int)); |
| 794 |
|
else |
| 795 |
|
rfrm = (int *)malloc(sizeof(int)); |
| 796 |
|
if (rfrm == NULL) { |
| 806 |
|
frecover(frame) /* recover filtered frame */ |
| 807 |
|
int frame; |
| 808 |
|
{ |
| 809 |
< |
VIEW *vp; |
| 793 |
< |
char *ex; |
| 794 |
< |
|
| 795 |
< |
vp = getview(frame); |
| 796 |
< |
ex = getexp(frame); |
| 797 |
< |
if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1)) |
| 809 |
> |
if (dofilt(frame, 2) && dofilt(frame, 1)) |
| 810 |
|
return(1); |
| 811 |
|
return(0); |
| 812 |
|
} |
| 856 |
|
|
| 857 |
|
|
| 858 |
|
int |
| 859 |
< |
dofilt(frame, vp, ep, rvr) /* filter frame */ |
| 859 |
> |
dofilt(frame, rvr) /* filter frame */ |
| 860 |
|
int frame; |
| 849 |
– |
VIEW *vp; |
| 850 |
– |
char *ep; |
| 861 |
|
int rvr; |
| 862 |
|
{ |
| 863 |
|
extern int frecover(); |
| 864 |
|
static int iter = 0; |
| 865 |
+ |
double blurf; |
| 866 |
+ |
int nblur = getblur(&blurf); |
| 867 |
+ |
VIEW *vp = getview(frame); |
| 868 |
+ |
char *ep = getexp(frame); |
| 869 |
|
char fnbefore[128], fnafter[128], *fbase; |
| 870 |
|
char combuf[1024], fname0[128], fname1[128]; |
| 871 |
|
int usepinterp, usepfilt, nora_rgbe; |
| 872 |
|
int frseq[2]; |
| 873 |
|
/* check what is needed */ |
| 874 |
< |
usepinterp = atoi(vval(MBLUR)); |
| 875 |
< |
usepfilt = pfiltalways | ep==NULL; |
| 874 |
> |
if (vp == NULL) { |
| 875 |
> |
fprintf(stderr, |
| 876 |
> |
"%s: unexpected error reading view for frame %d\n", |
| 877 |
> |
progname, frame); |
| 878 |
> |
quit(1); |
| 879 |
> |
} |
| 880 |
> |
if (ep == NULL) { |
| 881 |
> |
fprintf(stderr, |
| 882 |
> |
"%s: unexpected error reading exposure for frame %d\n", |
| 883 |
> |
progname, frame); |
| 884 |
> |
quit(1); |
| 885 |
> |
} |
| 886 |
> |
usepinterp = (nblur > 1); |
| 887 |
> |
usepfilt = pfiltalways | (ep==NULL); |
| 888 |
|
if (ep != NULL && !strcmp(ep, "1")) |
| 889 |
|
ep = "+0"; |
| 890 |
|
nora_rgbe = strcmp(vval(OVERSAMP),"1") || ep==NULL || |
| 928 |
|
if (usepinterp) { /* using pinterp */ |
| 929 |
|
if (rvr == 2 && recover(frseq[1])) /* recover after? */ |
| 930 |
|
return(1); |
| 931 |
< |
if (atoi(vval(MBLUR))) { |
| 931 |
> |
if (nblur > 1) { /* with pmblur */ |
| 932 |
|
sprintf(fname0, "%s/vw0%c", vval(DIRECTORY), |
| 933 |
|
'a'+(iter%26)); |
| 934 |
|
sprintf(fname1, "%s/vw1%c", vval(DIRECTORY), |
| 955 |
|
putc('\n', fp); fclose(fp); |
| 956 |
|
} |
| 957 |
|
sprintf(combuf, |
| 958 |
< |
"(pmblur %s %d %s %s; rm -f %s %s) | pinterp -B", |
| 959 |
< |
*sskip(vval(MBLUR)) ? sskip2(vval(MBLUR),1) : "1", |
| 934 |
< |
atoi(vval(MBLUR)), |
| 958 |
> |
"(pmblur %.3f %d %s %s; rm -f %s %s) | pinterp -B -a", |
| 959 |
> |
blurf, nblur, |
| 960 |
|
fname0, fname1, fname0, fname1); |
| 961 |
|
iter++; |
| 962 |
|
} else /* no blurring */ |
| 970 |
|
if (usepfilt) |
| 971 |
|
sprintf(combuf+strlen(combuf), " %s", rresopt); |
| 972 |
|
else |
| 973 |
< |
sprintf(combuf+strlen(combuf), " %s -e %s", |
| 973 |
> |
sprintf(combuf+strlen(combuf), " -a %s -e %s", |
| 974 |
|
fresopt, ep); |
| 975 |
|
sprintf(combuf+strlen(combuf), " %s.unf %s.zbf", |
| 976 |
|
fnbefore, fnbefore); |
| 1031 |
|
fclose(viewfp); |
| 1032 |
|
viewfp = NULL; |
| 1033 |
|
viewnum = 0; |
| 1034 |
< |
copystruct(&curview, &stdview); |
| 1034 |
> |
curview = stdview; |
| 1035 |
|
} |
| 1036 |
|
return(NULL); |
| 1037 |
|
} |
| 1047 |
|
perror(vval(VIEWFILE)); |
| 1048 |
|
quit(1); |
| 1049 |
|
} |
| 1050 |
< |
copystruct(&curview, &stdview); |
| 1050 |
> |
curview = stdview; |
| 1051 |
|
viewnum = 0; |
| 1052 |
|
} |
| 1053 |
|
if (n < 0) { /* get next view */ |
| 1094 |
|
if (n == 0) { /* signal to close file */ |
| 1095 |
|
if (expfp != NULL) { |
| 1096 |
|
fclose(expfp); |
| 1097 |
< |
free((char *)exppos); |
| 1097 |
> |
free((void *)exppos); |
| 1098 |
|
expfp = NULL; |
| 1099 |
|
} |
| 1100 |
|
return(NULL); |
| 1299 |
|
strcpy(com1=buf, com); /* build -PP command */ |
| 1300 |
|
sprintf(com1+(ppins-com), " -PP %s/%s.persist", |
| 1301 |
|
vval(DIRECTORY), phostname(ps)); |
| 1302 |
+ |
unlink(com1+(ppins-com)+5); |
| 1303 |
|
strcat(com1, ppins); |
| 1304 |
|
} else |
| 1305 |
|
com1 = com; |
| 1360 |
|
char *fn; |
| 1361 |
|
{ |
| 1362 |
|
if (!silent) |
| 1363 |
< |
#ifdef MSDOS |
| 1363 |
> |
#ifdef _WIN32 |
| 1364 |
|
printf("\tdel %s\n", fn); |
| 1365 |
|
#else |
| 1366 |
|
printf("\trm -f %s\n", fn); |
| 1391 |
|
for (i = 0, psep = -1; path[i]; i++) |
| 1392 |
|
if (path[i] == '/') |
| 1393 |
|
psep = i; |
| 1394 |
< |
if (df != NULL) |
| 1394 |
> |
if (df != NULL) { |
| 1395 |
|
if (psep == 0) { |
| 1396 |
|
df[0] = '/'; |
| 1397 |
|
df[1] = '\0'; |
| 1400 |
|
df[psep] = '\0'; |
| 1401 |
|
} else |
| 1402 |
|
df[0] = '\0'; |
| 1403 |
+ |
} |
| 1404 |
|
return(path+psep+1); |
| 1405 |
+ |
} |
| 1406 |
+ |
|
| 1407 |
+ |
|
| 1408 |
+ |
int |
| 1409 |
+ |
getblur(double *bf) /* get # blur samples (and fraction) */ |
| 1410 |
+ |
{ |
| 1411 |
+ |
double blurf; |
| 1412 |
+ |
int nblur; |
| 1413 |
+ |
char *s; |
| 1414 |
+ |
|
| 1415 |
+ |
if (!vdef(MBLUR)) { |
| 1416 |
+ |
if (bf != NULL) |
| 1417 |
+ |
*bf = 0.0; |
| 1418 |
+ |
return(0); |
| 1419 |
+ |
} |
| 1420 |
+ |
blurf = atof(vval(MBLUR)); |
| 1421 |
+ |
if (blurf < 0.0) |
| 1422 |
+ |
blurf = 0.0; |
| 1423 |
+ |
if (bf != NULL) |
| 1424 |
+ |
*bf = blurf; |
| 1425 |
+ |
if (blurf <= FTINY) |
| 1426 |
+ |
return(0); |
| 1427 |
+ |
s = sskip(vval(MBLUR)); |
| 1428 |
+ |
if (!*s) |
| 1429 |
+ |
return(DEF_NBLUR); |
| 1430 |
+ |
nblur = atoi(s); |
| 1431 |
+ |
if (nblur <= 0) |
| 1432 |
+ |
return(1); |
| 1433 |
+ |
return(nblur); |
| 1434 |
|
} |