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