9 |
|
#include <stdio.h> |
10 |
|
#include <signal.h> |
11 |
|
#include <sys/types.h> |
12 |
< |
#include <sys/wait.h> |
12 |
> |
#ifndef NON_POSIX /* XXX need abstraction for process management */ |
13 |
> |
#include <sys/wait.h> |
14 |
> |
#endif |
15 |
|
|
16 |
|
#include "platform.h" |
17 |
|
#include "standard.h" |
248 |
|
/* compute piece size */ |
249 |
|
hres /= hmult; |
250 |
|
vres /= vmult; |
251 |
+ |
if (hres <= 0 || vres <= 0) { |
252 |
+ |
fprintf(stderr, "%s: illegal resolution/subdivision\n", progname); |
253 |
+ |
exit(1); |
254 |
+ |
} |
255 |
|
normaspect(viewaspect(&ourview)*hmult/vmult, &pixaspect, &hres, &vres); |
256 |
|
sprintf(hrbuf, "%d", hres); |
257 |
|
rpargv[rpargc++] = "-x"; rpargv[rpargc++] = hrbuf; |
437 |
|
pview = ourview; |
438 |
|
switch (ourview.type) { |
439 |
|
case VT_PER: |
440 |
< |
pview.horiz = 2.*180./PI*atan( |
441 |
< |
tan(PI/180./2.*ourview.horiz)/hmult ); |
442 |
< |
pview.vert = 2.*180./PI*atan( |
443 |
< |
tan(PI/180./2.*ourview.vert)/vmult ); |
440 |
> |
pview.horiz = (2.*180./PI)*atan( |
441 |
> |
tan((PI/180./2.)*ourview.horiz)/hmult ); |
442 |
> |
pview.vert = (2.*180./PI)*atan( |
443 |
> |
tan((PI/180./2.)*ourview.vert)/vmult ); |
444 |
|
break; |
445 |
|
case VT_PAR: |
446 |
|
case VT_ANG: |
449 |
|
break; |
450 |
|
case VT_CYL: |
451 |
|
pview.horiz = ourview.horiz / hmult; |
452 |
< |
pview.vert = 2.*180./PI*atan( |
453 |
< |
tan(PI/180./2.*ourview.vert)/vmult ); |
452 |
> |
pview.vert = (2.*180./PI)*atan( |
453 |
> |
tan((PI/180./2.)*ourview.vert)/vmult ); |
454 |
|
break; |
455 |
|
case VT_HEM: |
456 |
< |
pview.horiz = 2.*180./PI*asin( |
457 |
< |
sin(PI/180./2.*ourview.horiz)/hmult ); |
458 |
< |
pview.vert = 2.*180./PI*asin( |
459 |
< |
sin(PI/180./2.*ourview.vert)/vmult ); |
456 |
> |
pview.horiz = (2.*180./PI)*asin( |
457 |
> |
sin((PI/180./2.)*ourview.horiz)/hmult ); |
458 |
> |
pview.vert = (2.*180./PI)*asin( |
459 |
> |
sin((PI/180./2.)*ourview.vert)/vmult ); |
460 |
> |
break; |
461 |
> |
case VT_PLS: |
462 |
> |
pview.horiz = sin((PI/180./2.)*ourview.horiz) / |
463 |
> |
(1.0 + cos((PI/180./2.)*ourview.horiz)) / hmult; |
464 |
> |
pview.horiz *= pview.horiz; |
465 |
> |
pview.horiz = (2.*180./PI)*acos((1. - pview.horiz) / |
466 |
> |
(1. + pview.horiz)); |
467 |
> |
pview.vert = sin((PI/180./2.)*ourview.vert) / |
468 |
> |
(1.0 + cos((PI/180./2.)*ourview.vert)) / vmult; |
469 |
> |
pview.vert *= pview.vert; |
470 |
> |
pview.vert = (2.*180./PI)*acos((1. - pview.vert) / |
471 |
> |
(1. + pview.vert)); |
472 |
|
break; |
473 |
|
default: |
474 |
|
fprintf(stderr, "%s: unknown view type '-vt%c'\n", |