This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
/
cups.h
226 lines (202 loc) · 9.44 KB
/
cups.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/*
* Raster file definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: [email protected]
* WWW: http://www.cups.org
*
* This code and any derivative of it may be used and distributed
* freely under the terms of the GNU General Public License when
* used with GNU/GPL Ghostscript or its derivatives. Use of the
* code (or any derivative of it) with software other than GNU/GPL
* GhostScript (or its derivatives) is governed by the CUPS license
* agreement.
*
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_RASTER_H_
# define _CUPS_RASTER_H_
/*
* Constants...
*/
# define CUPS_RASTER_SYNC 0x52615333 /* RaS3 */
# define CUPS_RASTER_REVSYNC 0x33536152 /* 3SaR */
# define CUPS_RASTER_SYNCv1 0x52615374 /* RaSt */
# define CUPS_RASTER_REVSYNCv1 0x74536152 /* tSaR */
# define CUPS_RASTER_SYNCv2 0x52615332 /* RaS2 */
# define CUPS_RASTER_REVSYNCv2 0x32536152 /* 2SaR */
/*
* Types...
*/
typedef enum cups_bool_e /**** Boolean type ****/
{
CUPS_FALSE = 0, /* Logical false */
CUPS_TRUE = 1 /* Logical true */
} cups_bool_t;
typedef enum cups_jog_e /**** Jog attribute values ****/
{
CUPS_JOG_NONE = 0, /* Never move pages */
CUPS_JOG_FILE = 1, /* Move pages after this file */
CUPS_JOG_JOB = 2, /* Move pages after this job */
CUPS_JOG_SET = 3 /* Move pages after this set */
} cups_jog_t;
typedef enum cups_orient_e /**** Orientation attribute values ****/
{
CUPS_ORIENT_0 = 0, /* Don't rotate the page */
CUPS_ORIENT_90 = 1, /* Rotate the page counter-clockwise */
CUPS_ORIENT_180 = 2, /* Turn the page upside down */
CUPS_ORIENT_270 = 3 /* Rotate the page clockwise */
} cups_orient_t;
typedef enum cups_cut_e /**** CutMedia attribute values ****/
{
CUPS_CUT_NONE = 0, /* Never cut the roll */
CUPS_CUT_FILE = 1, /* Cut the roll after this file */
CUPS_CUT_JOB = 2, /* Cut the roll after this job */
CUPS_CUT_SET = 3, /* Cut the roll after this set */
CUPS_CUT_PAGE = 4 /* Cut the roll after this page */
} cups_cut_t;
typedef enum cups_adv_e /**** AdvanceMedia attribute values ****/
{
CUPS_ADVANCE_NONE = 0, /* Never advance the roll */
CUPS_ADVANCE_FILE = 1, /* Advance the roll after this file */
CUPS_ADVANCE_JOB = 2, /* Advance the roll after this job */
CUPS_ADVANCE_SET = 3, /* Advance the roll after this set */
CUPS_ADVANCE_PAGE = 4 /* Advance the roll after this page */
} cups_adv_t;
typedef enum cups_edge_e /**** LeadingEdge attribute values ****/
{
CUPS_EDGE_TOP = 0, /* Leading edge is the top of the page */
CUPS_EDGE_RIGHT = 1, /* Leading edge is the right of the page */
CUPS_EDGE_BOTTOM = 2, /* Leading edge is the bottom of the page */
CUPS_EDGE_LEFT = 3 /* Leading edge is the left of the page */
} cups_edge_t;
typedef enum cups_order_e /**** cupsColorOrder attribute values ****/
{
CUPS_ORDER_CHUNKED = 0, /* CMYK CMYK CMYK ... */
CUPS_ORDER_BANDED = 1, /* CCC MMM YYY KKK ... */
CUPS_ORDER_PLANAR = 2 /* CCC ... MMM ... YYY ... KKK ... */
} cups_order_t;
typedef enum cups_cspace_e /**** cupsColorSpace attribute values ****/
{
CUPS_CSPACE_W = 0, /* Luminance */
CUPS_CSPACE_RGB = 1, /* Red, green, blue */
CUPS_CSPACE_RGBA = 2, /* Red, green, blue, alpha */
CUPS_CSPACE_K = 3, /* Black */
CUPS_CSPACE_CMY = 4, /* Cyan, magenta, yellow */
CUPS_CSPACE_YMC = 5, /* Yellow, magenta, cyan */
CUPS_CSPACE_CMYK = 6, /* Cyan, magenta, yellow, black */
CUPS_CSPACE_YMCK = 7, /* Yellow, magenta, cyan, black */
CUPS_CSPACE_KCMY = 8, /* Black, cyan, magenta, yellow */
CUPS_CSPACE_KCMYcm = 9, /* Black, cyan, magenta, yellow, *
* light-cyan, light-magenta */
CUPS_CSPACE_GMCK = 10, /* Gold, magenta, yellow, black */
CUPS_CSPACE_GMCS = 11, /* Gold, magenta, yellow, silver */
CUPS_CSPACE_WHITE = 12, /* White ink (as black) */
CUPS_CSPACE_GOLD = 13, /* Gold foil */
CUPS_CSPACE_SILVER = 14, /* Silver foil */
CUPS_CSPACE_CIEXYZ = 15, /* CIE XYZ @since CUPS 1.1.19@ */
CUPS_CSPACE_CIELab = 16, /* CIE Lab @since CUPS 1.1.19@ */
CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white @since CUPS 1.2@ */
CUPS_CSPACE_ICC1 = 32, /* ICC-based, 1 color @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC2 = 33, /* ICC-based, 2 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC3 = 34, /* ICC-based, 3 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC4 = 35, /* ICC-based, 4 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC5 = 36, /* ICC-based, 5 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC6 = 37, /* ICC-based, 6 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC7 = 38, /* ICC-based, 7 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC8 = 39, /* ICC-based, 8 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC9 = 40, /* ICC-based, 9 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCA = 41, /* ICC-based, 10 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCB = 42, /* ICC-based, 11 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCC = 43, /* ICC-based, 12 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCD = 44, /* ICC-based, 13 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCE = 45, /* ICC-based, 14 colors @since CUPS 1.1.19@ */
CUPS_CSPACE_ICCF = 46 /* ICC-based, 15 colors @since CUPS 1.1.19@ */
} cups_cspace_t;
/*
* The page header structure contains the standard PostScript page device
* dictionary, along with some CUPS-specific parameters that are provided
* by the RIPs...
*
* The API supports a "version 1" (from CUPS 1.0 and 1.1) and a "version 2"
* (from CUPS 1.2 and higher) page header, for binary compatibility.
*/
typedef struct cups_page_header_s /**** Version 1 Page Header ****/
{
/**** Standard Page Device Dictionary String Values ****/
char MediaClass[64]; /* MediaClass string */
char MediaColor[64]; /* MediaColor string */
char MediaType[64]; /* MediaType string */
char OutputType[64]; /* OutputType string */
/**** Standard Page Device Dictionary Integer Values ****/
unsigned AdvanceDistance; /* AdvanceDistance value in points */
cups_adv_t AdvanceMedia; /* AdvanceMedia value (see above) */
cups_bool_t Collate; /* Collated copies value */
cups_cut_t CutMedia; /* CutMedia value (see above) */
cups_bool_t Duplex; /* Duplexed (double-sided) value */
unsigned HWResolution[2]; /* Resolution in dots-per-inch */
unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points) */
cups_bool_t InsertSheet; /* InsertSheet value */
cups_jog_t Jog; /* Jog value (see above) */
cups_edge_t LeadingEdge; /* LeadingEdge value (see above) */
unsigned Margins[2]; /* Lower-lefthand margins in points */
cups_bool_t ManualFeed; /* ManualFeed value */
unsigned MediaPosition; /* MediaPosition value */
unsigned MediaWeight; /* MediaWeight value in grams/m^2 */
cups_bool_t MirrorPrint; /* MirrorPrint value */
cups_bool_t NegativePrint; /* NegativePrint value */
unsigned NumCopies; /* Number of copies to produce */
cups_orient_t Orientation; /* Orientation value (see above) */
cups_bool_t OutputFaceUp; /* OutputFaceUp value */
unsigned PageSize[2]; /* Width and length of page in points */
cups_bool_t Separations; /* Separations value */
cups_bool_t TraySwitch; /* TraySwitch value */
cups_bool_t Tumble; /* Tumble value */
/**** CUPS Page Device Dictionary Values ****/
unsigned cupsWidth; /* Width of page image in pixels */
unsigned cupsHeight; /* Height of page image in pixels */
unsigned cupsMediaType; /* Media type code */
unsigned cupsBitsPerColor; /* Number of bits for each color */
unsigned cupsBitsPerPixel; /* Number of bits for each pixel */
unsigned cupsBytesPerLine; /* Number of bytes per line */
cups_order_t cupsColorOrder; /* Order of colors */
cups_cspace_t cupsColorSpace; /* True colorspace */
unsigned cupsCompression; /* Device compression to use */
unsigned cupsRowCount; /* Rows per band */
unsigned cupsRowFeed; /* Feed between bands */
unsigned cupsRowStep; /* Spacing between lines */
} cups_page_header_t;
typedef struct cups_page_header2_s /**** Version 2 Page Header @since CUPS 1.2@ ****/
{
/**** Version 2 Dictionary Values ****/
unsigned cupsNumColors; /* Number of colors */
float cupsBorderlessScalingFactor;
/* Scaling that was applied to page data */
float cupsPageSize[2]; /* Floating point PageSize (scaling *
* factor not applied) */
float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox *
* (scaling factor not applied) */
unsigned cupsInteger[16]; /* User-defined integer values */
float cupsReal[16]; /* User-defined floating-point values */
char cupsString[16][64]; /* User-defined string values */
char cupsMarkerType[64]; /* Ink/toner type */
char cupsRenderingIntent[64];/* Color rendering intent */
char cupsPageSizeName[64]; /* PageSize name */
} cups_page_header2_t;
#endif /* !_CUPS_RASTER_H_ */