1 |
– |
/* Copyright (c) 1993 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* rv2.c - command routines used in tracing a view. |
6 |
|
* |
7 |
< |
* 3/24/87 |
7 |
> |
* External symbols declared in rpaint.h |
8 |
|
*/ |
9 |
|
|
10 |
< |
#include "ray.h" |
10 |
> |
#include <ctype.h> |
11 |
|
|
12 |
< |
#include "octree.h" |
12 |
> |
#include "copyright.h" |
13 |
|
|
14 |
+ |
#include "platform.h" |
15 |
+ |
#include "ray.h" |
16 |
|
#include "otypes.h" |
18 |
– |
|
17 |
|
#include "rpaint.h" |
18 |
|
|
19 |
< |
#include "resolu.h" |
19 |
> |
extern int psample; /* pixel sample size */ |
20 |
> |
extern double maxdiff; /* max. sample difference */ |
21 |
|
|
23 |
– |
#include <ctype.h> |
24 |
– |
|
22 |
|
#define CTRL(c) ((c)-'@') |
23 |
|
|
24 |
|
#ifdef SMLFLT |
27 |
|
#define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) |
28 |
|
#endif |
29 |
|
|
30 |
< |
extern char *atos(); |
30 |
> |
extern char rifname[128]; /* rad input file name */ |
31 |
|
|
35 |
– |
extern char rifname[]; /* rad input file name */ |
36 |
– |
|
37 |
– |
extern char VersionID[]; |
32 |
|
extern char *progname; |
33 |
|
extern char *octname; |
34 |
|
|
35 |
|
|
36 |
+ |
void |
37 |
|
getframe(s) /* get a new frame */ |
38 |
|
char *s; |
39 |
|
{ |
43 |
|
} |
44 |
|
|
45 |
|
|
46 |
+ |
void |
47 |
|
getrepaint(s) /* get area and repaint */ |
48 |
|
char *s; |
49 |
|
{ |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
+ |
void |
59 |
|
getview(s) /* get/show view parameters */ |
60 |
|
char *s; |
61 |
|
{ |
135 |
|
else { |
136 |
|
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
137 |
|
} |
138 |
+ |
sprintf(buf, "fore and aft clipping plane (%.6g %.6g): ", |
139 |
+ |
ourview.vfore, ourview.vaft); |
140 |
+ |
(*dev->comout)(buf); |
141 |
+ |
(*dev->comin)(buf, NULL); |
142 |
+ |
if (buf[0] == CTRL('C')) return; |
143 |
+ |
if (sscanf(buf, "%lf %lf", &nv.vfore, &nv.vaft) == 2) |
144 |
+ |
change++; |
145 |
+ |
else { |
146 |
+ |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
147 |
+ |
} |
148 |
|
sprintf(buf, "view shift and lift (%.6g %.6g): ", |
149 |
|
ourview.hoff, ourview.voff); |
150 |
|
(*dev->comout)(buf); |
160 |
|
} |
161 |
|
|
162 |
|
|
163 |
+ |
void |
164 |
|
lastview(s) /* return to a previous view */ |
165 |
|
char *s; |
166 |
|
{ |
171 |
|
|
172 |
|
if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ |
173 |
|
copystruct(&nv, &stdview); |
174 |
< |
if ((fname = getpath(buf, NULL, 0)) == NULL || |
174 |
> |
if ((fname = getpath(buf, "", R_OK)) == NULL || |
175 |
|
(success = viewfile(fname, &nv, NULL)) == -1) { |
176 |
|
sprintf(errmsg, "cannot open \"%s\"", buf); |
177 |
|
error(COMMAND, errmsg); |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
+ |
void |
198 |
|
saveview(s) /* save view to rad file */ |
199 |
|
char *s; |
200 |
|
{ |
202 |
|
char *fname; |
203 |
|
FILE *fp; |
204 |
|
|
205 |
< |
if (*atos(view, sizeof(view), s)) |
205 |
> |
if (*atos(view, sizeof(view), s)) { |
206 |
> |
if (isint(view)) { |
207 |
> |
error(COMMAND, "cannot write view by number"); |
208 |
> |
return; |
209 |
> |
} |
210 |
|
s = sskip(s); |
211 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
211 |
> |
} |
212 |
> |
while (isspace(*s)) |
213 |
> |
s++; |
214 |
> |
if (*s) |
215 |
> |
atos(rifname, sizeof(rifname), s); |
216 |
> |
else if (rifname[0] == '\0') { |
217 |
|
error(COMMAND, "no previous rad file"); |
218 |
|
return; |
219 |
|
} |
231 |
|
} |
232 |
|
|
233 |
|
|
234 |
+ |
void |
235 |
|
loadview(s) /* load view from rad file */ |
236 |
|
char *s; |
237 |
|
{ |
245 |
|
s = sskip(s); |
246 |
|
else |
247 |
|
strcat(buf, "1"); |
248 |
< |
if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { |
248 |
> |
if (*s) |
249 |
> |
atos(rifname, sizeof(rifname), s); |
250 |
> |
else if (rifname[0] == '\0') { |
251 |
|
error(COMMAND, "no previous rad file"); |
252 |
|
return; |
253 |
|
} |
254 |
< |
fname = getpath(rifname, NULL, 0); |
234 |
< |
if (fname == NULL || access(fname, R_OK) == -1) { |
254 |
> |
if ((fname = getpath(rifname, "", R_OK)) == NULL) { |
255 |
|
sprintf(errmsg, "cannot access \"%s\"", rifname); |
256 |
|
error(COMMAND, errmsg); |
257 |
|
return; |
273 |
|
} |
274 |
|
|
275 |
|
|
276 |
+ |
void |
277 |
|
getaim(s) /* aim camera */ |
278 |
|
char *s; |
279 |
|
{ |
285 |
|
nv.type = ourview.type; |
286 |
|
VCOPY(nv.vp, ourview.vp); |
287 |
|
VCOPY(nv.vup, ourview.vup); |
267 |
– |
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
288 |
|
nv.horiz = ourview.horiz; nv.vert = ourview.vert; |
289 |
+ |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
290 |
+ |
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
291 |
|
zoomview(&nv, zfact); |
292 |
|
newview(&nv); |
293 |
|
} |
294 |
|
|
295 |
|
|
296 |
+ |
void |
297 |
|
getmove(s) /* move camera */ |
298 |
|
char *s; |
299 |
|
{ |
306 |
|
} |
307 |
|
|
308 |
|
|
309 |
+ |
void |
310 |
|
getrotate(s) /* rotate camera */ |
311 |
|
char *s; |
312 |
|
{ |
323 |
|
VCOPY(nv.vp, ourview.vp); |
324 |
|
VCOPY(nv.vup, ourview.vup); |
325 |
|
nv.hoff = ourview.hoff; nv.voff = ourview.voff; |
326 |
+ |
nv.vfore = ourview.vfore; nv.vaft = ourview.vaft; |
327 |
|
spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.)); |
328 |
|
if (elev != 0.0) { |
329 |
|
fcross(v1, nv.vdir, ourview.vup); |
336 |
|
} |
337 |
|
|
338 |
|
|
339 |
+ |
void |
340 |
|
getpivot(s) /* pivot viewpoint */ |
341 |
|
register char *s; |
342 |
|
{ |
348 |
|
error(COMMAND, "missing angle"); |
349 |
|
return; |
350 |
|
} |
351 |
< |
if (getinterest(sskip(sskip(s)), 0, vc, &mag) < 0) |
351 |
> |
if (getinterest(sskip2(s,2), 0, vc, &mag) < 0) |
352 |
|
return; |
353 |
|
moveview(angle, elev, mag, vc); |
354 |
|
} |
355 |
|
|
356 |
|
|
357 |
+ |
void |
358 |
|
getexposure(s) /* get new exposure */ |
359 |
|
char *s; |
360 |
|
{ |
365 |
|
register PNODE *p = &ptrunk; |
366 |
|
int adapt = 0; |
367 |
|
double e = 1.0; |
368 |
< |
start: |
368 |
> |
|
369 |
|
for (cp = s; isspace(*cp); cp++) |
370 |
|
; |
371 |
|
if (*cp == '@') { |
372 |
|
adapt++; |
373 |
< |
goto start; |
373 |
> |
while (isspace(*++cp)) |
374 |
> |
; |
375 |
|
} |
376 |
|
if (*cp == '\0') { /* normalize to point */ |
377 |
|
if (dev->getcur == NULL) |
420 |
|
redraw(); |
421 |
|
} |
422 |
|
|
423 |
+ |
typedef union {int i; double d; COLOR C;} *MyUptr; |
424 |
|
|
425 |
< |
getparam(str, dsc, typ, ptr) /* get variable from user */ |
425 |
> |
int |
426 |
> |
getparam(str, dsc, typ, p) /* get variable from user */ |
427 |
|
char *str, *dsc; |
428 |
|
int typ; |
429 |
< |
register union {int i; double d; COLOR C;} *ptr; |
429 |
> |
void *p; |
430 |
|
{ |
431 |
< |
extern char *index(); |
431 |
> |
register MyUptr ptr = (MyUptr)p; |
432 |
|
int i0; |
433 |
|
double d0, d1, d2; |
434 |
|
char buf[48]; |
486 |
|
} |
487 |
|
|
488 |
|
|
489 |
+ |
void |
490 |
|
setparam(s) /* get/set program parameter */ |
491 |
|
register char *s; |
492 |
|
{ |
462 |
– |
extern int psample; |
463 |
– |
extern double maxdiff; |
464 |
– |
extern double minweight; |
465 |
– |
extern int maxdepth; |
466 |
– |
extern double dstrsrc; |
467 |
– |
extern double shadthresh; |
468 |
– |
extern double shadcert; |
469 |
– |
extern COLOR ambval; |
470 |
– |
extern double ambacc; |
471 |
– |
extern int ambres; |
472 |
– |
extern int ambdiv; |
473 |
– |
extern int ambssamp; |
474 |
– |
extern int ambounce; |
475 |
– |
extern int directvis; |
476 |
– |
extern double srcsizerat; |
477 |
– |
extern int do_irrad; |
478 |
– |
extern double specjitter; |
479 |
– |
extern double specthresh; |
493 |
|
char buf[128]; |
494 |
|
|
495 |
|
if (s[0] == '\0') { |
496 |
|
(*dev->comout)( |
497 |
< |
"aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: "); |
497 |
> |
"aa ab ad ar as av aw b dc dv dj ds dt i lr lw me ma mg ms ps pt sj st bv: "); |
498 |
|
(*dev->comin)(buf, NULL); |
499 |
|
s = buf; |
500 |
|
} |
502 |
|
case 'l': /* limit */ |
503 |
|
switch (s[1]) { |
504 |
|
case 'w': /* weight */ |
505 |
< |
getparam(s+2, "limit weight", 'r', &minweight); |
505 |
> |
getparam(s+2, "limit weight", 'r', |
506 |
> |
(void *)&minweight); |
507 |
|
break; |
508 |
|
case 'r': /* reflection */ |
509 |
< |
getparam(s+2, "limit reflection", 'i', &maxdepth); |
509 |
> |
getparam(s+2, "limit reflection", 'i', |
510 |
> |
(void *)&maxdepth); |
511 |
|
break; |
512 |
|
default: |
513 |
|
goto badparam; |
516 |
|
case 'd': /* direct */ |
517 |
|
switch (s[1]) { |
518 |
|
case 'j': /* jitter */ |
519 |
< |
getparam(s+2, "direct jitter", 'r', &dstrsrc); |
519 |
> |
getparam(s+2, "direct jitter", 'r', |
520 |
> |
(void *)&dstrsrc); |
521 |
|
break; |
522 |
|
case 'c': /* certainty */ |
523 |
< |
getparam(s+2, "direct certainty", 'r', &shadcert); |
523 |
> |
getparam(s+2, "direct certainty", 'r', |
524 |
> |
(void *)&shadcert); |
525 |
|
break; |
526 |
|
case 't': /* threshold */ |
527 |
< |
getparam(s+2, "direct threshold", 'r', &shadthresh); |
527 |
> |
getparam(s+2, "direct threshold", 'r', |
528 |
> |
(void *)&shadthresh); |
529 |
|
break; |
530 |
|
case 'v': /* visibility */ |
531 |
< |
getparam(s+2, "direct visibility", |
532 |
< |
'b', &directvis); |
531 |
> |
getparam(s+2, "direct visibility", 'b', |
532 |
> |
(void *)&directvis); |
533 |
|
break; |
534 |
|
case 's': /* sampling */ |
535 |
< |
getparam(s+2, "direct sampling", 'r', &srcsizerat); |
535 |
> |
getparam(s+2, "direct sampling", 'r', |
536 |
> |
(void *)&srcsizerat); |
537 |
|
break; |
538 |
|
default: |
539 |
|
goto badparam; |
540 |
|
} |
541 |
|
break; |
542 |
< |
case 'b': /* black and white */ |
543 |
< |
getparam(s+1, "black and white", 'b', &greyscale); |
542 |
> |
case 'b': /* back faces or black and white */ |
543 |
> |
switch (s[1]) { |
544 |
> |
case 'v': /* back face visibility */ |
545 |
> |
getparam(s+2, "back face visibility", 'b', |
546 |
> |
(void *)&backvis); |
547 |
> |
break; |
548 |
> |
case '\0': /* black and white */ |
549 |
> |
case ' ': |
550 |
> |
case 'y': case 'Y': case 't': case 'T': case '1': case '+': |
551 |
> |
case 'n': case 'N': case 'f': case 'F': case '0': case '-': |
552 |
> |
getparam(s+1, "black and white", 'b', |
553 |
> |
(void *)&greyscale); |
554 |
> |
break; |
555 |
> |
default: |
556 |
> |
goto badparam; |
557 |
> |
} |
558 |
|
break; |
559 |
|
case 'i': /* irradiance */ |
560 |
< |
getparam(s+1, "irradiance", 'b', &do_irrad); |
560 |
> |
getparam(s+1, "irradiance", 'b', |
561 |
> |
(void *)&do_irrad); |
562 |
|
break; |
563 |
|
case 'a': /* ambient */ |
564 |
|
switch (s[1]) { |
565 |
|
case 'v': /* value */ |
566 |
< |
getparam(s+2, "ambient value", 'C', (COLOR *)ambval); |
566 |
> |
getparam(s+2, "ambient value", 'C', |
567 |
> |
(void *)ambval); |
568 |
|
break; |
569 |
+ |
case 'w': /* weight */ |
570 |
+ |
getparam(s+2, "ambient value weight", 'i', |
571 |
+ |
(void *)&ambvwt); |
572 |
+ |
break; |
573 |
|
case 'a': /* accuracy */ |
574 |
< |
if (getparam(s+2, "ambient accuracy", 'r', &ambacc)) |
574 |
> |
if (getparam(s+2, "ambient accuracy", 'r', |
575 |
> |
(void *)&ambacc)) |
576 |
|
setambacc(ambacc); |
577 |
|
break; |
578 |
|
case 'd': /* divisions */ |
579 |
< |
getparam(s+2, "ambient divisions", 'i', &ambdiv); |
579 |
> |
getparam(s+2, "ambient divisions", 'i', |
580 |
> |
(void *)&ambdiv); |
581 |
|
break; |
582 |
|
case 's': /* samples */ |
583 |
< |
getparam(s+2, "ambient super-samples", 'i', &ambssamp); |
583 |
> |
getparam(s+2, "ambient super-samples", 'i', |
584 |
> |
(void *)&ambssamp); |
585 |
|
break; |
586 |
|
case 'b': /* bounces */ |
587 |
< |
getparam(s+2, "ambient bounces", 'i', &ambounce); |
587 |
> |
getparam(s+2, "ambient bounces", 'i', |
588 |
> |
(void *)&ambounce); |
589 |
|
break; |
590 |
|
case 'r': |
591 |
< |
if (getparam(s+2, "ambient resolution", 'i', &ambres)) |
591 |
> |
if (getparam(s+2, "ambient resolution", 'i', |
592 |
> |
(void *)&ambres)) |
593 |
|
setambres(ambres); |
594 |
|
break; |
595 |
|
default: |
596 |
|
goto badparam; |
597 |
|
} |
598 |
|
break; |
599 |
+ |
case 'm': /* medium */ |
600 |
+ |
switch (s[1]) { |
601 |
+ |
case 'e': /* extinction coefficient */ |
602 |
+ |
getparam(s+2, "extinction coefficient", 'C', |
603 |
+ |
(void *)cextinction); |
604 |
+ |
break; |
605 |
+ |
case 'a': /* scattering albedo */ |
606 |
+ |
getparam(s+2, "scattering albedo", 'C', |
607 |
+ |
(void *)salbedo); |
608 |
+ |
break; |
609 |
+ |
case 'g': /* scattering eccentricity */ |
610 |
+ |
getparam(s+2, "scattering eccentricity", 'r', |
611 |
+ |
(void *)&seccg); |
612 |
+ |
break; |
613 |
+ |
case 's': /* sampling distance */ |
614 |
+ |
getparam(s+2, "mist sampling distance", 'r', |
615 |
+ |
(void *)&ssampdist); |
616 |
+ |
break; |
617 |
+ |
default: |
618 |
+ |
goto badparam; |
619 |
+ |
} |
620 |
+ |
break; |
621 |
|
case 'p': /* pixel */ |
622 |
|
switch (s[1]) { |
623 |
|
case 's': /* sample */ |
624 |
< |
if (getparam(s+2, "pixel sample", 'i', &psample)) |
624 |
> |
if (getparam(s+2, "pixel sample", 'i', |
625 |
> |
(void *)&psample)) |
626 |
|
pdepth = 0; |
627 |
|
break; |
628 |
|
case 't': /* threshold */ |
629 |
< |
if (getparam(s+2, "pixel threshold", 'r', &maxdiff)) |
629 |
> |
if (getparam(s+2, "pixel threshold", 'r', |
630 |
> |
(void *)&maxdiff)) |
631 |
|
pdepth = 0; |
632 |
|
break; |
633 |
|
default: |
637 |
|
case 's': /* specular */ |
638 |
|
switch (s[1]) { |
639 |
|
case 'j': /* jitter */ |
640 |
< |
getparam(s+2, "specular jitter", 'r', &specjitter); |
640 |
> |
getparam(s+2, "specular jitter", 'r', |
641 |
> |
(void *)&specjitter); |
642 |
|
break; |
643 |
|
case 't': /* threshold */ |
644 |
< |
getparam(s+2, "specular threshold", 'r', &specthresh); |
644 |
> |
getparam(s+2, "specular threshold", 'r', |
645 |
> |
(void *)&specthresh); |
646 |
|
break; |
647 |
|
default: |
648 |
|
goto badparam; |
660 |
|
} |
661 |
|
|
662 |
|
|
663 |
+ |
void |
664 |
|
traceray(s) /* trace a single ray */ |
665 |
|
char *s; |
666 |
|
{ |
667 |
|
char buf[128]; |
668 |
|
int x, y; |
669 |
+ |
OBJREC *ino; |
670 |
|
RAY thisray; |
671 |
|
|
672 |
+ |
thisray.rmax = 0.0; |
673 |
+ |
|
674 |
|
if (!sscanvec(s, thisray.rorg) || |
675 |
< |
!sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) { |
675 |
> |
!sscanvec(sskip2(s,3), thisray.rdir)) { |
676 |
|
|
677 |
|
if (dev->getcur == NULL) |
678 |
|
return; |
680 |
|
if ((*dev->getcur)(&x, &y) == ABORT) |
681 |
|
return; |
682 |
|
|
683 |
< |
if (viewray(thisray.rorg, thisray.rdir, &ourview, |
684 |
< |
(x+.5)/hresolu, (y+.5)/vresolu) < 0) { |
683 |
> |
if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, |
684 |
> |
&ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) { |
685 |
|
error(COMMAND, "not on image"); |
686 |
|
return; |
687 |
|
} |
698 |
|
if (thisray.ro == NULL) |
699 |
|
(*dev->comout)("ray hit nothing"); |
700 |
|
else { |
701 |
< |
sprintf(buf, "ray hit %s %s \"%s\"", |
702 |
< |
objptr(thisray.ro->omod)->oname, |
701 |
> |
sprintf(buf, "ray hit %s%s %s \"%s\"", |
702 |
> |
thisray.rod < 0.0 ? "back of " : "", |
703 |
> |
thisray.ro->omod == OVOID ? VOIDID : |
704 |
> |
objptr(thisray.ro->omod)->oname, |
705 |
|
ofun[thisray.ro->otype].funame, |
706 |
|
thisray.ro->oname); |
707 |
+ |
if ((ino = objptr(thisray.robj)) != thisray.ro) |
708 |
+ |
sprintf(buf+strlen(buf), " in %s \"%s\"", |
709 |
+ |
ofun[ino->otype].funame, ino->oname); |
710 |
|
(*dev->comout)(buf); |
711 |
|
(*dev->comin)(buf, NULL); |
712 |
|
if (thisray.rot >= FHUGE) |
713 |
|
(*dev->comout)("at infinity"); |
714 |
|
else { |
715 |
< |
sprintf(buf, "at (%.6g %.6g %.6g)", thisray.rop[0], |
716 |
< |
thisray.rop[1], thisray.rop[2]); |
715 |
> |
sprintf(buf, "at (%.6g %.6g %.6g) (%.6g)", |
716 |
> |
thisray.rop[0], thisray.rop[1], |
717 |
> |
thisray.rop[2], thisray.rt); |
718 |
|
(*dev->comout)(buf); |
719 |
|
} |
720 |
|
(*dev->comin)(buf, NULL); |
721 |
< |
sprintf(buf, "value (%.5g %.5g %.5g) (%.1fL)", |
721 |
> |
sprintf(buf, "value (%.5g %.5g %.5g) (%.3gL)", |
722 |
|
colval(thisray.rcol,RED), |
723 |
|
colval(thisray.rcol,GRN), |
724 |
|
colval(thisray.rcol,BLU), |
729 |
|
} |
730 |
|
|
731 |
|
|
732 |
+ |
void |
733 |
|
writepict(s) /* write the picture to a file */ |
734 |
|
char *s; |
735 |
|
{ |
739 |
|
COLR *scanline; |
740 |
|
int y; |
741 |
|
|
742 |
< |
if (sscanf(s, "%s", buf) != 1 && buf[0] == '\0') { |
742 |
> |
while (isspace(*s)) |
743 |
> |
s++; |
744 |
> |
if (*s) |
745 |
> |
atos(buf, sizeof(buf), s); |
746 |
> |
else if (buf[0] == '\0') { |
747 |
|
error(COMMAND, "no file"); |
748 |
|
return; |
749 |
|
} |
753 |
|
error(COMMAND, errmsg); |
754 |
|
return; |
755 |
|
} |
756 |
< |
#ifdef MSDOS |
672 |
< |
setmode(fileno(fp), O_BINARY); |
673 |
< |
#endif |
756 |
> |
SET_FILE_BINARY(fp); |
757 |
|
(*dev->comout)("writing \""); |
758 |
|
(*dev->comout)(fname); |
759 |
|
(*dev->comout)("\"...\n"); |
760 |
|
/* write header */ |
761 |
+ |
newheader("RADIANCE", fp); |
762 |
|
fputs(progname, fp); |
763 |
|
fprintview(&ourview, fp); |
764 |
|
if (octname != NULL) |
766 |
|
else |
767 |
|
putc('\n', fp); |
768 |
|
fprintf(fp, "SOFTWARE= %s\n", VersionID); |
769 |
+ |
fputnow(fp); |
770 |
|
if (exposure != 1.0) |
771 |
|
fputexpos(exposure, fp); |
772 |
|
if (dev->pixaspect != 1.0) |
787 |
|
if (fwritecolrs(scanline, hresolu, fp) < 0) |
788 |
|
break; |
789 |
|
} |
790 |
< |
free((char *)scanline); |
790 |
> |
free((void *)scanline); |
791 |
|
if (fclose(fp) < 0) |
792 |
|
error(COMMAND, "write error"); |
793 |
|
} |