ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_ps.c
(Generate patch)

Comparing ray/src/px/ra_ps.c (file contents):
Revision 2.22 by gwlarson, Tue Oct 27 09:08:27 1998 UTC vs.
Revision 2.26 by schorsch, Sun Jul 27 22:12:03 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1997 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  Radiance picture to PostScript file translator -- one way!
6   */
# Line 11 | Line 8 | static char SCCSid[] = "$SunId$ SGI";
8   #include  <stdio.h>
9   #include  <math.h>
10   #include  <ctype.h>
11 < #ifdef MSDOS
12 < #include  <fcntl.h>
16 < #endif
11 >
12 > #include  "platform.h"
13   #include  "color.h"
14  
15   #define UPPER(c)        ((c)&~0x20)             /* ASCII trick */
# Line 61 | Line 57 | char  *progname;
57  
58   int  xmax, ymax;                        /* input image dimensions */
59  
64 extern char  *malloc();
60   extern double   unit2inch();
61  
62  
# Line 160 | Line 155 | char  *argv[];
155                                  progname, argv[i+1]);
156                  exit(1);
157          }
158 < #ifdef MSDOS
164 <        setmode(fileno(stdin), O_BINARY);
165 < #endif
158 >        SET_FILE_BINARY(stdin);
159                                  /* get our header */
160          getheader(stdin, headline, NULL);
161          if (wrongformat || fgetresolu(&xmax, &ymax, stdin) < 0)
# Line 193 | Line 186 | double
186   unit2inch(s)            /* determine unit */
187   register char   *s;
188   {
189 <        static struct unit {char n; float f} u[] = {
189 >        static struct unit {char n; float f;} u[] = {
190                  'i', 1.,
191                  'm', 1./25.4,
192                  'c', 1./2.54,
# Line 264 | Line 257 | char   *ps;
257                  height = atof(++s);
258                  width *= d;
259                  height *= d;
260 <                if (width >= 1. & height >= 1.)
260 >                if ((width >= 1.) & (height >= 1.))
261                          return;
262          } else                          /* check for match to standard size */
263                  for (pp = p; pp->n[0]; pp++)
# Line 305 | Line 298 | char  **av;
298                                          /* EPS comments */
299          puts("%!PS-Adobe-2.0 EPSF-2.0");
300          printf("%%%%Title: "); printargs(ac, av, stdout);
301 <        printf("%%%%Creator: %s\n", SCCSid);
301 >        printf("%%%%Creator: %s\n", progname);
302          printf("%%%%Pages: %d\n", ncopies);
303 <        if (landscape = xmax > pixaspect*ymax)
303 >        if ( (landscape = xmax > pixaspect*ymax) )
304                  puts("%%Orientation: Landscape");
305          else
306                  puts("%%Orientation: Portrait");
307 <        if (rotate = PWIDTH > PHEIGHT ^ landscape) {
307 >        if ( (rotate = (PWIDTH > PHEIGHT) ^ landscape) ) {
308                  pwidth = PHEIGHT;
309                  pheight = PWIDTH;
310          } else {
311                  pwidth = PWIDTH;
312                  pheight = PHEIGHT;
313          }
314 <        if (dpi > 100 && pixaspect >= 0.99 & pixaspect <= 1.01)
314 >        if (dpi > 100 && (pixaspect >= 0.99) & (pixaspect <= 1.01))
315                  if (pheight/pwidth > ymax/xmax) {
316                          n = pwidth*dpi/xmax;    /* floor */
317                          iwidth = n > 0 ? (double)(n*xmax)/dpi : pwidth;
# Line 474 | Line 467 | ra2ps()                                /* convert Radiance scanlines to 6-bit */
467          }
468          putchar('\n');
469                                                  /* free scanline */
470 <        free((char *)scanin);
470 >        free((void *)scanin);
471   }
472  
473  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines