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.1 by greg, Mon Jul 13 09:28:01 1992 UTC vs.
Revision 2.2 by greg, Mon Jul 13 09:53:14 1992 UTC

# Line 4 | Line 4
4   static char SCCSid[] = "$SunId$ LBL";
5   #endif
6  
7 /* Copyright (c) 1992 Regents of the University of California */
8
9 #ifndef lint
10 static char SCCSid[] = "$SunId$ LBL";
11 #endif
12
7   /*
8   *  Radiance picture to PostScript file translator -- one way!
9   */
# Line 116 | Line 110 | char  *name;
110   {
111          int  landscape = 0;
112          double  pwidth, pheight;
113 +        double  iwidth, iheight;
114  
115          printf("%%!\n");
116          printf("%%%%Title: %s\n", name);
# Line 129 | Line 124 | char  *name;
124          printf("gsave\n");
125          printf("64 dict begin\n");
126                                          /* set up transformation matrix */
127 <        printf("%f %f translate 1 -1 scale\n", HMARGIN, VMARGIN+PHEIGHT);
127 >        printf("%f %f translate\n", HMARGIN, VMARGIN);
128          if (PWIDTH > PHEIGHT ^ landscape) {
129                  printf("0 %f translate\n", PHEIGHT);
130 <                printf("90 rotate\n");
130 >                printf("-90 rotate\n");
131                  pwidth = PHEIGHT;
132                  pheight = PWIDTH;
133          } else {
# Line 140 | Line 135 | char  *name;
135                  pheight = PHEIGHT;
136          }
137          if (pheight/pwidth > pixaspect*ymax/xmax) {
138 <                printf("%f %f matrix scale\n", pwidth/xmax,
139 <                                pixaspect*pwidth/xmax);
145 <                printf("0 %f matrix translate\n",
146 <                                .5*(pheight-pwidth*pixaspect*ymax/xmax));
138 >                iwidth = pwidth;
139 >                iheight = pwidth*pixaspect*ymax/xmax;
140          } else {
141 <                printf("%f %f matrix scale\n", pheight/(ymax*pixaspect),
142 <                                pheight/ymax);
150 <                printf("%f 0 matrix translate\n",
151 <                                .5*(pwidth-pheight*xmax/(ymax*pixaspect)));
141 >                iheight = pheight;
142 >                iwidth = pheight*xmax/(pixaspect*ymax);
143          }
144 <        printf("matrix concatmatrix /imat exch def\n");
144 >        printf("%f %f translate\n", (pwidth-iwidth)*.5, (pheight-iheight)*.5);
145 >        printf("%f %f scale\n", iwidth, iheight);
146          PSprocdef("read6bit");
147          printf("%%%%EndProlog\n");
148 <        printf("%d %d 8 imat {read6bit} image", xmax, ymax);
148 >        printf("%d %d 8 [%d 0 0 %d 0 %d] {read6bit} image", xmax, ymax,
149 >                        xmax, -ymax, ymax);
150   }
151  
152  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines