--- ray/src/px/ra_ps.c 1992/07/13 10:53:42 2.3 +++ ray/src/px/ra_ps.c 1992/08/14 14:04:09 2.5 @@ -24,6 +24,7 @@ int wrongformat = 0; /* input in wrong format? */ double pixaspect = 1.0; /* pixel aspect ratio */ int bradj = 0; /* brightness adjustment */ +int ncopies = 1; /* number of copies */ char *progname; @@ -59,6 +60,9 @@ char *argv[]; goto userr; bradj = atoi(argv[++i]); break; + case 'n': /* number of copies */ + ncopies = atoi(argv[++i]); + break; default: goto userr; } @@ -115,13 +119,12 @@ char *name; printf("%%!\n"); printf("%%%%Title: %s\n", name); printf("%%%%Creator: %s\n", progname); - printf("%%%%Pages: 1\n"); + printf("%%%%Pages: %d\n", ncopies); if (landscape = xmax > pixaspect*ymax) printf("%%%%Landscape\n"); else printf("%%%%Portrait\n"); printf("%%%%EndComments\n"); - printf("gsave\n"); printf("64 dict begin\n"); /* define image reader */ PSprocdef("read6bit"); @@ -155,9 +158,10 @@ char *name; PStrailer() /* print PostScript trailer */ { puts("%%Trailer"); - puts("end"); + if (ncopies > 1) + printf("/#copies %d def\n", ncopies); puts("showpage"); - puts("grestore"); + puts("end"); puts("%%EOF"); } @@ -167,11 +171,13 @@ char *nam; { short itab[128]; register int i; - - for (i = 0; i < 128; i++) + /* assign code values */ + for (i = 0; i < 128; i++) /* clear */ itab[i] = -1; - for (i = 0; i < 64; i++) + for (i = 1; i < 63; i++) /* assign greys */ itab[code[i]] = i<<2 | 2; + itab[code[0]] = 0; /* black is black */ + itab[code[63]] = 255; /* and white is white */ printf("/decode ["); for (i = 0; i < 128; i++) { if (!(i & 0xf))