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