15 |
|
|
16 |
|
#include "copyright.h" |
17 |
|
|
18 |
– |
#include "standard.h" |
18 |
|
#include <ctype.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" |
482 |
|
pippt = NULL; |
483 |
|
} |
484 |
|
if (pippt != NULL) |
485 |
< |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
485 |
> |
strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */ |
486 |
|
else { |
487 |
|
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
488 |
|
cp += 11; /* point to file name */ |
631 |
|
if (astat.tnext < astat.fnext) /* other work to do first */ |
632 |
|
return; |
633 |
|
/* filter each view */ |
634 |
< |
for (i = astat.fnext; i < astat.rnext; i++) { |
635 |
< |
if ((vp = getview(i)) == NULL) { /* get view i */ |
636 |
< |
fprintf(stderr, |
635 |
< |
"%s: unexpected error reading view for frame %d\n", |
636 |
< |
progname, i); |
637 |
< |
quit(1); |
638 |
< |
} |
639 |
< |
dofilt(i, vp, getexp(i), 0); /* filter frame */ |
640 |
< |
} |
634 |
> |
for (i = astat.fnext; i < astat.rnext; i++) |
635 |
> |
dofilt(i, 0); |
636 |
> |
|
637 |
|
bwait(0); /* wait for filter processes */ |
638 |
|
archive(); /* archive originals */ |
639 |
|
astat.fnext = i; /* update status */ |
794 |
|
return(1); |
795 |
|
/* add frame to recovered list */ |
796 |
|
if (nrfrms) |
797 |
< |
rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int)); |
797 |
> |
rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int)); |
798 |
|
else |
799 |
|
rfrm = (int *)malloc(sizeof(int)); |
800 |
|
if (rfrm == NULL) { |
810 |
|
frecover(frame) /* recover filtered frame */ |
811 |
|
int frame; |
812 |
|
{ |
813 |
< |
VIEW *vp; |
818 |
< |
char *ex; |
819 |
< |
|
820 |
< |
vp = getview(frame); |
821 |
< |
ex = getexp(frame); |
822 |
< |
if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1)) |
813 |
> |
if (dofilt(frame, 2) && dofilt(frame, 1)) |
814 |
|
return(1); |
815 |
|
return(0); |
816 |
|
} |
860 |
|
|
861 |
|
|
862 |
|
int |
863 |
< |
dofilt(frame, vp, ep, rvr) /* filter frame */ |
863 |
> |
dofilt(frame, rvr) /* filter frame */ |
864 |
|
int frame; |
874 |
– |
VIEW *vp; |
875 |
– |
char *ep; |
865 |
|
int rvr; |
866 |
|
{ |
867 |
|
extern int frecover(); |
868 |
|
static int iter = 0; |
869 |
|
double blurf; |
870 |
|
int nblur = getblur(&blurf); |
871 |
+ |
VIEW *vp = getview(frame); |
872 |
+ |
char *ep = getexp(frame); |
873 |
|
char fnbefore[128], fnafter[128], *fbase; |
874 |
|
char combuf[1024], fname0[128], fname1[128]; |
875 |
|
int usepinterp, usepfilt, nora_rgbe; |
876 |
|
int frseq[2]; |
877 |
|
/* check what is needed */ |
878 |
+ |
if (vp == NULL) { |
879 |
+ |
fprintf(stderr, |
880 |
+ |
"%s: unexpected error reading view for frame %d\n", |
881 |
+ |
progname, frame); |
882 |
+ |
quit(1); |
883 |
+ |
} |
884 |
+ |
if (ep == NULL) { |
885 |
+ |
fprintf(stderr, |
886 |
+ |
"%s: unexpected error reading exposure for frame %d\n", |
887 |
+ |
progname, frame); |
888 |
+ |
quit(1); |
889 |
+ |
} |
890 |
|
usepinterp = (nblur > 1); |
891 |
< |
usepfilt = pfiltalways | ep==NULL; |
891 |
> |
usepfilt = pfiltalways | (ep==NULL); |
892 |
|
if (ep != NULL && !strcmp(ep, "1")) |
893 |
|
ep = "+0"; |
894 |
|
nora_rgbe = strcmp(vval(OVERSAMP),"1") || ep==NULL || |
974 |
|
if (usepfilt) |
975 |
|
sprintf(combuf+strlen(combuf), " %s", rresopt); |
976 |
|
else |
977 |
< |
sprintf(combuf+strlen(combuf), "-a %s -e %s", |
977 |
> |
sprintf(combuf+strlen(combuf), " -a %s -e %s", |
978 |
|
fresopt, ep); |
979 |
|
sprintf(combuf+strlen(combuf), " %s.unf %s.zbf", |
980 |
|
fnbefore, fnbefore); |
1035 |
|
fclose(viewfp); |
1036 |
|
viewfp = NULL; |
1037 |
|
viewnum = 0; |
1038 |
< |
copystruct(&curview, &stdview); |
1038 |
> |
curview = stdview; |
1039 |
|
} |
1040 |
|
return(NULL); |
1041 |
|
} |
1051 |
|
perror(vval(VIEWFILE)); |
1052 |
|
quit(1); |
1053 |
|
} |
1054 |
< |
copystruct(&curview, &stdview); |
1054 |
> |
curview = stdview; |
1055 |
|
viewnum = 0; |
1056 |
|
} |
1057 |
|
if (n < 0) { /* get next view */ |
1303 |
|
strcpy(com1=buf, com); /* build -PP command */ |
1304 |
|
sprintf(com1+(ppins-com), " -PP %s/%s.persist", |
1305 |
|
vval(DIRECTORY), phostname(ps)); |
1306 |
+ |
unlink(com1+(ppins-com)+5); |
1307 |
|
strcat(com1, ppins); |
1308 |
|
} else |
1309 |
|
com1 = com; |
1364 |
|
char *fn; |
1365 |
|
{ |
1366 |
|
if (!silent) |
1367 |
< |
#ifdef MSDOS |
1367 |
> |
#ifdef _WIN32 |
1368 |
|
printf("\tdel %s\n", fn); |
1369 |
|
#else |
1370 |
|
printf("\trm -f %s\n", fn); |
1395 |
|
for (i = 0, psep = -1; path[i]; i++) |
1396 |
|
if (path[i] == '/') |
1397 |
|
psep = i; |
1398 |
< |
if (df != NULL) |
1398 |
> |
if (df != NULL) { |
1399 |
|
if (psep == 0) { |
1400 |
|
df[0] = '/'; |
1401 |
|
df[1] = '\0'; |
1404 |
|
df[psep] = '\0'; |
1405 |
|
} else |
1406 |
|
df[0] = '\0'; |
1407 |
+ |
} |
1408 |
|
return(path+psep+1); |
1409 |
|
} |
1410 |
|
|