| 20 |
|
ncp->finp = stdin; |
| 21 |
|
ncp->inpname = "<stdin>"; |
| 22 |
|
ncp->format = 'a'; |
| 23 |
– |
ncp->swapped = 0; |
| 23 |
|
ncp->res.rt = PIXSTANDARD; |
| 24 |
|
if (!progname) progname = "norm_codec"; |
| 25 |
|
} |
| 57 |
|
} |
| 58 |
|
return 0; |
| 59 |
|
} |
| 60 |
+ |
/* get resolution string? */ |
| 61 |
+ |
if (ncp->hdrflags & HF_RESIN && !fgetsresolu(&ncp->res, ncp->finp)) { |
| 62 |
+ |
if (ncp->hdrflags & HF_STDERR) { |
| 63 |
+ |
fputs(ncp->inpname, stderr); |
| 64 |
+ |
fputs(": bad resolution string\n", stderr); |
| 65 |
+ |
} |
| 66 |
+ |
return 0; |
| 67 |
+ |
} |
| 68 |
|
if (ncp->hdrflags & HF_HEADOUT) { /* finish header */ |
| 69 |
|
if (!(ncp->hdrflags & HF_HEADIN)) |
| 70 |
|
newheader("RADIANCE", stdout); |
| 72 |
|
printargs(ac, av, stdout); |
| 73 |
|
if (ncp->hdrflags & HF_ENCODE) { |
| 74 |
|
fputformat(NORMAL32FMT, stdout); |
| 75 |
< |
} else |
| 75 |
> |
} else { |
| 76 |
> |
fputs("NCOMP=3\n", stdout); |
| 77 |
> |
if ((ncp->hdrflags & (HF_RESIN|HF_RESOUT)) == HF_RESIN) |
| 78 |
> |
printf("NCOLS=%d\nNROWS=%d\n", |
| 79 |
> |
scanlen(&ncp->res), |
| 80 |
> |
numscans(&ncp->res)); |
| 81 |
|
switch (ncp->format) { |
| 82 |
|
case 'a': |
| 83 |
|
fputformat("ascii", stdout); |
| 91 |
|
fputformat("double", stdout); |
| 92 |
|
break; |
| 93 |
|
} |
| 94 |
+ |
} |
| 95 |
|
fputc('\n', stdout); |
| 96 |
|
} |
| 97 |
< |
/* get/put resolution string */ |
| 85 |
< |
if (ncp->hdrflags & HF_RESIN && !fgetsresolu(&ncp->res, ncp->finp)) { |
| 86 |
< |
if (ncp->hdrflags & HF_STDERR) { |
| 87 |
< |
fputs(ncp->inpname, stderr); |
| 88 |
< |
fputs(": bad resolution string\n", stderr); |
| 89 |
< |
} |
| 90 |
< |
return 0; |
| 91 |
< |
} |
| 92 |
< |
if (ncp->hdrflags & HF_RESOUT) |
| 97 |
> |
if (ncp->hdrflags & HF_RESOUT) /* put resolution string? */ |
| 98 |
|
fputsresolu(&ncp->res, stdout); |
| 99 |
|
|
| 100 |
|
ncp->dstart = ncp->curpos = ftell(ncp->finp); |
| 130 |
|
int |
| 131 |
|
decode_normal_next(FVECT nrm, NORMCODEC *ncp) |
| 132 |
|
{ |
| 133 |
< |
int32 lastc; |
| 134 |
< |
FVECT lastv; |
| 135 |
< |
int32 c = getint(4, ncp->finp); |
| 133 |
> |
static int32 lastc; |
| 134 |
> |
static FVECT lastv; |
| 135 |
> |
int32 c = getint(4, ncp->finp); |
| 136 |
|
|
| 137 |
|
if (c == EOF && feof(ncp->finp)) |
| 138 |
|
return -1; |