| 1 |
– |
/* Copyright (c) 1999 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Interpolate and extrapolate pictures with different view parameters. |
| 6 |
|
* |
| 15 |
|
|
| 16 |
|
#include "color.h" |
| 17 |
|
|
| 21 |
– |
#include "resolu.h" |
| 22 |
– |
|
| 18 |
|
#define LOG2 0.69314718055994530942 |
| 19 |
|
|
| 20 |
|
#define pscan(y) (ourpict+(y)*hresolu) |
| 208 |
|
if (argv[an][2] != 'f') |
| 209 |
|
goto badopt; |
| 210 |
|
check(3,"s"); |
| 211 |
< |
gotvfile = viewfile(argv[++an], &ourview, 0, 0); |
| 211 |
> |
gotvfile = viewfile(argv[++an], &ourview, NULL); |
| 212 |
|
if (gotvfile < 0) |
| 213 |
|
syserror(argv[an]); |
| 214 |
|
else if (gotvfile == 0) { |
| 274 |
|
syserror(progname); |
| 275 |
|
/* new header */ |
| 276 |
|
newheader("RADIANCE", stdout); |
| 277 |
+ |
fputnow(stdout); |
| 278 |
|
/* run pictures */ |
| 279 |
|
do { |
| 280 |
|
bzero((char *)ourzbuf, hresolu*vresolu*sizeof(float)); |
| 469 |
|
if (xlim == NULL) |
| 470 |
|
syserror(progname); |
| 471 |
|
if (!getperim(xlim, &ylim, zin, zfd)) { /* overlapping area? */ |
| 472 |
< |
free((char *)zin); |
| 473 |
< |
free((char *)xlim); |
| 472 |
> |
free((void *)zin); |
| 473 |
> |
free((void *)xlim); |
| 474 |
|
if (zfd != -1) |
| 475 |
|
close(zfd); |
| 476 |
|
fclose(pfp); |
| 489 |
|
exit(1); |
| 490 |
|
} |
| 491 |
|
if (zfd != -1 && lseek(zfd, |
| 492 |
< |
(long)ylim.min*scanlen(&tresolu)*sizeof(float), 0) < 0) |
| 492 |
> |
(off_t)ylim.min*scanlen(&tresolu)*sizeof(float), 0) < 0) |
| 493 |
|
syserror(zspec); |
| 494 |
|
/* load image */ |
| 495 |
|
for (y = ylim.min; y <= ylim.max; y++) { |
| 504 |
|
addscanline(xlim+y, y, scanin, zin, plast); |
| 505 |
|
} |
| 506 |
|
/* clean up */ |
| 507 |
< |
free((char *)xlim); |
| 508 |
< |
free((char *)scanin); |
| 509 |
< |
free((char *)zin); |
| 510 |
< |
free((char *)plast); |
| 507 |
> |
free((void *)xlim); |
| 508 |
> |
free((void *)scanin); |
| 509 |
> |
free((void *)zin); |
| 510 |
> |
free((void *)plast); |
| 511 |
|
fclose(pfp); |
| 512 |
|
if (zfd != -1) |
| 513 |
|
close(zfd); |
| 756 |
|
yl->min = 32000; yl->max = 0; /* search for points on image */ |
| 757 |
|
for (y = step - 1; y < numscans(&tresolu); y += step) { |
| 758 |
|
if (zfd != -1) { |
| 759 |
< |
if (lseek(zfd, (long)y*scanlen(&tresolu)*sizeof(float), |
| 759 |
> |
if (lseek(zfd, (off_t)y*scanlen(&tresolu)*sizeof(float), |
| 760 |
|
0) < 0) |
| 761 |
|
syserror("lseek"); |
| 762 |
|
if (read(zfd, (char *)zline, |
| 917 |
|
xback = -2; |
| 918 |
|
} |
| 919 |
|
} |
| 920 |
< |
free((char *)yback); |
| 920 |
> |
free((void *)yback); |
| 921 |
|
} |
| 922 |
|
|
| 923 |
|
|
| 1169 |
|
} |
| 1170 |
|
/* mark end and get results */ |
| 1171 |
|
bzero((char *)fbp, 6*sizeof(float)); |
| 1172 |
< |
if (process(PDesc, fbuf, fbuf, 4*sizeof(float)*(queuesiz+1), |
| 1172 |
> |
if (process(PDesc, (char *)fbuf, (char *)fbuf, |
| 1173 |
> |
4*sizeof(float)*(queuesiz+1), |
| 1174 |
|
6*sizeof(float)*(queuesiz+1)) != |
| 1175 |
|
4*sizeof(float)*(queuesiz+1)) { |
| 1176 |
|
fprintf(stderr, "%s: error reading from rtrace process\n", |