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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- SECTION: Programming -->
<head>
<title>Raster API</title>
<meta name='keywords' content='Programming'>
<meta name='creator' content='Mini-XML v2.3'>
<style type='text/css'><!--
h1, h2, h3, p { font-family: sans-serif; text-align: justify; }
tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }
pre { font-weight: bold; color: #7f0000; margin-left: 2em; }
span.info { background: #000000; border: solid thin #000000; color: #ffffff; font-size: 80%; font-style: italic; font-weight: bold; white-space: nowrap; }
h3 span.info { float: right; font-size: 100%; }
h1.title, h2.title, h3.title { border-bottom: solid 2px #000000; }
--></style>
</head>
<body>
<!--
"$Id$"
Raster API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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: cups-info@cups.org
WWW: http://www.cups.org
-->
<h2 class='title'>Introduction</h2>
<p>The CUPS raster API provides a standard interface for reading
and writing CUPS raster streams which are used for printing to
raster printers. Because the raster format is updated from time
to time, it is important to use this API to avoid
incompatibilities with newer versions of CUPS.</p>
<h2 class='title'>General Usage</h2>
<p>The <var><cups/raster.h></var> header file must be
included to use the <tt>cupsRaster</tt> functions.</p>
<p>Programs using these functions must be linked to the CUPS
imaging library: <var>libcupsimage.a</var>,
<var>libcupsimage.so.2</var>, <var>libcupsimage.2.dylib</var>,
<var>libcupsimage_s.a</var>, or <var>libcupsimage2.lib</var>
depending on the platform. The following command compiles
<var>myprogram.c</var> using GCC and the CUPS imaging
library:</p>
<pre class='command'>
<kbd>gcc -o myprogram myprogram.c -lcupsimage</kbd>
</pre>
<h2 class='title'>Compatibility</h2>
<p>Unless otherwise specified, the raster API functions require
CUPS 1.1 or higher.</p>
<h2 class='title'>Licensing</h2>
<p>The CUPS raster API is provided under the terms of the GNU
Library General Public License, with exceptions for MacOS X-based
programs. Please see the CUPS license agreement for more
information.</p>
<h2 class='title'>Contents</h2>
<ul>
<li><a href='#ENUMERATIONS'>Enumerations</a></li>
<li><a href='#FUNCTIONS'>Functions</a></li>
<li><a href='#STRUCTURES'>Structures</a></li>
<li><a href='#TYPES'>Types</a></li>
</ul>
<!-- NEW PAGE -->
<h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
<ul>
<li><a href='#cups_adv_e'><tt>cups_adv_e</tt></a> </li>
<li><a href='#cups_bool_e'><tt>cups_bool_e</tt></a> </li>
<li><a href='#cups_cspace_e'><tt>cups_cspace_e</tt></a> </li>
<li><a href='#cups_cut_e'><tt>cups_cut_e</tt></a> </li>
<li><a href='#cups_edge_e'><tt>cups_edge_e</tt></a> </li>
<li><a href='#cups_jog_e'><tt>cups_jog_e</tt></a> </li>
<li><a href='#cups_mode_e'><tt>cups_mode_e</tt></a> </li>
<li><a href='#cups_order_e'><tt>cups_order_e</tt></a> </li>
<li><a href='#cups_orient_e'><tt>cups_orient_e</tt></a> </li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_adv_e'>cups_adv_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_ADVANCE_FILE</tt> </td><td>Advance the roll after this file</td></tr>
<tr><td><tt>CUPS_ADVANCE_JOB</tt> </td><td>Advance the roll after this job</td></tr>
<tr><td><tt>CUPS_ADVANCE_NONE</tt> </td><td>Never advance the roll</td></tr>
<tr><td><tt>CUPS_ADVANCE_PAGE</tt> </td><td>Advance the roll after this page</td></tr>
<tr><td><tt>CUPS_ADVANCE_SET</tt> </td><td>Advance the roll after this set</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_bool_e'>cups_bool_e</a></h3>
<h4>Description</h4>
<p>Types...</p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_FALSE</tt> </td><td>Logical false</td></tr>
<tr><td><tt>CUPS_TRUE</tt> </td><td>Logical true</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_cspace_e'>cups_cspace_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_CSPACE_CIELab</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE Lab </td></tr>
<tr><td><tt>CUPS_CSPACE_CIEXYZ</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE XYZ </td></tr>
<tr><td><tt>CUPS_CSPACE_CMY</tt> </td><td>Cyan, magenta, yellow</td></tr>
<tr><td><tt>CUPS_CSPACE_CMYK</tt> </td><td>Cyan, magenta, yellow, black</td></tr>
<tr><td><tt>CUPS_CSPACE_GMCK</tt> </td><td>Gold, magenta, yellow, black</td></tr>
<tr><td><tt>CUPS_CSPACE_GMCS</tt> </td><td>Gold, magenta, yellow, silver</td></tr>
<tr><td><tt>CUPS_CSPACE_GOLD</tt> </td><td>Gold foil</td></tr>
<tr><td><tt>CUPS_CSPACE_ICC1</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 1 color </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC2</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 2 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC3</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 3 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC4</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 4 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC5</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 5 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC6</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 6 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC7</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 7 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC8</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 8 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICC9</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 9 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCA</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 10 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCB</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 11 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCC</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 12 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCD</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 13 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCE</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 14 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_ICCF</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 15 colors </td></tr>
<tr><td><tt>CUPS_CSPACE_K</tt> </td><td>Black</td></tr>
<tr><td><tt>CUPS_CSPACE_KCMY</tt> </td><td>Black, cyan, magenta, yellow</td></tr>
<tr><td><tt>CUPS_CSPACE_KCMYcm</tt> </td><td>Black, cyan, magenta, yellow, *
light-cyan, light-magenta</td></tr>
<tr><td><tt>CUPS_CSPACE_RGB</tt> </td><td>Red, green, blue</td></tr>
<tr><td><tt>CUPS_CSPACE_RGBA</tt> </td><td>Red, green, blue, alpha</td></tr>
<tr><td><tt>CUPS_CSPACE_RGBW</tt> <span class='info'> CUPS 1.2 </span></td><td>Red, green, blue, white </td></tr>
<tr><td><tt>CUPS_CSPACE_SILVER</tt> </td><td>Silver foil</td></tr>
<tr><td><tt>CUPS_CSPACE_W</tt> </td><td>Luminance</td></tr>
<tr><td><tt>CUPS_CSPACE_WHITE</tt> </td><td>White ink (as black)</td></tr>
<tr><td><tt>CUPS_CSPACE_YMC</tt> </td><td>Yellow, magenta, cyan</td></tr>
<tr><td><tt>CUPS_CSPACE_YMCK</tt> </td><td>Yellow, magenta, cyan, black</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_cut_e'>cups_cut_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_CUT_FILE</tt> </td><td>Cut the roll after this file</td></tr>
<tr><td><tt>CUPS_CUT_JOB</tt> </td><td>Cut the roll after this job</td></tr>
<tr><td><tt>CUPS_CUT_NONE</tt> </td><td>Never cut the roll</td></tr>
<tr><td><tt>CUPS_CUT_PAGE</tt> </td><td>Cut the roll after this page</td></tr>
<tr><td><tt>CUPS_CUT_SET</tt> </td><td>Cut the roll after this set</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_edge_e'>cups_edge_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_EDGE_BOTTOM</tt> </td><td>Leading edge is the bottom of the page</td></tr>
<tr><td><tt>CUPS_EDGE_LEFT</tt> </td><td>Leading edge is the left of the page</td></tr>
<tr><td><tt>CUPS_EDGE_RIGHT</tt> </td><td>Leading edge is the right of the page</td></tr>
<tr><td><tt>CUPS_EDGE_TOP</tt> </td><td>Leading edge is the top of the page</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_jog_e'>cups_jog_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_JOG_FILE</tt> </td><td>Move pages after this file</td></tr>
<tr><td><tt>CUPS_JOG_JOB</tt> </td><td>Move pages after this job</td></tr>
<tr><td><tt>CUPS_JOG_NONE</tt> </td><td>Never move pages</td></tr>
<tr><td><tt>CUPS_JOG_SET</tt> </td><td>Move pages after this set</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_mode_e'>cups_mode_e</a></h3>
<h4>Description</h4>
<p>Raster modes</p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_RASTER_READ</tt> </td><td>Open stream for reading</td></tr>
<tr><td><tt>CUPS_RASTER_WRITE</tt> </td><td>Open stream for writing</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_order_e'>cups_order_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_ORDER_BANDED</tt> </td><td>CCC MMM YYY KKK ...</td></tr>
<tr><td><tt>CUPS_ORDER_CHUNKED</tt> </td><td>CMYK CMYK CMYK ...</td></tr>
<tr><td><tt>CUPS_ORDER_PLANAR</tt> </td><td>CCC ... MMM ... YYY ... KKK ...</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_orient_e'>cups_orient_e</a></h3>
<h4>Description</h4>
<p></p>
<h4>Values</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>CUPS_ORIENT_0</tt> </td><td>Don't rotate the page</td></tr>
<tr><td><tt>CUPS_ORIENT_180</tt> </td><td>Turn the page upside down</td></tr>
<tr><td><tt>CUPS_ORIENT_270</tt> </td><td>Rotate the page clockwise</td></tr>
<tr><td><tt>CUPS_ORIENT_90</tt> </td><td>Rotate the page counter-clockwise</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
<ul>
<li><a href='#cupsRasterClose'><tt>cupsRasterClose()</tt></a> </li>
<li><a href='#cupsRasterInterpretPPD'><tt>cupsRasterInterpretPPD()</tt></a> <span class='info'> CUPS 1.2 </span></li>
<li><a href='#cupsRasterOpen'><tt>cupsRasterOpen()</tt></a> </li>
<li><a href='#cupsRasterReadHeader'><tt>cupsRasterReadHeader()</tt></a> </li>
<li><a href='#cupsRasterReadHeader2'><tt>cupsRasterReadHeader2()</tt></a> <span class='info'> CUPS 1.2 </span></li>
<li><a href='#cupsRasterReadPixels'><tt>cupsRasterReadPixels()</tt></a> </li>
<li><a href='#cupsRasterWriteHeader'><tt>cupsRasterWriteHeader()</tt></a> </li>
<li><a href='#cupsRasterWriteHeader2'><tt>cupsRasterWriteHeader2()</tt></a> <span class='info'> CUPS 1.2 </span></li>
<li><a href='#cupsRasterWritePixels'><tt>cupsRasterWritePixels()</tt></a> </li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterClose'>cupsRasterClose()</a></h3>
<h4>Description</h4>
<p>Close a raster stream.</p>
<h4>Syntax</h4>
<pre>
void
cupsRasterClose(
<a href='#cups_raster_t'>cups_raster_t</a> * r);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Stream to close</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsRasterInterpretPPD'>cupsRasterInterpretPPD()</a></h3>
<h4>Description</h4>
<p>Interpret PPD commands to create a page header.
This function does not mark the options in the PPD using the "num_options"
and "options" arguments. Instead, mark the options prior to calling
cupsRasterInterpretPPD() - this allows you to do per-page options
without manipulating the options array.
The "func" argument specifies an optional callback function that is
called prior to the computation of the final raster data. The function
can make changes to the cups_page_header2_t data as needed to use a
supported raster format and then returns 0 on success and -1 if the
requested attributes cannot be supported.
</p>
<h4>Syntax</h4>
<pre>
int
cupsRasterInterpretPPD(
<a href='#cups_page_header2_t'>cups_page_header2_t</a> * h,
ppd_file_t * ppd,
int num_options,
cups_option_t * options,
<a href='#cups_interpret_cb_t'>cups_interpret_cb_t</a> func);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>h</tt></td><td>Page header</td></tr>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
<tr><td><tt>options</tt></td><td>Options</td></tr>
<tr><td><tt>func</tt></td><td>Optional page header callback</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>0 on success, -1 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterOpen'>cupsRasterOpen()</a></h3>
<h4>Description</h4>
<p>Open a raster stream.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_raster_t'>cups_raster_t</a> *
cupsRasterOpen(
int fd,
cups_mode_t mode);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
<tr><td><tt>mode</tt></td><td>Mode</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>New stream</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterReadHeader'>cupsRasterReadHeader()</a></h3>
<h4>Description</h4>
<p>Read a raster page header and store it in a
V1 page header structure.</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterReadHeader(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
<a href='#cups_page_header_t'>cups_page_header_t</a> * h);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>h</tt></td><td>Pointer to header data</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>1 on success, 0 on fail</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsRasterReadHeader2'>cupsRasterReadHeader2()</a></h3>
<h4>Description</h4>
<p>Read a raster page header and store it in a
V2 page header structure.
</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterReadHeader2(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
<a href='#cups_page_header2_t'>cups_page_header2_t</a> * h);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>h</tt></td><td>Pointer to header data</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>1 on success, 0 on fail</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterReadPixels'>cupsRasterReadPixels()</a></h3>
<h4>Description</h4>
<p>Read raster pixels.</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterReadPixels(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
unsigned char * p,
unsigned len);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>p</tt></td><td>Pointer to pixel buffer</td></tr>
<tr><td><tt>len</tt></td><td>Number of bytes to read</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Number of bytes read</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterWriteHeader'>cupsRasterWriteHeader()</a></h3>
<h4>Description</h4>
<p>Write a raster page header from a V1 page
header structure.</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterWriteHeader(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
<a href='#cups_page_header_t'>cups_page_header_t</a> * h);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>h</tt></td><td>Raster page header</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>1 on success, 0 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsRasterWriteHeader2'>cupsRasterWriteHeader2()</a></h3>
<h4>Description</h4>
<p>Write a raster page header from a V2 page
header structure.
</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterWriteHeader2(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
<a href='#cups_page_header2_t'>cups_page_header2_t</a> * h);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>h</tt></td><td>Raster page header</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>1 on success, 0 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsRasterWritePixels'>cupsRasterWritePixels()</a></h3>
<h4>Description</h4>
<p>Write raster pixels.</p>
<h4>Syntax</h4>
<pre>
unsigned
cupsRasterWritePixels(
<a href='#cups_raster_t'>cups_raster_t</a> * r,
unsigned char * p,
unsigned len);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>r</tt></td><td>Raster stream</td></tr>
<tr><td><tt>p</tt></td><td>Bytes to write</td></tr>
<tr><td><tt>len</tt></td><td>Number of bytes to write</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Number of bytes written</p>
<!-- NEW PAGE -->
<h2 class='title'><a name='STRUCTURES'>Structures</a></h2>
<ul>
<li><a href='#cups_page_header2_s'><tt>cups_page_header2_s</tt></a> <span class='info'> CUPS 1.2 </span></li>
<li><a href='#cups_page_header_s'><tt>cups_page_header_s</tt></a> </li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cups_page_header2_s'>cups_page_header2_s</a></h3>
<h4>Description</h4>
<p>Version 2 Page Header </p>
<h4>Definition</h4>
<pre>
struct cups_page_header2_s
{
unsigned AdvanceDistance;
cups_adv_t AdvanceMedia;
cups_bool_t Collate;
cups_cut_t CutMedia;
cups_bool_t Duplex;
unsigned HWResolution[2];
unsigned ImagingBoundingBox[4];
cups_bool_t InsertSheet;
cups_jog_t Jog;
cups_edge_t LeadingEdge;
cups_bool_t ManualFeed;
unsigned Margins[2];
char MediaClass[64];
char MediaColor[64];
unsigned MediaPosition;
char MediaType[64];
unsigned MediaWeight;
cups_bool_t MirrorPrint;
cups_bool_t NegativePrint;
unsigned NumCopies;
cups_orient_t Orientation;
cups_bool_t OutputFaceUp;
char OutputType[64];
unsigned PageSize[2];
cups_bool_t Separations;
cups_bool_t TraySwitch;
cups_bool_t Tumble;
unsigned cupsBitsPerColor;
unsigned cupsBitsPerPixel;
float cupsBorderlessScalingFactor;
unsigned cupsBytesPerLine;
cups_order_t cupsColorOrder;
cups_cspace_t cupsColorSpace;
unsigned cupsCompression;
unsigned cupsHeight;
float cupsImagingBBox[4];
unsigned cupsInteger[16];
char cupsMarkerType[64];
unsigned cupsMediaType;
unsigned cupsNumColors;
char cupsPageSizeName[64];
float cupsPageSize[2];
float cupsReal[16];
char cupsRenderingIntent[64];
unsigned cupsRowCount;
unsigned cupsRowFeed;
unsigned cupsRowStep;
char cupsString[16][64];
unsigned cupsWidth;
};
</pre>
<h4>Members</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>AdvanceDistance</tt> </td><td>AdvanceDistance value in points</td></tr>
<tr><td><tt>AdvanceMedia</tt> </td><td>AdvanceMedia value (see above)</td></tr>
<tr><td><tt>Collate</tt> </td><td>Collated copies value</td></tr>
<tr><td><tt>CutMedia</tt> </td><td>CutMedia value (see above)</td></tr>
<tr><td><tt>Duplex</tt> </td><td>Duplexed (double-sided) value</td></tr>
<tr><td><tt>HWResolution[2]</tt> </td><td>Resolution in dots-per-inch</td></tr>
<tr><td><tt>ImagingBoundingBox[4]</tt> </td><td>Pixel region that is painted (points)</td></tr>
<tr><td><tt>InsertSheet</tt> </td><td>InsertSheet value</td></tr>
<tr><td><tt>Jog</tt> </td><td>Jog value (see above)</td></tr>
<tr><td><tt>LeadingEdge</tt> </td><td>LeadingEdge value (see above)</td></tr>
<tr><td><tt>ManualFeed</tt> </td><td>ManualFeed value</td></tr>
<tr><td><tt>Margins[2]</tt> </td><td>Lower-lefthand margins in points</td></tr>
<tr><td><tt>MediaClass[64]</tt> </td><td>MediaClass string</td></tr>
<tr><td><tt>MediaColor[64]</tt> </td><td>MediaColor string</td></tr>
<tr><td><tt>MediaPosition</tt> </td><td>MediaPosition value</td></tr>
<tr><td><tt>MediaType[64]</tt> </td><td>MediaType string</td></tr>
<tr><td><tt>MediaWeight</tt> </td><td>MediaWeight value in grams/m^2</td></tr>
<tr><td><tt>MirrorPrint</tt> </td><td>MirrorPrint value</td></tr>
<tr><td><tt>NegativePrint</tt> </td><td>NegativePrint value</td></tr>
<tr><td><tt>NumCopies</tt> </td><td>Number of copies to produce</td></tr>
<tr><td><tt>Orientation</tt> </td><td>Orientation value (see above)</td></tr>
<tr><td><tt>OutputFaceUp</tt> </td><td>OutputFaceUp value</td></tr>
<tr><td><tt>OutputType[64]</tt> </td><td>OutputType string</td></tr>
<tr><td><tt>PageSize[2]</tt> </td><td>Width and length of page in points</td></tr>
<tr><td><tt>Separations</tt> </td><td>Separations value</td></tr>
<tr><td><tt>TraySwitch</tt> </td><td>TraySwitch value</td></tr>
<tr><td><tt>Tumble</tt> </td><td>Tumble value</td></tr>
<tr><td><tt>cupsBitsPerColor</tt> </td><td>Number of bits for each color</td></tr>
<tr><td><tt>cupsBitsPerPixel</tt> </td><td>Number of bits for each pixel</td></tr>
<tr><td><tt>cupsBorderlessScalingFactor</tt> <span class='info'> CUPS 1.2 </span></td><td>Scaling that was applied to page data </td></tr>
<tr><td><tt>cupsBytesPerLine</tt> </td><td>Number of bytes per line</td></tr>
<tr><td><tt>cupsColorOrder</tt> </td><td>Order of colors</td></tr>
<tr><td><tt>cupsColorSpace</tt> </td><td>True colorspace</td></tr>
<tr><td><tt>cupsCompression</tt> </td><td>Device compression to use</td></tr>
<tr><td><tt>cupsHeight</tt> </td><td>Height of page image in pixels</td></tr>
<tr><td><tt>cupsImagingBBox[4]</tt> <span class='info'> CUPS 1.2 </span></td><td>Floating point ImagingBoundingBox *
(scaling factor not applied) </td></tr>
<tr><td><tt>cupsInteger[16]</tt> <span class='info'> CUPS 1.2 </span></td><td>User-defined integer values </td></tr>
<tr><td><tt>cupsMarkerType[64]</tt> <span class='info'> CUPS 1.2 </span></td><td>Ink/toner type </td></tr>
<tr><td><tt>cupsMediaType</tt> </td><td>Media type code</td></tr>
<tr><td><tt>cupsNumColors</tt> <span class='info'> CUPS 1.2 </span></td><td>Number of colors </td></tr>
<tr><td><tt>cupsPageSizeName[64]</tt> <span class='info'> CUPS 1.2 </span></td><td>PageSize name </td></tr>
<tr><td><tt>cupsPageSize[2]</tt> <span class='info'> CUPS 1.2 </span></td><td>Floating point PageSize (scaling *
factor not applied) </td></tr>
<tr><td><tt>cupsReal[16]</tt> <span class='info'> CUPS 1.2 </span></td><td>User-defined floating-point values </td></tr>
<tr><td><tt>cupsRenderingIntent[64]</tt> <span class='info'> CUPS 1.2 </span></td><td>Color rendering intent </td></tr>
<tr><td><tt>cupsRowCount</tt> </td><td>Rows per band</td></tr>
<tr><td><tt>cupsRowFeed</tt> </td><td>Feed between bands</td></tr>
<tr><td><tt>cupsRowStep</tt> </td><td>Spacing between lines</td></tr>
<tr><td><tt>cupsString[16][64]</tt> <span class='info'> CUPS 1.2 </span></td><td>User-defined string values </td></tr>
<tr><td><tt>cupsWidth</tt> </td><td>Width of page image in pixels</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_page_header_s'>cups_page_header_s</a></h3>
<h4>Description</h4>
<p></p>
<h4>Definition</h4>
<pre>
struct cups_page_header_s
{
unsigned AdvanceDistance;
cups_adv_t AdvanceMedia;
cups_bool_t Collate;
cups_cut_t CutMedia;
cups_bool_t Duplex;
unsigned HWResolution[2];
unsigned ImagingBoundingBox[4];
cups_bool_t InsertSheet;
cups_jog_t Jog;
cups_edge_t LeadingEdge;
cups_bool_t ManualFeed;
unsigned Margins[2];
char MediaClass[64];
char MediaColor[64];
unsigned MediaPosition;
char MediaType[64];
unsigned MediaWeight;
cups_bool_t MirrorPrint;
cups_bool_t NegativePrint;
unsigned NumCopies;
cups_orient_t Orientation;
cups_bool_t OutputFaceUp;
char OutputType[64];
unsigned PageSize[2];
cups_bool_t Separations;
cups_bool_t TraySwitch;
cups_bool_t Tumble;
unsigned cupsBitsPerColor;
unsigned cupsBitsPerPixel;
unsigned cupsBytesPerLine;
cups_order_t cupsColorOrder;
cups_cspace_t cupsColorSpace;
unsigned cupsCompression;
unsigned cupsHeight;
unsigned cupsMediaType;
unsigned cupsRowCount;
unsigned cupsRowFeed;
unsigned cupsRowStep;
unsigned cupsWidth;
};
</pre>
<h4>Members</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>AdvanceDistance</tt> </td><td>AdvanceDistance value in points</td></tr>
<tr><td><tt>AdvanceMedia</tt> </td><td>AdvanceMedia value (see above)</td></tr>
<tr><td><tt>Collate</tt> </td><td>Collated copies value</td></tr>
<tr><td><tt>CutMedia</tt> </td><td>CutMedia value (see above)</td></tr>
<tr><td><tt>Duplex</tt> </td><td>Duplexed (double-sided) value</td></tr>
<tr><td><tt>HWResolution[2]</tt> </td><td>Resolution in dots-per-inch</td></tr>
<tr><td><tt>ImagingBoundingBox[4]</tt> </td><td>Pixel region that is painted (points)</td></tr>
<tr><td><tt>InsertSheet</tt> </td><td>InsertSheet value</td></tr>
<tr><td><tt>Jog</tt> </td><td>Jog value (see above)</td></tr>
<tr><td><tt>LeadingEdge</tt> </td><td>LeadingEdge value (see above)</td></tr>
<tr><td><tt>ManualFeed</tt> </td><td>ManualFeed value</td></tr>
<tr><td><tt>Margins[2]</tt> </td><td>Lower-lefthand margins in points</td></tr>
<tr><td><tt>MediaClass[64]</tt> </td><td>MediaClass string</td></tr>
<tr><td><tt>MediaColor[64]</tt> </td><td>MediaColor string</td></tr>
<tr><td><tt>MediaPosition</tt> </td><td>MediaPosition value</td></tr>
<tr><td><tt>MediaType[64]</tt> </td><td>MediaType string</td></tr>
<tr><td><tt>MediaWeight</tt> </td><td>MediaWeight value in grams/m^2</td></tr>
<tr><td><tt>MirrorPrint</tt> </td><td>MirrorPrint value</td></tr>
<tr><td><tt>NegativePrint</tt> </td><td>NegativePrint value</td></tr>
<tr><td><tt>NumCopies</tt> </td><td>Number of copies to produce</td></tr>
<tr><td><tt>Orientation</tt> </td><td>Orientation value (see above)</td></tr>
<tr><td><tt>OutputFaceUp</tt> </td><td>OutputFaceUp value</td></tr>
<tr><td><tt>OutputType[64]</tt> </td><td>OutputType string</td></tr>
<tr><td><tt>PageSize[2]</tt> </td><td>Width and length of page in points</td></tr>
<tr><td><tt>Separations</tt> </td><td>Separations value</td></tr>
<tr><td><tt>TraySwitch</tt> </td><td>TraySwitch value</td></tr>
<tr><td><tt>Tumble</tt> </td><td>Tumble value</td></tr>
<tr><td><tt>cupsBitsPerColor</tt> </td><td>Number of bits for each color</td></tr>
<tr><td><tt>cupsBitsPerPixel</tt> </td><td>Number of bits for each pixel</td></tr>
<tr><td><tt>cupsBytesPerLine</tt> </td><td>Number of bytes per line</td></tr>
<tr><td><tt>cupsColorOrder</tt> </td><td>Order of colors</td></tr>
<tr><td><tt>cupsColorSpace</tt> </td><td>True colorspace</td></tr>
<tr><td><tt>cupsCompression</tt> </td><td>Device compression to use</td></tr>
<tr><td><tt>cupsHeight</tt> </td><td>Height of page image in pixels</td></tr>
<tr><td><tt>cupsMediaType</tt> </td><td>Media type code</td></tr>
<tr><td><tt>cupsRowCount</tt> </td><td>Rows per band</td></tr>
<tr><td><tt>cupsRowFeed</tt> </td><td>Feed between bands</td></tr>
<tr><td><tt>cupsRowStep</tt> </td><td>Spacing between lines</td></tr>
<tr><td><tt>cupsWidth</tt> </td><td>Width of page image in pixels</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h2 class='title'><a name='TYPES'>Types</a></h2>
<ul>
<li><a href='#cups_interpret_cb_t'><tt>cups_interpret_cb_t</tt></a> </li>
<li><a href='#cups_page_header2_t'><tt>cups_page_header2_t</tt></a> <span class='info'> CUPS 1.2 </span></li>
<li><a href='#cups_raster_t'><tt>cups_raster_t</tt></a> </li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_interpret_cb_t'>cups_interpret_cb_t</a></h3>
<h4>Description</h4>
<p>Prototypes...</p>
<h4>Definition</h4>
<pre>
typedef int (*cups_interpret_cb_t)(<a href='#cups_page_header2_t'>cups_page_header2_t</a> *header, int preferred_bits);
</pre>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cups_page_header2_t'>cups_page_header2_t</a></h3>
<h4>Description</h4>
<p>Version 2 Page Header </p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_page_header2_s'>cups_page_header2_s</a> cups_page_header2_t;
</pre>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_raster_t'>cups_raster_t</a></h3>
<h4>Description</h4>
<p>Raster stream data</p>
<h4>Definition</h4>
<pre>
typedef struct _cups_raster_s cups_raster_t;
</pre>
</body>
</html>
|