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.20 by gregl, Fri Sep 26 14:20:38 1997 UTC vs.
Revision 2.23 by gwlarson, Mon Jul 19 09:53:06 1999 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ SGI";
19   #define UPPER(c)        ((c)&~0x20)             /* ASCII trick */
20  
21   #define CODE6GAM        1.47                    /* gamma for 6-bit codes */
22 < #define DEFDGAM         1.0                     /* default device gamma */
22 > #define DEFGGAM         1.0                     /* greyscale device gamma */
23 > #define DEFCGAM         1.8                     /* color device gamma */
24  
25   #define GRY             -1                      /* artificial index for grey */
26  
# Line 42 | Line 43 | char  code[] =                 /* 6-bit code lookup table */
43   int  wrongformat = 0;                   /* input in wrong format? */
44   double  pixaspect = 1.0;                /* pixel aspect ratio */
45  
46 < double  devgam = DEFDGAM;               /* device gamma response */
46 > double  devgam = 0.;                    /* device gamma response */
47   double  hmarg = DEFMARG,
48          vmarg = DEFMARG;                /* horizontal and vertical margins */
49   double  width = DEFWIDTH,
50          height = DEFHEIGHT;             /* default paper width and height */
51   double  dpi = 0;                        /* print density (0 if unknown) */
52 < int  docolor = 0;                       /* produce color image? */
52 > int  docolor = 1;                       /* produce color image? */
53   int  bradj = 0;                         /* brightness adjustment */
54   int  ncopies = 1;                       /* number of copies */
55  
# Line 64 | Line 65 | extern char  *malloc();
65   extern double   unit2inch();
66  
67  
68 + int
69   headline(s)             /* check header line */
70   char  *s;
71   {
# Line 74 | Line 76 | char  *s;
76                  wrongformat = strcmp(fmt, COLRFMT);
77          } else if (isaspect(s))
78                  pixaspect *= aspectval(s);
79 +        return(0);
80   }
81  
82  
# Line 165 | Line 168 | char  *argv[];
168          if (wrongformat || fgetresolu(&xmax, &ymax, stdin) < 0)
169                  quiterr("bad picture format");
170                                  /* gamma compression */
171 +        if (devgam <= 0.05)
172 +                devgam = docolor ? DEFCGAM : DEFGGAM;
173          if (putprim == Cputprim)
174                  setcolrgam(CODE6GAM);
175          else if (devgam != 1.)
176                  setcolrgam(devgam);
177                                  /* write header */
178 <        PSheader(i <= argc-1 ? argv[i] : "<stdin>");
178 >        PSheader(argc, argv);
179                                  /* convert file */
180          ra2ps();
181                                  /* write trailer */
# Line 188 | Line 193 | double
193   unit2inch(s)            /* determine unit */
194   register char   *s;
195   {
196 <        static struct unit {char n; float f} u[] = {
196 >        static struct unit {char n; float f;} u[] = {
197                  'i', 1.,
198                  'm', 1./25.4,
199                  'c', 1./2.54,
# Line 289 | Line 294 | char  *err;
294   }
295  
296  
297 < PSheader(name)                  /* print PostScript header */
298 < char  *name;
297 > PSheader(ac, av)                /* print PostScript header */
298 > int  ac;
299 > char  **av;
300   {
301          char  *rstr;
302          int  landscape, rotate, n;
# Line 298 | Line 304 | char  *name;
304          double  iwidth, iheight;
305                                          /* EPS comments */
306          puts("%!PS-Adobe-2.0 EPSF-2.0");
307 <        printf("%%%%Title: %s\n", name);
308 <        printf("%%%%Creator: %s = %s\n", progname, SCCSid);
307 >        printf("%%%%Title: "); printargs(ac, av, stdout);
308 >        printf("%%%%Creator: %s\n", SCCSid);
309          printf("%%%%Pages: %d\n", ncopies);
310          if (landscape = xmax > pixaspect*ymax)
311                  puts("%%Orientation: Landscape");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines