1 /************************************************************************/
2 /*									*/
3 /*  Emit raster images to PostScript.					*/
4 /*									*/
5 /************************************************************************/
6 
7 #   ifndef	MB_BITMAP_PRINTER_H
8 #   define	MB_BITMAP_PRINTER_H
9 
10 #   include	"bitmap.h"
11 #   include	"bmio.h"
12 
13 /************************************************************************/
14 /*									*/
15 /*  Context for writing images to PostScript.				*/
16 /*									*/
17 /************************************************************************/
18 
19 typedef struct BitmapPrinter
20     {
21     int				bpUseFilters;
22     int				bpIndexedImages;
23     SimpleOutputStream *	bpOutput;
24     SimpleOutputStream *	bpHexed;
25     SimpleOutputStream *	bpBase85;
26     SimpleOutputStream *	bpFlate;
27     } BitmapPrinter;
28 
29 extern int bmPsOpenBitmapPrinter(
30 				BitmapPrinter *			bp,
31 				SimpleOutputStream *		sos,
32 				const BitmapDescription *	bd,
33 				int				useFilters,
34 				int				indexedImages );
35 
36 extern void bmCloseBitmapPrinter(	BitmapPrinter *		bp );
37 
38 extern void bmStartEpsFile(	SimpleOutputStream *		sos,
39 				const char *			filename,
40 				const BitmapDescription *	bd );
41 
42 /************************************************************************/
43 /*									*/
44 /*  Write part of a bitmap to postscript.				*/
45 /*									*/
46 /************************************************************************/
47 
48 extern int bmPsPrintBitmap(	SimpleOutputStream *		sos,
49 				int				level,
50 				double				xscale,
51 				double				yscale,
52 				int				ox,
53 				int				oy,
54 				const DocumentRectangle *	drSrc,
55 				int				useFilters,
56 				int				indexedImages,
57 				const BitmapDescription *	bd,
58 				const unsigned char *		buffer );
59 
60 extern int bmPsPrintBitmapImage( SimpleOutputStream *		sos,
61 				int				level,
62 				double				xscale,
63 				double				yscale,
64 				int				ox,
65 				int				oy,
66 				const DocumentRectangle *	drSrc,
67 				int				onWhite,
68 				int				useFilters,
69 				int				indexedImages,
70 				const BitmapDescription *	bd,
71 				const unsigned char *		buffer );
72 
73 extern void bmPsWriteImageInstructions(
74 				SimpleOutputStream *		sos,
75 				const BitmapDescription *	bd,
76 				int				onWhite,
77 				int				wide,
78 				int				high,
79 				const char *			source,
80 				int				indexedImages );
81 
82 extern int bmPsWriteBitmapData(	BitmapPrinter *			bp,
83 				const DocumentRectangle *	drSrc,
84 				const BitmapDescription *	bd,
85 				const unsigned char *		inputBuffer );
86 
87 extern int bmPsRowStringSize(	const BitmapDescription *	bd,
88 				int				pixelsWide,
89 				int				indexedImages );
90 
91 #   endif
92