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.9 by greg, Thu Feb 10 21:59:53 1994 UTC vs.
Revision 2.10 by greg, Wed Sep 27 13:29:52 1995 UTC

# Line 127 | Line 127 | char  *name;
127          int  landscape = 0;
128          double  pwidth, pheight;
129          double  iwidth, iheight;
130 <
131 <        printf("%%!\n");
130 >                                        /* EPS comments */
131 >        puts("%%!PS-Adobe-2.0 EPSF-2.0");
132          printf("%%%%Title: %s\n", name);
133 <        printf("%%%%Creator: %s\n", progname);
133 >        printf("%%%%Creator: %s = %s\n", progname, SCCSid);
134          printf("%%%%Pages: %d\n", ncopies);
135          if (landscape = xmax > pixaspect*ymax)
136 <                printf("%%%%Landscape\n");
136 >                puts("%%Orientation: Landscape");
137          else
138 <                printf("%%%%Portrait\n");
139 <        printf("%%%%EndComments\n");
140 <        printf("64 dict begin\n");
141 <                                        /* define image reader */
142 <        PSprocdef("read6bitRLE");
143 <                                        /* set up transformation matrix */
144 <        printf("%f %f translate\n", HMARGIN, VMARGIN);
138 >                puts("%%Orientation: Portrait");
139          if (PWIDTH > PHEIGHT ^ landscape) {
146                printf("0 %f translate\n", PHEIGHT);
147                printf("-90 rotate\n");
140                  pwidth = PHEIGHT;
141                  pheight = PWIDTH;
142          } else {
# Line 158 | Line 150 | char  *name;
150                  iheight = pheight;
151                  iwidth = pheight*xmax/(pixaspect*ymax);
152          }
153 +        if (pwidth == PHEIGHT)
154 +                printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
155 +                                HMARGIN+(pheight-iheight)*.5,
156 +                                VMARGIN+(pwidth-iwidth)*.5,
157 +                                HMARGIN+(pheight-iheight)*.5+iheight,
158 +                                VMARGIN+(pwidth-iwidth)*.5+iwidth);
159 +        else
160 +                printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
161 +                                HMARGIN+(pwidth-iwidth)*.5,
162 +                                VMARGIN+(pheight-iheight)*.5,
163 +                                HMARGIN+(pwidth-iwidth)*.5+iwidth,
164 +                                VMARGIN+(pheight-iheight)*.5+iheight);
165 +        puts("%%EndComments");
166 +        puts("save");
167 +        puts("64 dict begin");
168 +                                        /* define image reader */
169 +        PSprocdef("read6bitRLE");
170 +                                        /* set up transformation matrix */
171 +        printf("%f %f translate\n", HMARGIN, VMARGIN);
172 +        if (pwidth == PHEIGHT) {
173 +                printf("0 %f translate\n", PHEIGHT);
174 +                puts("-90 rotate");
175 +        }
176          printf("%f %f translate\n", (pwidth-iwidth)*.5, (pheight-iheight)*.5);
177          printf("%f %f scale\n", iwidth, iheight);
178 <        printf("%%%%EndProlog\n");
178 >        puts("%%%%EndProlog");
179                                          /* start image procedure */
180          printf("%d %d 8 [%d 0 0 %d 0 %d] {read6bitRLE} image\n", xmax, ymax,
181                          xmax, -ymax, ymax);
# Line 174 | Line 189 | PStrailer()                    /* print PostScript trailer */
189                  printf("/#copies %d def\n", ncopies);
190          puts("showpage");
191          puts("end");
192 +        puts("restore");
193          puts("%%EOF");
194   }
195  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines