| 10 |
|
#include "rtio.h" |
| 11 |
|
#include "resolu.h" |
| 12 |
|
#include "platform.h" |
| 13 |
– |
#include "paths.h" |
| 13 |
|
#include "random.h" |
| 14 |
|
#include "rmatrix.h" |
| 15 |
|
#if !defined(_WIN32) && !defined(_WIN64) |
| 17 |
|
#include <sys/wait.h> |
| 18 |
|
#endif |
| 19 |
|
|
| 20 |
+ |
#define VIEWSTR "VIEW=" /* borrowed from common/view.h */ |
| 21 |
+ |
#define VIEWSTRL 5 |
| 22 |
+ |
|
| 23 |
|
int nprocs = 1; /* # of calculation processes (Unix) */ |
| 24 |
|
int in_type = DTfromHeader; /* input data type */ |
| 25 |
|
int out_type = DTfromHeader; /* output data type */ |
| 29 |
|
int iswapped = 0; /* input data is byte-swapped? */ |
| 30 |
|
int ncomp = 3; /* # input components */ |
| 31 |
|
int xres=0, yres=0; /* input image dimensions */ |
| 32 |
+ |
char viewspec[128] = ""; /* VIEW= line from first header */ |
| 33 |
+ |
char pixasp[48] = ""; /* PIXASPECT= line from header */ |
| 34 |
|
|
| 35 |
|
RMATRIX *cmtx = NULL; /* coefficient matrix */ |
| 36 |
|
|
| 84 |
|
iswapped = (i != nativebigendian()); |
| 85 |
|
return(1); |
| 86 |
|
} |
| 87 |
+ |
if (!strncmp(s, VIEWSTR, VIEWSTRL)) { |
| 88 |
+ |
strcpy(viewspec, s); |
| 89 |
+ |
return(1); |
| 90 |
+ |
} |
| 91 |
+ |
if (isaspect(s)) { |
| 92 |
+ |
strcpy(pixasp, s); |
| 93 |
+ |
return(1); |
| 94 |
+ |
} |
| 95 |
|
return(0); |
| 96 |
|
} |
| 97 |
|
|
| 257 |
|
fputnow(fp); |
| 258 |
|
if (fno >= 0) |
| 259 |
|
fprintf(fp, "FRAME=%d\n", fno); |
| 260 |
+ |
if (viewspec[0]) |
| 261 |
+ |
fputs(viewspec, fp); |
| 262 |
+ |
if (pixasp[0]) |
| 263 |
+ |
fputs(pixasp, fp); |
| 264 |
|
switch (out_type) { |
| 265 |
|
case DTfloat: |
| 266 |
|
case DTdouble: |
| 396 |
|
return(0); |
| 397 |
|
} |
| 398 |
|
|
| 399 |
+ |
#if defined(_WIN32) || defined(_WIN64) |
| 400 |
+ |
#define multi_process solo_process |
| 401 |
+ |
#else |
| 402 |
+ |
|
| 403 |
|
/* allocate a scrambled index array of the specified length */ |
| 404 |
|
int * |
| 405 |
|
scramble(int n) |
| 427 |
|
int |
| 428 |
|
multi_process(void) |
| 429 |
|
{ |
| 410 |
– |
#if defined(_WIN32) || defined(_WIN64) |
| 411 |
– |
fputs("Bad call to multi_process()\n", stderr); |
| 412 |
– |
return(0); |
| 413 |
– |
#else |
| 430 |
|
int coff = nprocs; |
| 431 |
|
int odd = 0; |
| 432 |
|
char fbuf[512]; |
| 555 |
|
writerr: |
| 556 |
|
fprintf(stderr, "%s: write error\n", fbuf); |
| 557 |
|
return(0); |
| 542 |
– |
#endif |
| 558 |
|
} |
| 559 |
+ |
|
| 560 |
+ |
#endif /* ! Windows */ |
| 561 |
|
|
| 562 |
|
int |
| 563 |
|
main(int argc, char *argv[]) |