]>
git.ipfire.org Git - thirdparty/cups.git/blob - filter/imagetops.c
2 * "$Id: imagetops.c 6578 2007-06-20 17:46:04Z mike $"
4 * Image file to PostScript filter for the Common UNIX Printing System (CUPS).
6 * Copyright 1993-2007 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
28 * main() - Main entry...
29 * ps_hex() - Print binary data as a series of hexadecimal numbers.
30 * ps_ascii85() - Print binary data as a series of base-85 numbers.
34 * Include necessary headers...
40 #include <cups/i18n.h>
47 int Flip
= 0, /* Flip/mirror pages */
48 XPosition
= 0, /* Horizontal position on page */
49 YPosition
= 0, /* Vertical position on page */
50 Collate
= 0, /* Collate copies? */
51 Copies
= 1; /* Number of copies */
58 static void ps_hex(cups_ib_t
*, int, int);
59 static void ps_ascii85(cups_ib_t
*, int, int);
63 * 'main()' - Main entry...
66 int /* O - Exit status */
67 main(int argc
, /* I - Number of command-line arguments */
68 char *argv
[]) /* I - Command-line arguments */
70 cups_image_t
*img
; /* Image to print */
71 float xprint
, /* Printable area */
73 xinches
, /* Total size in inches */
75 float xsize
, /* Total size in points */
79 float aspect
; /* Aspect ratio */
80 int xpages
, /* # x pages */
81 ypages
, /* # y pages */
82 xpage
, /* Current x page */
83 ypage
, /* Current y page */
84 page
; /* Current page number */
85 int xc0
, yc0
, /* Corners of the page in image coords */
87 cups_ib_t
*row
; /* Current row */
88 int y
; /* Current Y coordinate in image */
89 int colorspace
; /* Output colorspace */
90 int out_offset
, /* Offset into output buffer */
91 out_length
; /* Length of output buffer */
92 ppd_file_t
*ppd
; /* PPD file */
93 ppd_choice_t
*choice
; /* PPD option choice */
94 int num_options
; /* Number of print options */
95 cups_option_t
*options
; /* Print options */
96 const char *val
; /* Option value */
97 int slowcollate
; /* Collate copies the slow way */
98 float g
; /* Gamma correction value */
99 float b
; /* Brightness factor */
100 float zoom
; /* Zoom facter */
101 int xppi
, yppi
; /* Pixels-per-inch */
102 int hue
, sat
; /* Hue and saturation adjustment */
103 int realcopies
, /* Real copies being printed */
104 emit_jcl
; /* Emit JCL? */
105 float left
, top
; /* Left and top of image */
106 char filename
[1024]; /* Name of file to print */
107 time_t curtime
; /* Current time */
108 struct tm
*curtm
; /* Current date */
109 char curdate
[255]; /* Current date string */
113 * Make sure status messages are not buffered...
116 setbuf(stderr
, NULL
);
119 * Check command-line...
122 if (argc
< 6 || argc
> 7)
124 fprintf(stderr
, _("Usage: %s job-id user title copies options [file]\n"),
130 * Copy stdin as needed...
135 int fd
; /* File to write to */
136 char buffer
[8192]; /* Buffer to read into */
137 int bytes
; /* # of bytes to read */
140 if ((fd
= cupsTempFd(filename
, sizeof(filename
))) < 0)
142 perror("ERROR: Unable to copy image file");
146 fprintf(stderr
, "DEBUG: imagetoraster - copying to temp print file \"%s\"\n",
149 while ((bytes
= fread(buffer
, 1, sizeof(buffer
), stdin
)) > 0)
150 write(fd
, buffer
, bytes
);
155 strlcpy(filename
, argv
[6], sizeof(filename
));
158 * Process command-line options and write the prolog...
169 Copies
= atoi(argv
[4]);
172 num_options
= cupsParseOptions(argv
[5], 0, &options
);
174 ppd
= SetCommonOptions(num_options
, options
, 0);
176 if ((val
= cupsGetOption("multiple-document-handling", num_options
, options
)) != NULL
)
179 * This IPP attribute is unnecessarily complicated...
181 * single-document, separate-documents-collated-copies, and
182 * single-document-new-sheet all require collated copies.
184 * separate-documents-uncollated-copies allows for uncollated copies.
187 Collate
= strcasecmp(val
, "separate-documents-uncollated-copies") != 0;
190 if ((val
= cupsGetOption("Collate", num_options
, options
)) != NULL
&&
191 strcasecmp(val
, "True") == 0)
194 if ((val
= cupsGetOption("gamma", num_options
, options
)) != NULL
)
197 * Get gamma value from 1 to 10000...
200 g
= atoi(val
) * 0.001f
;
208 if ((val
= cupsGetOption("brightness", num_options
, options
)) != NULL
)
211 * Get brightness value from 10 to 1000.
214 b
= atoi(val
) * 0.01f
;
222 if ((val
= cupsGetOption("scaling", num_options
, options
)) != NULL
)
223 zoom
= atoi(val
) * 0.01;
224 else if (cupsGetOption("fitplot", num_options
, options
))
227 if ((val
= cupsGetOption("ppi", num_options
, options
)) != NULL
)
228 if (sscanf(val
, "%dx%d", &xppi
, &yppi
) < 2)
231 if ((val
= cupsGetOption("position", num_options
, options
)) != NULL
)
233 if (strcasecmp(val
, "center") == 0)
238 else if (strcasecmp(val
, "top") == 0)
243 else if (strcasecmp(val
, "left") == 0)
248 else if (strcasecmp(val
, "right") == 0)
253 else if (strcasecmp(val
, "top-left") == 0)
258 else if (strcasecmp(val
, "top-right") == 0)
263 else if (strcasecmp(val
, "bottom") == 0)
268 else if (strcasecmp(val
, "bottom-left") == 0)
273 else if (strcasecmp(val
, "bottom-right") == 0)
280 if ((val
= cupsGetOption("saturation", num_options
, options
)) != NULL
)
283 if ((val
= cupsGetOption("hue", num_options
, options
)) != NULL
)
286 if ((choice
= ppdFindMarkedChoice(ppd
, "MirrorPrint")) != NULL
)
288 val
= choice
->choice
;
292 val
= cupsGetOption("mirror", num_options
, options
);
294 if (val
&& (!strcasecmp(val
, "true") || !strcasecmp(val
, "on") ||
295 !strcasecmp(val
, "yes")))
298 if ((val
= cupsGetOption("emit-jcl", num_options
, options
)) != NULL
&&
299 (!strcasecmp(val
, "false") || !strcasecmp(val
, "off") ||
300 !strcasecmp(val
, "no") || !strcmp(val
, "0")))
306 * Open the input image to print...
309 colorspace
= ColorDevice
? CUPS_IMAGE_RGB_CMYK
: CUPS_IMAGE_WHITE
;
311 img
= cupsImageOpen(filename
, colorspace
, CUPS_IMAGE_WHITE
, sat
, hue
, NULL
);
318 fputs(_("ERROR: Unable to open image file for printing!\n"), stderr
);
323 colorspace
= cupsImageGetColorSpace(img
);
326 * Scale as necessary...
329 if (zoom
== 0.0 && xppi
== 0)
331 xppi
= cupsImageGetXPPI(img
);
332 yppi
= cupsImageGetYPPI(img
);
338 fprintf(stderr
, "DEBUG: Before scaling: xppi=%d, yppi=%d, zoom=%.2f\n",
344 * Scale the image as neccesary to match the desired pixels-per-inch.
349 xprint
= (PageTop
- PageBottom
) / 72.0;
350 yprint
= (PageRight
- PageLeft
) / 72.0;
354 xprint
= (PageRight
- PageLeft
) / 72.0;
355 yprint
= (PageTop
- PageBottom
) / 72.0;
358 fprintf(stderr
, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n",
361 xinches
= (float)cupsImageGetWidth(img
) / (float)xppi
;
362 yinches
= (float)cupsImageGetHeight(img
) / (float)yppi
;
364 fprintf(stderr
, "DEBUG: Image size is %.1f x %.1f inches...\n",
367 if ((val
= cupsGetOption("natural-scaling", num_options
, options
)) != NULL
)
369 xinches
= xinches
* atoi(val
) / 100;
370 yinches
= yinches
* atoi(val
) / 100;
373 if (cupsGetOption("orientation-requested", num_options
, options
) == NULL
&&
374 cupsGetOption("landscape", num_options
, options
) == NULL
)
377 * Rotate the image if it will fit landscape but not portrait...
380 fputs("DEBUG: Auto orientation...\n", stderr
);
382 if ((xinches
> xprint
|| yinches
> yprint
) &&
383 xinches
<= yprint
&& yinches
<= xprint
)
386 * Rotate the image as needed...
389 fputs("DEBUG: Using landscape orientation...\n", stderr
);
391 Orientation
= (Orientation
+ 1) & 3;
401 * Scale percentage of page size...
404 xprint
= (PageRight
- PageLeft
) / 72.0;
405 yprint
= (PageTop
- PageBottom
) / 72.0;
406 aspect
= (float)cupsImageGetYPPI(img
) / (float)cupsImageGetXPPI(img
);
408 fprintf(stderr
, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n",
411 fprintf(stderr
, "DEBUG: cupsImageGetXPPI(img) = %d, cupsImageGetYPPI(img) = %d, aspect = %f\n",
412 cupsImageGetXPPI(img
), cupsImageGetYPPI(img
), aspect
);
414 xsize
= xprint
* zoom
;
415 ysize
= xsize
* cupsImageGetHeight(img
) / cupsImageGetWidth(img
) / aspect
;
417 if (ysize
> (yprint
* zoom
))
419 ysize
= yprint
* zoom
;
420 xsize
= ysize
* cupsImageGetWidth(img
) * aspect
/ cupsImageGetHeight(img
);
423 xsize2
= yprint
* zoom
;
424 ysize2
= xsize2
* cupsImageGetHeight(img
) / cupsImageGetWidth(img
) / aspect
;
426 if (ysize2
> (xprint
* zoom
))
428 ysize2
= xprint
* zoom
;
429 xsize2
= ysize2
* cupsImageGetWidth(img
) * aspect
/ cupsImageGetHeight(img
);
432 fprintf(stderr
, "DEBUG: Portrait size is %.2f x %.2f inches\n", xsize
, ysize
);
433 fprintf(stderr
, "DEBUG: Landscape size is %.2f x %.2f inches\n", xsize2
, ysize2
);
435 if (cupsGetOption("orientation-requested", num_options
, options
) == NULL
&&
436 cupsGetOption("landscape", num_options
, options
) == NULL
)
439 * Choose the rotation with the largest area, but prefer
440 * portrait if they are equal...
443 fputs("DEBUG: Auto orientation...\n", stderr
);
445 if ((xsize
* ysize
) < (xsize2
* xsize2
))
448 * Do landscape orientation...
451 fputs("DEBUG: Using landscape orientation...\n", stderr
);
456 xprint
= (PageTop
- PageBottom
) / 72.0;
457 yprint
= (PageRight
- PageLeft
) / 72.0;
462 * Do portrait orientation...
465 fputs("DEBUG: Using portrait orientation...\n", stderr
);
472 else if (Orientation
& 1)
474 fputs("DEBUG: Using landscape orientation...\n", stderr
);
478 xprint
= (PageTop
- PageBottom
) / 72.0;
479 yprint
= (PageRight
- PageLeft
) / 72.0;
483 fputs("DEBUG: Using portrait orientation...\n", stderr
);
487 xprint
= (PageRight
- PageLeft
) / 72.0;
488 yprint
= (PageTop
- PageBottom
) / 72.0;
493 * Compute the number of pages to print and the size of the image on each
497 xpages
= ceil(xinches
/ xprint
);
498 ypages
= ceil(yinches
/ yprint
);
500 xprint
= xinches
/ xpages
;
501 yprint
= yinches
/ ypages
;
503 fprintf(stderr
, "DEBUG: xpages = %dx%.2fin, ypages = %dx%.2fin\n",
504 xpages
, xprint
, ypages
, yprint
);
507 * Update the page size for custom sizes...
510 if ((choice
= ppdFindMarkedChoice(ppd
, "PageSize")) != NULL
&&
511 strcasecmp(choice
->choice
, "Custom") == 0)
513 float width
, /* New width in points */
514 length
; /* New length in points */
515 char s
[255]; /* New custom page size... */
519 * Use the correct width and length for the current orientation...
524 width
= yprint
* 72.0;
525 length
= xprint
* 72.0;
529 width
= xprint
* 72.0;
530 length
= yprint
* 72.0;
534 * Add margins to page size...
537 width
+= ppd
->custom_margins
[0] + ppd
->custom_margins
[2];
538 length
+= ppd
->custom_margins
[1] + ppd
->custom_margins
[3];
541 * Enforce minimums...
544 if (width
< ppd
->custom_min
[0])
545 width
= ppd
->custom_min
[0];
547 if (length
< ppd
->custom_min
[1])
548 length
= ppd
->custom_min
[1];
550 fprintf(stderr
, "DEBUG: Updated custom page size to %.2f x %.2f inches...\n",
551 width
/ 72.0, length
/ 72.0);
554 * Set the new custom size...
557 sprintf(s
, "Custom.%.0fx%.0f", width
, length
);
558 ppdMarkOption(ppd
, "PageSize", s
);
561 * Update page variables...
566 PageLeft
= ppd
->custom_margins
[0];
567 PageRight
= width
- ppd
->custom_margins
[2];
568 PageBottom
= ppd
->custom_margins
[1];
569 PageTop
= length
- ppd
->custom_margins
[3];
573 * See if we need to collate, and if so how we need to do it...
576 if (xpages
== 1 && ypages
== 1)
579 slowcollate
= Collate
&& ppdFindOption(ppd
, "Collate") == NULL
;
581 if (Copies
> 1 && !slowcollate
)
590 * Write any "exit server" options that have been selected...
593 ppdEmit(ppd
, stdout
, PPD_ORDER_EXIT
);
596 * Write any JCL commands that are needed to print PostScript code...
600 ppdEmitJCL(ppd
, stdout
, atoi(argv
[1]), argv
[2], argv
[3]);
603 * Start sending the document with any commands needed...
606 curtime
= time(NULL
);
607 curtm
= localtime(&curtime
);
609 puts("%!PS-Adobe-3.0");
610 printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n", PageLeft
, PageBottom
,
612 printf("%%%%LanguageLevel: %d\n", LanguageLevel
);
613 printf("%%%%Pages: %d\n", xpages
* ypages
* Copies
);
614 puts("%%DocumentData: Clean7Bit");
615 puts("%%DocumentNeededResources: font Helvetica-Bold");
616 puts("%%Creator: imagetops/" CUPS_SVERSION
);
617 strftime(curdate
, sizeof(curdate
), "%c", curtm
);
618 printf("%%%%CreationDate: %s\n", curdate
);
619 WriteTextComment("Title", argv
[3]);
620 WriteTextComment("For", argv
[2]);
622 puts("%%Orientation: Landscape");
624 puts("%%Orientation: Portrait");
625 puts("%%EndComments");
626 puts("%%BeginProlog");
628 if (ppd
!= NULL
&& ppd
->patches
!= NULL
)
631 ppdEmit(ppd
, stdout
, PPD_ORDER_DOCUMENT
);
632 ppdEmit(ppd
, stdout
, PPD_ORDER_ANY
);
633 ppdEmit(ppd
, stdout
, PPD_ORDER_PROLOG
);
635 if (g
!= 1.0 || b
!= 1.0)
636 printf("{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
637 "ifelse %.3f mul } bind settransfer\n", g
, b
);
643 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
644 PageBottom
, PageTop
, PageWidth
);
648 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
649 PageLeft
, PageRight
, PageLength
);
653 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
654 PageLength
- PageTop
, PageLength
- PageBottom
,
659 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
660 PageWidth
- PageRight
, PageWidth
- PageLeft
,
667 if (ppd
== NULL
|| ppd
->language_level
== 1)
668 printf("/#copies %d def\n", realcopies
);
670 printf("<</NumCopies %d>>setpagedevice\n", realcopies
);
676 * Output the pages...
679 row
= malloc(cupsImageGetWidth(img
) * abs(colorspace
) + 3);
681 fprintf(stderr
, "DEBUG: XPosition=%d, YPosition=%d, Orientation=%d\n",
682 XPosition
, YPosition
, Orientation
);
683 fprintf(stderr
, "DEBUG: xprint=%.0f, yprint=%.0f\n", xprint
, yprint
);
684 fprintf(stderr
, "DEBUG: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f\n",
685 PageLeft
, PageRight
, PageWidth
);
686 fprintf(stderr
, "DEBUG: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f\n",
687 PageBottom
, PageTop
, PageLength
);
698 left
= (PageRight
+ PageLeft
- xprint
* 72) / 2;
701 left
= PageRight
- xprint
* 72;
708 top
= PageBottom
+ yprint
* 72;
711 top
= (PageTop
+ PageBottom
+ yprint
* 72) / 2;
726 left
= (PageTop
+ PageBottom
- xprint
* 72) / 2;
729 left
= PageTop
- xprint
* 72;
736 top
= PageLeft
+ yprint
* 72;
739 top
= (PageRight
+ PageLeft
+ yprint
* 72) / 2;
754 left
= (PageRight
+ PageLeft
- xprint
* 72) / 2;
757 left
= PageRight
- xprint
* 72;
764 top
= PageBottom
+ yprint
* 72;
767 top
= (PageTop
+ PageBottom
+ yprint
* 72) / 2;
782 left
= (PageTop
+ PageBottom
- xprint
* 72) / 2;
785 left
= PageTop
- xprint
* 72;
792 top
= PageLeft
+ yprint
* 72;
795 top
= (PageRight
+ PageLeft
+ yprint
* 72) / 2;
804 fprintf(stderr
, "DEBUG: left=%.2f, top=%.2f\n", left
, top
);
806 for (page
= 1; Copies
> 0; Copies
--)
807 for (xpage
= 0; xpage
< xpages
; xpage
++)
808 for (ypage
= 0; ypage
< ypages
; ypage
++, page
++)
810 if (ppd
&& ppd
->num_filters
== 0)
811 fprintf(stderr
, "PAGE: %d %d\n", page
, realcopies
);
813 fprintf(stderr
, _("INFO: Printing page %d...\n"), page
);
815 printf("%%%%Page: %d %d\n", page
, page
);
817 ppdEmit(ppd
, stdout
, PPD_ORDER_PAGE
);
822 printf("%.0f 0 translate -1 1 scale\n", PageWidth
);
826 case 1 : /* Landscape */
827 printf("%.0f 0 translate 90 rotate\n", PageWidth
);
829 case 2 : /* Reverse Portrait */
830 printf("%.0f %.0f translate 180 rotate\n", PageWidth
, PageLength
);
832 case 3 : /* Reverse Landscape */
833 printf("0 %.0f translate -90 rotate\n", PageLength
);
839 xc0
= cupsImageGetWidth(img
) * xpage
/ xpages
;
840 xc1
= cupsImageGetWidth(img
) * (xpage
+ 1) / xpages
- 1;
841 yc0
= cupsImageGetHeight(img
) * ypage
/ ypages
;
842 yc1
= cupsImageGetHeight(img
) * (ypage
+ 1) / ypages
- 1;
844 printf("%.1f %.1f translate\n", left
, top
);
846 printf("%.3f %.3f scale\n\n",
847 xprint
* 72.0 / (xc1
- xc0
+ 1),
848 yprint
* 72.0 / (yc1
- yc0
+ 1));
850 if (LanguageLevel
== 1)
852 printf("/picture %d string def\n", (xc1
- xc0
+ 1) * abs(colorspace
));
853 printf("%d %d 8[1 0 0 -1 0 1]", (xc1
- xc0
+ 1), (yc1
- yc0
+ 1));
855 if (colorspace
== CUPS_IMAGE_WHITE
)
856 puts("{currentfile picture readhexstring pop} image");
858 printf("{currentfile picture readhexstring pop} false %d colorimage\n",
861 for (y
= yc0
; y
<= yc1
; y
++)
863 cupsImageGetRow(img
, xc0
, y
, xc1
- xc0
+ 1, row
);
864 ps_hex(row
, (xc1
- xc0
+ 1) * abs(colorspace
), y
== yc1
);
871 case CUPS_IMAGE_WHITE
:
872 puts("/DeviceGray setcolorspace");
874 case CUPS_IMAGE_RGB
:
875 puts("/DeviceRGB setcolorspace");
877 case CUPS_IMAGE_CMYK
:
878 puts("/DeviceCMYK setcolorspace");
886 "/BitsPerComponent 8",
887 xc1
- xc0
+ 1, yc1
- yc0
+ 1);
891 case CUPS_IMAGE_WHITE
:
892 fputs("/Decode[0 1]", stdout
);
894 case CUPS_IMAGE_RGB
:
895 fputs("/Decode[0 1 0 1 0 1]", stdout
);
897 case CUPS_IMAGE_CMYK
:
898 fputs("/Decode[0 1 0 1 0 1 0 1]", stdout
);
902 fputs("\n/DataSource currentfile/ASCII85Decode filter", stdout
);
904 if (((xc1
- xc0
+ 1) / xprint
) < 100.0)
905 fputs("/Interpolate true", stdout
);
907 puts("/ImageMatrix[1 0 0 -1 0 1]>>image");
909 for (y
= yc0
, out_offset
= 0; y
<= yc1
; y
++)
911 cupsImageGetRow(img
, xc0
, y
, xc1
- xc0
+ 1, row
+ out_offset
);
913 out_length
= (xc1
- xc0
+ 1) * abs(colorspace
) + out_offset
;
914 out_offset
= out_length
& 3;
916 ps_ascii85(row
, out_length
, y
== yc1
);
919 memcpy(row
, row
+ out_length
- out_offset
, out_offset
);
932 * End the job with the appropriate JCL command or CTRL-D otherwise.
937 if (ppd
&& ppd
->jcl_end
)
938 ppdEmitJCLEnd(ppd
, stdout
);
955 * 'ps_hex()' - Print binary data as a series of hexadecimal numbers.
959 ps_hex(cups_ib_t
*data
, /* I - Data to print */
960 int length
, /* I - Number of bytes to print */
961 int last_line
) /* I - Last line of raster data? */
963 static int col
= 0; /* Current column */
964 static char *hex
= "0123456789ABCDEF";
971 * Put the hex chars out to the file; note that we don't use printf()
972 * for speed reasons...
975 putchar(hex
[*data
>> 4]);
976 putchar(hex
[*data
& 15]);
989 if (last_line
&& col
)
998 * 'ps_ascii85()' - Print binary data as a series of base-85 numbers.
1002 ps_ascii85(cups_ib_t
*data
, /* I - Data to print */
1003 int length
, /* I - Number of bytes to print */
1004 int last_line
) /* I - Last line of raster data? */
1006 unsigned b
; /* Binary data word */
1007 unsigned char c
[5]; /* ASCII85 encoded chars */
1008 static int col
= 0; /* Current column */
1013 b
= (((((data
[0] << 8) | data
[1]) << 8) | data
[2]) << 8) | data
[3];
1022 c
[4] = (b
% 85) + '!';
1024 c
[3] = (b
% 85) + '!';
1026 c
[2] = (b
% 85) + '!';
1028 c
[1] = (b
% 85) + '!';
1032 fwrite(c
, 5, 1, stdout
);
1050 memset(data
+ length
, 0, 4 - length
);
1051 b
= (((((data
[0] << 8) | data
[1]) << 8) | data
[2]) << 8) | data
[3];
1053 c
[4] = (b
% 85) + '!';
1055 c
[3] = (b
% 85) + '!';
1057 c
[2] = (b
% 85) + '!';
1059 c
[1] = (b
% 85) + '!';
1063 fwrite(c
, length
+ 1, 1, stdout
);
1073 * End of "$Id: imagetops.c 6578 2007-06-20 17:46:04Z mike $".