]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
ac884b6a | 2 | * "$Id$" |
ef416fc2 | 3 | * |
c7017ecc | 4 | * Raster file definitions for CUPS. |
ef416fc2 | 5 | * |
c7017ecc | 6 | * Copyright 2007-2010 by Apple Inc. |
ef416fc2 | 7 | * Copyright 1997-2006 by Easy Software Products. |
8 | * | |
9 | * This file is part of the CUPS Imaging library. | |
10 | * | |
11 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 12 | * property of Apple Inc. and are protected by Federal copyright |
13 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
14 | * which should have been included with this file. If this file is | |
15 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 16 | * |
ef416fc2 | 17 | * This file is subject to the Apple OS-Developed Software exception. |
18 | */ | |
19 | ||
20 | #ifndef _CUPS_RASTER_H_ | |
21 | # define _CUPS_RASTER_H_ | |
22 | ||
23 | /* | |
24 | * Include necessary headers... | |
25 | */ | |
26 | ||
aaf19ab0 MS |
27 | # include "cups.h" |
28 | # include "ppd.h" | |
29 | ||
ef416fc2 | 30 | |
31 | # ifdef __cplusplus | |
32 | extern "C" { | |
33 | # endif /* __cplusplus */ | |
34 | ||
35 | /* | |
36 | * Every non-PostScript printer driver that supports raster images | |
37 | * should use the application/vnd.cups-raster image file format. | |
38 | * Since both the PostScript RIP (pstoraster, based on GNU/GPL | |
39 | * Ghostscript) and Image RIP (imagetoraster, located in the filter | |
40 | * directory) use it, using this format saves you a lot of work. | |
41 | * Also, the PostScript RIP passes any printer options that are in | |
42 | * a PS file to your driver this way as well... | |
43 | */ | |
44 | ||
45 | /* | |
46 | * Constants... | |
47 | */ | |
48 | ||
ed486911 | 49 | # define CUPS_RASTER_SYNC 0x52615333 /* RaS3 */ |
50 | # define CUPS_RASTER_REVSYNC 0x33536152 /* 3SaR */ | |
ef416fc2 | 51 | |
52 | # define CUPS_RASTER_SYNCv1 0x52615374 /* RaSt */ | |
53 | # define CUPS_RASTER_REVSYNCv1 0x74536152 /* tSaR */ | |
54 | ||
ed486911 | 55 | # define CUPS_RASTER_SYNCv2 0x52615332 /* RaS2 */ |
56 | # define CUPS_RASTER_REVSYNCv2 0x32536152 /* 2SaR */ | |
57 | ||
c8fef167 MS |
58 | # define CUPS_RASTER_SYNC_PWG CUPS_RASTER_SYNCv2 |
59 | ||
ef416fc2 | 60 | |
61 | /* | |
62 | * The following definition can be used to determine if the | |
63 | * colorimetric colorspaces (CIEXYZ, CIELAB, and ICCn) are | |
64 | * defined... | |
65 | */ | |
66 | ||
67 | # define CUPS_RASTER_HAVE_COLORIMETRIC 1 | |
68 | ||
69 | ||
70 | /* | |
71 | * Types... | |
72 | */ | |
73 | ||
ef416fc2 | 74 | typedef enum cups_adv_e /**** AdvanceMedia attribute values ****/ |
75 | { | |
76 | CUPS_ADVANCE_NONE = 0, /* Never advance the roll */ | |
77 | CUPS_ADVANCE_FILE = 1, /* Advance the roll after this file */ | |
78 | CUPS_ADVANCE_JOB = 2, /* Advance the roll after this job */ | |
79 | CUPS_ADVANCE_SET = 3, /* Advance the roll after this set */ | |
80 | CUPS_ADVANCE_PAGE = 4 /* Advance the roll after this page */ | |
81 | } cups_adv_t; | |
82 | ||
b86bc4cf | 83 | typedef enum cups_bool_e /**** Boolean type ****/ |
ef416fc2 | 84 | { |
b86bc4cf | 85 | CUPS_FALSE = 0, /* Logical false */ |
86 | CUPS_TRUE = 1 /* Logical true */ | |
87 | } cups_bool_t; | |
ef416fc2 | 88 | |
89 | typedef enum cups_cspace_e /**** cupsColorSpace attribute values ****/ | |
90 | { | |
c7017ecc MS |
91 | CUPS_CSPACE_W = 0, /* Luminance (DeviceGray, gamma 2.2 by default) */ |
92 | CUPS_CSPACE_RGB = 1, /* Red, green, blue (DeviceRGB, sRGB by default) */ | |
93 | CUPS_CSPACE_RGBA = 2, /* Red, green, blue, alpha (DeviceRGB, sRGB by default) */ | |
94 | CUPS_CSPACE_K = 3, /* Black (DeviceK) */ | |
95 | CUPS_CSPACE_CMY = 4, /* Cyan, magenta, yellow (DeviceCMY) */ | |
96 | CUPS_CSPACE_YMC = 5, /* Yellow, magenta, cyan @deprecated@ */ | |
97 | CUPS_CSPACE_CMYK = 6, /* Cyan, magenta, yellow, black (DeviceCMYK) */ | |
98 | CUPS_CSPACE_YMCK = 7, /* Yellow, magenta, cyan, black @deprecated@ */ | |
99 | CUPS_CSPACE_KCMY = 8, /* Black, cyan, magenta, yellow @deprecated@ */ | |
100 | CUPS_CSPACE_KCMYcm = 9, /* Black, cyan, magenta, yellow, light-cyan, light-magenta @deprecated@ */ | |
101 | CUPS_CSPACE_GMCK = 10, /* Gold, magenta, yellow, black @deprecated@ */ | |
102 | CUPS_CSPACE_GMCS = 11, /* Gold, magenta, yellow, silver @deprecated@ */ | |
103 | CUPS_CSPACE_WHITE = 12, /* White ink (as black) @deprecated@ */ | |
104 | CUPS_CSPACE_GOLD = 13, /* Gold foil @deprecated@ */ | |
105 | CUPS_CSPACE_SILVER = 14, /* Silver foil @deprecated@ */ | |
ef416fc2 | 106 | |
426c6a59 MS |
107 | CUPS_CSPACE_CIEXYZ = 15, /* CIE XYZ @since CUPS 1.1.19/Mac OS X 10.3@ */ |
108 | CUPS_CSPACE_CIELab = 16, /* CIE Lab @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
c7017ecc MS |
109 | CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white (DeviceRGB, sRGB by default) @since CUPS 1.2/Mac OS X 10.5@ */ |
110 | CUPS_CSPACE_SW = 18, /* Luminance (gamma 2.2) @since CUPS 1.4.5@ */ | |
111 | CUPS_CSPACE_SRGB = 19, /* Red, green, blue (sRGB) @since CUPS 1.4.5@ */ | |
112 | CUPS_CSPACE_ADOBERGB = 20, /* Red, green, blue (Adobe RGB) @since CUPS 1.4.5@ */ | |
ef416fc2 | 113 | |
426c6a59 MS |
114 | CUPS_CSPACE_ICC1 = 32, /* ICC-based, 1 color @since CUPS 1.1.19/Mac OS X 10.3@ */ |
115 | CUPS_CSPACE_ICC2 = 33, /* ICC-based, 2 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
116 | CUPS_CSPACE_ICC3 = 34, /* ICC-based, 3 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
117 | CUPS_CSPACE_ICC4 = 35, /* ICC-based, 4 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
118 | CUPS_CSPACE_ICC5 = 36, /* ICC-based, 5 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
119 | CUPS_CSPACE_ICC6 = 37, /* ICC-based, 6 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
120 | CUPS_CSPACE_ICC7 = 38, /* ICC-based, 7 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
121 | CUPS_CSPACE_ICC8 = 39, /* ICC-based, 8 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
122 | CUPS_CSPACE_ICC9 = 40, /* ICC-based, 9 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
123 | CUPS_CSPACE_ICCA = 41, /* ICC-based, 10 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
124 | CUPS_CSPACE_ICCB = 42, /* ICC-based, 11 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
125 | CUPS_CSPACE_ICCC = 43, /* ICC-based, 12 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
126 | CUPS_CSPACE_ICCD = 44, /* ICC-based, 13 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
127 | CUPS_CSPACE_ICCE = 45, /* ICC-based, 14 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
c7017ecc MS |
128 | CUPS_CSPACE_ICCF = 46, /* ICC-based, 15 colors @since CUPS 1.1.19/Mac OS X 10.3@ */ |
129 | ||
130 | CUPS_CSPACE_DEVICE1 = 48, /* DeviceN, 1 color @since CUPS 1.4.5@ */ | |
131 | CUPS_CSPACE_DEVICE2 = 49, /* DeviceN, 2 colors @since CUPS 1.4.5@ */ | |
132 | CUPS_CSPACE_DEVICE3 = 50, /* DeviceN, 3 colors @since CUPS 1.4.5@ */ | |
133 | CUPS_CSPACE_DEVICE4 = 51, /* DeviceN, 4 colors @since CUPS 1.4.5@ */ | |
134 | CUPS_CSPACE_DEVICE5 = 52, /* DeviceN, 5 colors @since CUPS 1.4.5@ */ | |
135 | CUPS_CSPACE_DEVICE6 = 53, /* DeviceN, 6 colors @since CUPS 1.4.5@ */ | |
136 | CUPS_CSPACE_DEVICE7 = 54, /* DeviceN, 7 colors @since CUPS 1.4.5@ */ | |
137 | CUPS_CSPACE_DEVICE8 = 55, /* DeviceN, 8 colors @since CUPS 1.4.5@ */ | |
138 | CUPS_CSPACE_DEVICE9 = 56, /* DeviceN, 9 colors @since CUPS 1.4.5@ */ | |
139 | CUPS_CSPACE_DEVICEA = 57, /* DeviceN, 10 colors @since CUPS 1.4.5@ */ | |
140 | CUPS_CSPACE_DEVICEB = 58, /* DeviceN, 11 colors @since CUPS 1.4.5@ */ | |
141 | CUPS_CSPACE_DEVICEC = 59, /* DeviceN, 12 colors @since CUPS 1.4.5@ */ | |
142 | CUPS_CSPACE_DEVICED = 60, /* DeviceN, 13 colors @since CUPS 1.4.5@ */ | |
143 | CUPS_CSPACE_DEVICEE = 61, /* DeviceN, 14 colors @since CUPS 1.4.5@ */ | |
144 | CUPS_CSPACE_DEVICEF = 62 /* DeviceN, 15 colors @since CUPS 1.4.5@ */ | |
ef416fc2 | 145 | } cups_cspace_t; |
146 | ||
b86bc4cf | 147 | typedef enum cups_cut_e /**** CutMedia attribute values ****/ |
148 | { | |
149 | CUPS_CUT_NONE = 0, /* Never cut the roll */ | |
150 | CUPS_CUT_FILE = 1, /* Cut the roll after this file */ | |
151 | CUPS_CUT_JOB = 2, /* Cut the roll after this job */ | |
152 | CUPS_CUT_SET = 3, /* Cut the roll after this set */ | |
153 | CUPS_CUT_PAGE = 4 /* Cut the roll after this page */ | |
154 | } cups_cut_t; | |
155 | ||
156 | typedef enum cups_edge_e /**** LeadingEdge attribute values ****/ | |
157 | { | |
158 | CUPS_EDGE_TOP = 0, /* Leading edge is the top of the page */ | |
159 | CUPS_EDGE_RIGHT = 1, /* Leading edge is the right of the page */ | |
160 | CUPS_EDGE_BOTTOM = 2, /* Leading edge is the bottom of the page */ | |
161 | CUPS_EDGE_LEFT = 3 /* Leading edge is the left of the page */ | |
162 | } cups_edge_t; | |
163 | ||
164 | typedef enum cups_jog_e /**** Jog attribute values ****/ | |
165 | { | |
166 | CUPS_JOG_NONE = 0, /* Never move pages */ | |
167 | CUPS_JOG_FILE = 1, /* Move pages after this file */ | |
168 | CUPS_JOG_JOB = 2, /* Move pages after this job */ | |
169 | CUPS_JOG_SET = 3 /* Move pages after this set */ | |
170 | } cups_jog_t; | |
171 | ||
5a738aea | 172 | enum cups_mode_e /**** cupsRasterOpen modes ****/ |
b86bc4cf | 173 | { |
174 | CUPS_RASTER_READ = 0, /* Open stream for reading */ | |
f7deaa1a | 175 | CUPS_RASTER_WRITE = 1, /* Open stream for writing */ |
c8fef167 MS |
176 | CUPS_RASTER_WRITE_COMPRESSED = 2, /* Open stream for compressed writing @since CUPS 1.3/Mac OS X 10.5@ */ |
177 | CUPS_RASTER_WRITE_PWG = 3 /* Open stream for compressed writing in PWG mode @since CUPS 1.5@ */ | |
5a738aea MS |
178 | }; |
179 | ||
180 | typedef enum cups_mode_e cups_mode_t; /**** cupsRasterOpen modes ****/ | |
b86bc4cf | 181 | |
182 | typedef enum cups_order_e /**** cupsColorOrder attribute values ****/ | |
183 | { | |
184 | CUPS_ORDER_CHUNKED = 0, /* CMYK CMYK CMYK ... */ | |
185 | CUPS_ORDER_BANDED = 1, /* CCC MMM YYY KKK ... */ | |
186 | CUPS_ORDER_PLANAR = 2 /* CCC ... MMM ... YYY ... KKK ... */ | |
187 | } cups_order_t; | |
188 | ||
189 | typedef enum cups_orient_e /**** Orientation attribute values ****/ | |
190 | { | |
191 | CUPS_ORIENT_0 = 0, /* Don't rotate the page */ | |
192 | CUPS_ORIENT_90 = 1, /* Rotate the page counter-clockwise */ | |
193 | CUPS_ORIENT_180 = 2, /* Turn the page upside down */ | |
194 | CUPS_ORIENT_270 = 3 /* Rotate the page clockwise */ | |
195 | } cups_orient_t; | |
196 | ||
ef416fc2 | 197 | |
198 | /* | |
199 | * The page header structure contains the standard PostScript page device | |
200 | * dictionary, along with some CUPS-specific parameters that are provided | |
201 | * by the RIPs... | |
202 | * | |
203 | * The API supports a "version 1" (from CUPS 1.0 and 1.1) and a "version 2" | |
204 | * (from CUPS 1.2 and higher) page header, for binary compatibility. | |
205 | */ | |
206 | ||
db0bd74a | 207 | typedef struct cups_page_header_s /**** Version 1 page header @deprecated@ ****/ |
ef416fc2 | 208 | { |
209 | /**** Standard Page Device Dictionary String Values ****/ | |
210 | char MediaClass[64]; /* MediaClass string */ | |
211 | char MediaColor[64]; /* MediaColor string */ | |
212 | char MediaType[64]; /* MediaType string */ | |
213 | char OutputType[64]; /* OutputType string */ | |
214 | ||
215 | /**** Standard Page Device Dictionary Integer Values ****/ | |
216 | unsigned AdvanceDistance; /* AdvanceDistance value in points */ | |
db0bd74a | 217 | cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */ |
ef416fc2 | 218 | cups_bool_t Collate; /* Collated copies value */ |
db0bd74a | 219 | cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */ |
ef416fc2 | 220 | cups_bool_t Duplex; /* Duplexed (double-sided) value */ |
221 | unsigned HWResolution[2]; /* Resolution in dots-per-inch */ | |
db0bd74a | 222 | unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */ |
ef416fc2 | 223 | cups_bool_t InsertSheet; /* InsertSheet value */ |
db0bd74a MS |
224 | cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */ |
225 | cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */ | |
ef416fc2 | 226 | unsigned Margins[2]; /* Lower-lefthand margins in points */ |
227 | cups_bool_t ManualFeed; /* ManualFeed value */ | |
228 | unsigned MediaPosition; /* MediaPosition value */ | |
229 | unsigned MediaWeight; /* MediaWeight value in grams/m^2 */ | |
230 | cups_bool_t MirrorPrint; /* MirrorPrint value */ | |
231 | cups_bool_t NegativePrint; /* NegativePrint value */ | |
232 | unsigned NumCopies; /* Number of copies to produce */ | |
db0bd74a | 233 | cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */ |
ef416fc2 | 234 | cups_bool_t OutputFaceUp; /* OutputFaceUp value */ |
235 | unsigned PageSize[2]; /* Width and length of page in points */ | |
236 | cups_bool_t Separations; /* Separations value */ | |
237 | cups_bool_t TraySwitch; /* TraySwitch value */ | |
238 | cups_bool_t Tumble; /* Tumble value */ | |
239 | ||
240 | /**** CUPS Page Device Dictionary Values ****/ | |
241 | unsigned cupsWidth; /* Width of page image in pixels */ | |
242 | unsigned cupsHeight; /* Height of page image in pixels */ | |
243 | unsigned cupsMediaType; /* Media type code */ | |
244 | unsigned cupsBitsPerColor; /* Number of bits for each color */ | |
245 | unsigned cupsBitsPerPixel; /* Number of bits for each pixel */ | |
246 | unsigned cupsBytesPerLine; /* Number of bytes per line */ | |
247 | cups_order_t cupsColorOrder; /* Order of colors */ | |
248 | cups_cspace_t cupsColorSpace; /* True colorspace */ | |
249 | unsigned cupsCompression; /* Device compression to use */ | |
250 | unsigned cupsRowCount; /* Rows per band */ | |
251 | unsigned cupsRowFeed; /* Feed between bands */ | |
252 | unsigned cupsRowStep; /* Spacing between lines */ | |
253 | } cups_page_header_t; | |
254 | ||
255 | /**** New in CUPS 1.2 ****/ | |
db0bd74a | 256 | typedef struct cups_page_header2_s /**** Version 2 page header @since CUPS 1.2/Mac OS X 10.5@ ****/ |
ef416fc2 | 257 | { |
258 | /**** Standard Page Device Dictionary String Values ****/ | |
259 | char MediaClass[64]; /* MediaClass string */ | |
260 | char MediaColor[64]; /* MediaColor string */ | |
261 | char MediaType[64]; /* MediaType string */ | |
262 | char OutputType[64]; /* OutputType string */ | |
263 | ||
264 | /**** Standard Page Device Dictionary Integer Values ****/ | |
265 | unsigned AdvanceDistance; /* AdvanceDistance value in points */ | |
db0bd74a | 266 | cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */ |
ef416fc2 | 267 | cups_bool_t Collate; /* Collated copies value */ |
db0bd74a | 268 | cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */ |
ef416fc2 | 269 | cups_bool_t Duplex; /* Duplexed (double-sided) value */ |
270 | unsigned HWResolution[2]; /* Resolution in dots-per-inch */ | |
db0bd74a | 271 | unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */ |
ef416fc2 | 272 | cups_bool_t InsertSheet; /* InsertSheet value */ |
db0bd74a MS |
273 | cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */ |
274 | cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */ | |
ef416fc2 | 275 | unsigned Margins[2]; /* Lower-lefthand margins in points */ |
276 | cups_bool_t ManualFeed; /* ManualFeed value */ | |
277 | unsigned MediaPosition; /* MediaPosition value */ | |
278 | unsigned MediaWeight; /* MediaWeight value in grams/m^2 */ | |
279 | cups_bool_t MirrorPrint; /* MirrorPrint value */ | |
280 | cups_bool_t NegativePrint; /* NegativePrint value */ | |
281 | unsigned NumCopies; /* Number of copies to produce */ | |
db0bd74a | 282 | cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */ |
ef416fc2 | 283 | cups_bool_t OutputFaceUp; /* OutputFaceUp value */ |
284 | unsigned PageSize[2]; /* Width and length of page in points */ | |
285 | cups_bool_t Separations; /* Separations value */ | |
286 | cups_bool_t TraySwitch; /* TraySwitch value */ | |
287 | cups_bool_t Tumble; /* Tumble value */ | |
288 | ||
289 | /**** CUPS Page Device Dictionary Values ****/ | |
290 | unsigned cupsWidth; /* Width of page image in pixels */ | |
291 | unsigned cupsHeight; /* Height of page image in pixels */ | |
292 | unsigned cupsMediaType; /* Media type code */ | |
293 | unsigned cupsBitsPerColor; /* Number of bits for each color */ | |
294 | unsigned cupsBitsPerPixel; /* Number of bits for each pixel */ | |
295 | unsigned cupsBytesPerLine; /* Number of bytes per line */ | |
296 | cups_order_t cupsColorOrder; /* Order of colors */ | |
297 | cups_cspace_t cupsColorSpace; /* True colorspace */ | |
298 | unsigned cupsCompression; /* Device compression to use */ | |
299 | unsigned cupsRowCount; /* Rows per band */ | |
300 | unsigned cupsRowFeed; /* Feed between bands */ | |
301 | unsigned cupsRowStep; /* Spacing between lines */ | |
302 | ||
303 | /**** Version 2 Dictionary Values ****/ | |
db0bd74a | 304 | unsigned cupsNumColors; /* Number of color compoents @since CUPS 1.2/Mac OS X 10.5@ */ |
923edb68 | 305 | float cupsBorderlessScalingFactor; |
db0bd74a | 306 | /* Scaling that was applied to page data @since CUPS 1.2/Mac OS X 10.5@ */ |
923edb68 | 307 | float cupsPageSize[2]; /* Floating point PageSize (scaling * |
db0bd74a MS |
308 | * factor not applied) @since CUPS 1.2/Mac OS X 10.5@ */ |
309 | float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox | |
310 | * (scaling factor not applied, left, | |
311 | * bottom, right, top) @since CUPS 1.2/Mac OS X 10.5@ */ | |
312 | unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2/Mac OS X 10.5@ */ | |
313 | float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2/Mac OS X 10.5@ */ | |
314 | char cupsString[16][64]; /* User-defined string values @since CUPS 1.2/Mac OS X 10.5@ */ | |
315 | char cupsMarkerType[64]; /* Ink/toner type @since CUPS 1.2/Mac OS X 10.5@ */ | |
316 | char cupsRenderingIntent[64];/* Color rendering intent @since CUPS 1.2/Mac OS X 10.5@ */ | |
317 | char cupsPageSizeName[64]; /* PageSize name @since CUPS 1.2/Mac OS X 10.5@ */ | |
ef416fc2 | 318 | } cups_page_header2_t; |
319 | ||
f301802f | 320 | typedef struct _cups_raster_s cups_raster_t; |
321 | /**** Raster stream data ****/ | |
ef416fc2 | 322 | |
a74454a7 | 323 | typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits); |
5a738aea MS |
324 | /**** cupsRasterInterpretPPD callback function |
325 | * | |
326 | * This function is called by | |
327 | * @link cupsRasterInterpretPPD@ to | |
328 | * validate (and update, as needed) | |
db0bd74a MS |
329 | * the page header attributes. The |
330 | * "preferred_bits" argument provides | |
331 | * the value of the | |
332 | * @code cupsPreferredBitsPerColor@ | |
333 | * key from the PostScript page device | |
334 | * dictionary and is 0 if undefined. | |
5a738aea | 335 | ****/ |
a74454a7 | 336 | |
c8fef167 MS |
337 | /**** New in CUPS 1.5 ****/ |
338 | typedef ssize_t (*cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length); | |
339 | /**** cupsRasterOpenIO callback function | |
340 | * | |
341 | * This function is specified when | |
342 | * creating a raster stream with | |
343 | * @link cupsRasterOpenIO@ and handles | |
344 | * generic reading and writing of raster | |
345 | * data. It must return -1 on error or | |
346 | * the number of bytes specified by | |
347 | * "length" on success. | |
348 | ****/ | |
349 | ||
ef416fc2 | 350 | |
351 | /* | |
352 | * Prototypes... | |
353 | */ | |
354 | ||
355 | extern void cupsRasterClose(cups_raster_t *r); | |
356 | extern cups_raster_t *cupsRasterOpen(int fd, cups_mode_t mode); | |
357 | extern unsigned cupsRasterReadHeader(cups_raster_t *r, | |
db0bd74a | 358 | cups_page_header_t *h) _CUPS_DEPRECATED; |
ef416fc2 | 359 | extern unsigned cupsRasterReadPixels(cups_raster_t *r, |
360 | unsigned char *p, unsigned len); | |
361 | extern unsigned cupsRasterWriteHeader(cups_raster_t *r, | |
db0bd74a | 362 | cups_page_header_t *h) _CUPS_DEPRECATED; |
ef416fc2 | 363 | extern unsigned cupsRasterWritePixels(cups_raster_t *r, |
364 | unsigned char *p, unsigned len); | |
365 | ||
366 | /**** New in CUPS 1.2 ****/ | |
367 | extern int cupsRasterInterpretPPD(cups_page_header2_t *h, | |
923edb68 | 368 | ppd_file_t *ppd, |
369 | int num_options, | |
a74454a7 | 370 | cups_option_t *options, |
2fb76298 | 371 | cups_interpret_cb_t func) _CUPS_API_1_2; |
ef416fc2 | 372 | extern unsigned cupsRasterReadHeader2(cups_raster_t *r, |
2fb76298 | 373 | cups_page_header2_t *h) _CUPS_API_1_2; |
ef416fc2 | 374 | extern unsigned cupsRasterWriteHeader2(cups_raster_t *r, |
2fb76298 | 375 | cups_page_header2_t *h) _CUPS_API_1_2; |
ef416fc2 | 376 | |
f7deaa1a | 377 | /**** New in CUPS 1.3 ****/ |
2fb76298 | 378 | extern const char *cupsRasterErrorString(void) _CUPS_API_1_3; |
f7deaa1a | 379 | |
c8fef167 MS |
380 | /**** New in CUPS 1.5 ****/ |
381 | extern cups_raster_t *cupsRasterOpenIO(cups_raster_iocb_t iocb, void *ctx, | |
382 | cups_mode_t mode); | |
383 | ||
ef416fc2 | 384 | # ifdef __cplusplus |
385 | } | |
386 | # endif /* __cplusplus */ | |
387 | ||
388 | #endif /* !_CUPS_RASTER_H_ */ | |
389 | ||
390 | /* | |
ac884b6a | 391 | * End of "$Id$". |
ef416fc2 | 392 | */ |