3 <!-- SECTION: Programming -->
5 <title>Raster API
</title>
6 <meta name=
"keywords" content=
"Programming">
7 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8">
8 <meta name=
"creator" content=
"Mini-XML v2.11">
9 <meta name=
"author" content=
"Unknown">
10 <meta name=
"copyright" content=
"Unknown">
11 <meta name=
"version" content=
"0.0">
12 <style type=
"text/css"><!--
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
17 H1, H2, H3, H4, H5, H6, P, TD, TH {
18 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
22 font-family: monaco, courier, monospace;
27 font-family: monaco, courier, monospace;
31 border-left: solid 2px #777;
40 PRE.command, PRE.example {
67 PRE.command EM, PRE.example EM {
68 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
72 font-family: monaco, courier, monospace;
88 -moz-border-radius: 10px;
93 text-decoration: none;
96 A:link:hover, A:visited:hover, A:active {
97 text-decoration: underline;
104 TR.data, TD.data, TR.data TD {
107 border-bottom: solid 1pt #999999;
111 border-bottom: solid 1pt #999999;
118 border: solid thin #999999;
119 border-collapse: collapse;
135 border: solid thin #cccccc;
142 border-bottom: solid thin #999999;
151 caption-side: bottom;
175 border: thin solid black;
183 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
192 border-bottom: solid 2pt #000000;
195 DIV.indent, TABLE.indent {
203 border-collapse: collapse;
206 TABLE.indent TD, TABLE.indent TH {
211 border-collapse: collapse;
219 border-bottom: solid thin #cccccc;
224 vertical-align: bottom;
233 border-bottom: solid thin #eeeeee;
238 TABLE.list TR:nth-child(even) {
242 TABLE.list TR:nth-child(odd) {
261 font-family: monaco, courier, monospace;
265 border: solid thin #999999;
266 border-collapse: collapse;
271 DIV.summary TABLE TD, DIV.summary TABLE TH {
272 border: solid thin #999999;
278 DIV.summary TABLE THEAD TH {
282 /* API documentation styles... */
294 margin-bottom: 0.5em;
299 margin-bottom: 0.5em;
304 margin-bottom: 0.5em;
309 border: solid thin black;
318 div.contents ul.contents {
322 border-bottom: solid 2px gray;
332 border-bottom: solid 2px gray;
335 border-bottom: solid 2px gray;
347 border-bottom: solid 2px gray;
350 border-bottom: solid 2px gray;
353 border-bottom: solid 2px gray;
357 h1, h2, h3, h4, h5, h6 {
358 page-break-inside: avoid;
361 border: solid thin gray;
362 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
364 page-break-inside: avoid;
366 p code, li code, p.code, pre, ul.code li {
367 background: rgba(127,127,127,0.1);
368 border: thin dotted gray;
369 font-family: monospace;
372 -webkit-hyphens: manual;
373 page-break-inside: avoid;
375 p.code, pre, ul.code li {
382 text-decoration: none;
386 border: solid thin black;
393 h3 span.info, h4 span.info {
394 border-top-left-radius: 10px;
395 border-top-right-radius: 10px;
399 ul.code, ul.contents, ul.subcontents {
400 list-style-type: none;
410 ul.contents li ul.code, ul.contents li ul.subcontents {
414 border-collapse: collapse;
417 table.list tr:nth-child(even) {
418 background: rgba(127,127,127,0.1);]n}
420 border-right: 2px solid gray;
421 font-family: monospace;
422 padding: 5px 10px 5px 2px;
427 padding: 5px 2px 5px 10px;
434 border-bottom: solid 2px black;
437 border-bottom: solid 2px black;
443 Raster API documentation for CUPS.
445 Copyright 2008-2010 by Apple Inc.
447 These coded instructions, statements, and computer programs are the
448 property of Apple Inc. and are protected by Federal copyright
449 law. Distribution and use rights are outlined in the file "LICENSE.txt"
450 which should have been included with this file. If this file is
451 file is missing or damaged, see the license at "http://www.cups.org/".
454 <h1 class='title'
>Raster API
</h1>
456 <div class='summary'
><table summary='General Information'
>
460 <th>cups/raster.h
</th>
470 <td>Programming:
<a href='api-overview.html'
>Introduction to CUPS Programming
</a><br>
471 Programming:
<a href='api-cups.html'
>CUPS API
</a><br>
472 Programming:
<a href='api-cups.html'
>PPD API
</a><br>
473 References:
<a href='spec-ppd.html'
>CUPS PPD Specification
</a></td>
477 <div class=
"contents">
478 <h2 class=
"title">Contents
</h2>
479 <ul class=
"contents">
480 <li><a href=
"#OVERVIEW">Overview
</a></li>
481 <li><a href=
"#TASKS">Functions by Task
</a><ul class=
"subcontents">
482 <li><a href=
"#OPENCLOSE">Opening and Closing Raster Streams
</a></li>
483 <li><a href=
"#READING">Reading Raster Streams
</a></li>
484 <li><a href=
"#WRITING">Writing Raster Streams
</a></li>
486 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"subcontents">
487 <li><a href=
"#cupsRasterClose">cupsRasterClose
</a></li>
488 <li><a href=
"#cupsRasterInitPWGHeader">cupsRasterInitPWGHeader
</a></li>
489 <li><a href=
"#cupsRasterInterpretPPD">cupsRasterInterpretPPD
</a></li>
490 <li><a href=
"#cupsRasterOpen">cupsRasterOpen
</a></li>
491 <li><a href=
"#cupsRasterOpenIO">cupsRasterOpenIO
</a></li>
492 <li><a href=
"#cupsRasterReadHeader">cupsRasterReadHeader
</a></li>
493 <li><a href=
"#cupsRasterReadHeader2">cupsRasterReadHeader2
</a></li>
494 <li><a href=
"#cupsRasterReadPixels">cupsRasterReadPixels
</a></li>
495 <li><a href=
"#cupsRasterWriteHeader">cupsRasterWriteHeader
</a></li>
496 <li><a href=
"#cupsRasterWriteHeader2">cupsRasterWriteHeader2
</a></li>
497 <li><a href=
"#cupsRasterWritePixels">cupsRasterWritePixels
</a></li>
499 <li><a href=
"#TYPES">Data Types
</a><ul class=
"subcontents">
500 <li><a href=
"#cups_adv_t">cups_adv_t
</a></li>
501 <li><a href=
"#cups_bool_t">cups_bool_t
</a></li>
502 <li><a href=
"#cups_cspace_t">cups_cspace_t
</a></li>
503 <li><a href=
"#cups_cut_t">cups_cut_t
</a></li>
504 <li><a href=
"#cups_edge_t">cups_edge_t
</a></li>
505 <li><a href=
"#cups_interpret_cb_t">cups_interpret_cb_t
</a></li>
506 <li><a href=
"#cups_jog_t">cups_jog_t
</a></li>
507 <li><a href=
"#cups_mode_t">cups_mode_t
</a></li>
508 <li><a href=
"#cups_order_t">cups_order_t
</a></li>
509 <li><a href=
"#cups_orient_t">cups_orient_t
</a></li>
510 <li><a href=
"#cups_page_header2_t">cups_page_header2_t
</a></li>
511 <li><a href=
"#cups_page_header_t">cups_page_header_t
</a></li>
512 <li><a href=
"#cups_raster_iocb_t">cups_raster_iocb_t
</a></li>
513 <li><a href=
"#cups_raster_t">cups_raster_t
</a></li>
515 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"subcontents">
516 <li><a href=
"#cups_page_header2_s">cups_page_header2_s
</a></li>
517 <li><a href=
"#cups_page_header_s">cups_page_header_s
</a></li>
519 <li><a href=
"#ENUMERATIONS">Enumerations
</a><ul class=
"subcontents">
520 <li><a href=
"#cups_adv_e">cups_adv_e
</a></li>
521 <li><a href=
"#cups_bool_e">cups_bool_e
</a></li>
522 <li><a href=
"#cups_cspace_e">cups_cspace_e
</a></li>
523 <li><a href=
"#cups_cut_e">cups_cut_e
</a></li>
524 <li><a href=
"#cups_edge_e">cups_edge_e
</a></li>
525 <li><a href=
"#cups_jog_e">cups_jog_e
</a></li>
526 <li><a href=
"#cups_mode_e">cups_mode_e
</a></li>
527 <li><a href=
"#cups_order_e">cups_order_e
</a></li>
528 <li><a href=
"#cups_orient_e">cups_orient_e
</a></li>
534 Raster API introduction for CUPS.
536 Copyright 2007-2013 by Apple Inc.
537 Copyright 1997-2006 by Easy Software Products, all rights reserved.
539 These coded instructions, statements, and computer programs are the
540 property of Apple Inc. and are protected by Federal copyright
541 law. Distribution and use rights are outlined in the file "LICENSE.txt"
542 which should have been included with this file. If this file is
543 file is missing or damaged, see the license at "http://www.cups.org/".
546 <h2 class='title'
><a name=
"OVERVIEW">Overview
</a></h2>
548 <p>The CUPS raster API provides a standard interface for reading and writing
549 CUPS raster streams which are used for printing to raster printers. Because the
550 raster format is updated from time to time, it is important to use this API to
551 avoid incompatibilities with newer versions of CUPS.
</p>
553 <p>Two kinds of CUPS filters use the CUPS raster API - raster image processor
554 (RIP) filters such as
<code>pstoraster
</code> and
<code>cgpdftoraster
</code>
555 (macOS) that produce CUPS raster files and printer driver filters that
556 convert CUPS raster files into a format usable by the printer. Printer
557 driver filters are by far the most common.
</p>
559 <p>CUPS raster files (
<code>application/vnd.cups-raster
</code>) consists of
560 a stream of raster page descriptions produced by one of the RIP filters such as
561 <var>pstoraster
</var>,
<var>imagetoraster
</var>, or
562 <var>cgpdftoraster
</var>. CUPS raster files are referred to using the
563 <a href='#cups_raster_t'
><code>cups_raster_t
</code></a> type and are
564 opened using the
<a href='#cupsRasterOpen'
><code>cupsRasterOpen
</code></a>
565 function. For example, to read raster data from the standard input, open
566 file descriptor
0:
</p>
568 <pre class=
"example">
569 #include
<cups/raster.h
>
571 <a href=
"#cups_raster_t">cups_raster_t
</a> *ras =
<a href=
"#cupsRasterOpen">cupsRasterOpen
</a>(
0, CUPS_RASTER_READ);
574 <p>Each page of data begins with a page dictionary structure called
575 <a href=
"#cups_page_header2_t"><code>cups_page_header2_t
</code></a>. This
576 structure contains the colorspace, bits per color, media size, media type,
577 hardware resolution, and so forth used for the page.
</p>
579 <blockquote><b>Note:
</b>
581 <p>Do not confuse the colorspace in the page header with the PPD
582 <tt>ColorModel
</tt> keyword.
<tt>ColorModel
</tt> refers to the general type of
583 color used for a device (Gray, RGB, CMYK, DeviceN) and is often used to
584 select a particular colorspace for the page header along with the associate
585 color profile. The page header colorspace (
<tt>cupsColorSpace
</tt>) describes
586 both the type and organization of the color data, for example KCMY (black
587 first) instead of CMYK and RGBA (RGB + alpha) instead of RGB.
</p>
591 <p>You read the page header using the
592 <a href=
"#cupsRasterReadHeader2"><code>cupsRasterReadHeader2
</code></a>
595 <pre class=
"example">
596 #include
<cups/raster.h
>
598 <a href=
"#cups_raster_t">cups_raster_t
</a> *ras =
<a href=
"#cupsRasterOpen">cupsRasterOpen
</a>(
0, CUPS_RASTER_READ);
599 <a href=
"#cups_page_header2_t">cups_page_header2_t
</a> header;
601 while (
<a href=
"#cupsRasterReadHeader2">cupsRasterReadHeader2
</a>(ras,
&header))
603 /* setup this page */
605 /* read raster data */
607 /* finish this page */
611 <p>After the page dictionary comes the page data which is a full-resolution,
612 possibly compressed bitmap representing the page in the printer's output
613 colorspace. You read uncompressed raster data using the
614 <a href=
"#cupsRasterReadPixels"><code>cupsRasterReadPixels
</code></a>
615 function. A
<code>for
</code> loop is normally used to read the page one line
618 <pre class=
"example">
619 #include
<cups/raster.h
>
621 <a href=
"#cups_raster_t">cups_raster_t
</a> *ras =
<a href=
"#cupsRasterOpen">cupsRasterOpen
</a>(
0, CUPS_RASTER_READ);
622 <a href=
"#cups_page_header2_t">cups_page_header2_t
</a> header;
627 while (
<a href=
"#cupsRasterReadHeader2">cupsRasterReadHeader2
</a>(ras,
&header))
629 /* setup this page */
631 fprintf(stderr,
"PAGE: %d %d\n", page, header.NumCopies);
633 /* allocate memory for
1 line */
634 buffer = malloc(header.cupsBytesPerLine);
636 /* read raster data */
637 for (y =
0; y
< header.cupsHeight; y ++)
639 if (
<a href=
"#cupsRasterReadPixels">cupsRasterReadPixels
</a>(ras, buffer, header.cupsBytesPerLine) ==
0)
642 /* write raster data to printer on stdout */
645 /* finish this page */
649 <p>When you are done reading the raster data, call the
650 <a href=
"#cupsRasterClose"><code>cupsRasterClose
</code></a> function to free
651 the memory used to read the raster file:
</p>
653 <pre class=
"example">
654 <a href=
"#cups_raster_t">cups_raster_t
</a> *ras;
656 <a href=
"#cupsRasterClose">cupsRasterClose
</a>(ras);
660 <h2 class='title'
><a name=
"TASKS">Functions by Task
</a></h2>
662 <h3><a name=
"OPENCLOSE">Opening and Closing Raster Streams
</a></h3>
666 <li><a href=
"#cupsRasterClose" title=
"Close a raster stream.">cupsRasterClose
</a></li>
667 <li><a href=
"#cupsRasterOpen" title=
"Open a raster stream.">cupsRasterOpen
</a></li>
671 <h3><a name=
"READING">Reading Raster Streams
</a></h3>
675 <li><a href=
"#cupsRasterReadHeader" title=
"Read a raster page header and store it in a version 1 page header structure.">cupsRasterReadHeader
</a> <span class=
"info">Deprecated in CUPS
1.2/macOS
10.5</span></li>
676 <li><a href=
"#cupsRasterReadHeader2" title=
"Read a raster page header and store it in a version 2 page header structure.">cupsRasterReadHeader2
</a></li>
677 <li><a href=
"#cupsRasterReadPixels" title=
"Read raster pixels.">cupsRasterReadPixels
</a></li>
681 <h3><a name=
"WRITING">Writing Raster Streams
</a></h3>
685 <li><a href=
"#cupsRasterInterpretPPD" title=
"Interpret PPD commands to create a page header.">cupsRasterInterpretPPD
</a></li>
686 <li><a href=
"#cupsRasterWriteHeader" title=
"Write a raster page header from a version 1 page header structure.">cupsRasterWriteHeader
</a> <span class=
"info">Deprecated in CUPS
1.2/macOS
10.5</span></li>
687 <li><a href=
"#cupsRasterWriteHeader2" title=
"Write a raster page header from a version 2 page header structure.">cupsRasterWriteHeader2
</a></li>
688 <li><a href=
"#cupsRasterWritePixels" title=
"Write raster pixels.">cupsRasterWritePixels
</a></li>
691 <h2 class=
"title"><a id=
"FUNCTIONS">Functions
</a></h2>
692 <h3 class=
"function"><a id=
"cupsRasterClose">cupsRasterClose
</a></h3>
693 <p class=
"description">Close a raster stream.
</p>
695 void cupsRasterClose(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r);
</p>
696 <h4 class=
"parameters">Parameters
</h4>
697 <table class=
"list"><tbody>
699 <td class=
"description">Stream to close
</td></tr>
701 <h4 class=
"discussion">Discussion
</h4>
702 <p class=
"discussion">The file descriptor associated with the raster stream must be closed
703 separately as needed.
</p>
704 <h3 class=
"function"><span class=
"info"> CUPS
2.2/macOS
10.12 </span><a id=
"cupsRasterInitPWGHeader">cupsRasterInitPWGHeader
</a></h3>
705 <p class=
"description">Initialize a page header for PWG Raster output.
</p>
707 int cupsRasterInitPWGHeader(
<a href=
"#cups_page_header2_t">cups_page_header2_t
</a> *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back);
</p>
708 <h4 class=
"parameters">Parameters
</h4>
709 <table class=
"list"><tbody>
711 <td class=
"description">Page header
</td></tr>
713 <td class=
"description">PWG media information
</td></tr>
715 <td class=
"description">PWG raster type string
</td></tr>
717 <td class=
"description">Cross-feed direction (horizontal) resolution
</td></tr>
719 <td class=
"description">Feed direction (vertical) resolution
</td></tr>
721 <td class=
"description">IPP
"sides
" option value
</td></tr>
722 <tr><th>sheet_back
</th>
723 <td class=
"description">Transform for back side or
<code>NULL
</code> for none
</td></tr>
725 <h4 class=
"returnvalue">Return Value
</h4>
726 <p class=
"description">1 on success,
0 on failure
</p>
727 <h4 class=
"discussion">Discussion
</h4>
728 <p class=
"discussion">The
"media
" argument specifies the media to use.
<br>
730 The
"type
" argument specifies a
"pwg-raster-document-type-supported
" value
731 that controls the color space and bit depth of the raster data.
<br>
733 The
"xres
" and
"yres
" arguments specify the raster resolution in dots per
736 The
"sheet_back
" argument specifies a
"pwg-raster-document-sheet-back
" value
737 to apply for the back side of a page. Pass
<code>NULL
</code> for the front side.
740 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsRasterInterpretPPD">cupsRasterInterpretPPD
</a></h3>
741 <p class=
"description">Interpret PPD commands to create a page header.
</p>
743 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);
</p>
744 <h4 class=
"parameters">Parameters
</h4>
745 <table class=
"list"><tbody>
747 <td class=
"description">Page header to create
</td></tr>
749 <td class=
"description">PPD file
</td></tr>
750 <tr><th>num_options
</th>
751 <td class=
"description">Number of options
</td></tr>
753 <td class=
"description">Options
</td></tr>
755 <td class=
"description">Optional page header callback (
<code>NULL
</code> for none)
</td></tr>
757 <h4 class=
"returnvalue">Return Value
</h4>
758 <p class=
"description">0 on success, -
1 on failure
</p>
759 <h4 class=
"discussion">Discussion
</h4>
760 <p class=
"discussion">This function is used by raster image processing (RIP) filters like
761 cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
762 It is not used by raster printer driver filters which only read CUPS
766 <code>cupsRasterInterpretPPD
</code> does not mark the options in the PPD using
767 the
"num_options
" and
"options
" arguments. Instead, mark the options with
768 <code>cupsMarkOptions
</code> and
<code>ppdMarkOption
</code> prior to calling it -
769 this allows for per-page options without manipulating the options array.
<br>
771 The
"func
" argument specifies an optional callback function that is
772 called prior to the computation of the final raster data. The function
773 can make changes to the
<a href=
"#cups_page_header2_t"><code>cups_page_header2_t
</code></a> data as needed to use a
774 supported raster format and then returns
0 on success and -
1 if the
775 requested attributes cannot be supported.
<br>
778 <code>cupsRasterInterpretPPD
</code> supports a subset of the PostScript language.
779 Currently only the
<code>[
</code>,
<code>]
</code>,
<code><<</code>,
<code>>></code>,
<code>{
</code>,
780 <code>}
</code>,
<code>cleartomark
</code>,
<code>copy
</code>,
<code>dup
</code>,
<code>index
</code>,
781 <code>pop
</code>,
<code>roll
</code>,
<code>setpagedevice
</code>, and
<code>stopped
</code> operators
785 <h3 class=
"function"><a id=
"cupsRasterOpen">cupsRasterOpen
</a></h3>
786 <p class=
"description">Open a raster stream using a file descriptor.
</p>
788 <a href=
"#cups_raster_t">cups_raster_t
</a> *cupsRasterOpen(int fd,
<a href=
"#cups_mode_t">cups_mode_t
</a> mode);
</p>
789 <h4 class=
"parameters">Parameters
</h4>
790 <table class=
"list"><tbody>
792 <td class=
"description">File descriptor
</td></tr>
794 <td class=
"description">Mode -
<code>CUPS_RASTER_READ
</code>,
795 <code>CUPS_RASTER_WRITE
</code>,
796 <code>CUPS_RASTER_WRITE_COMPRESSED
</code>,
797 or
<code>CUPS_RASTER_WRITE_PWG
</code></td></tr>
799 <h4 class=
"returnvalue">Return Value
</h4>
800 <p class=
"description">New stream
</p>
801 <h4 class=
"discussion">Discussion
</h4>
802 <p class=
"discussion">This function associates a raster stream with the given file descriptor.
803 For most printer driver filters,
"fd
" will be
0 (stdin). For most raster
804 image processor (RIP) filters that generate raster data,
"fd
" will be
1
807 When writing raster data, the
<code>CUPS_RASTER_WRITE
</code>,
808 <code>CUPS_RASTER_WRITE_COMPRESS
</code>, or
<code>CUPS_RASTER_WRITE_PWG
</code> mode can
809 be used - compressed and PWG output is generally
25-
50% smaller but adds a
810 100-
300% execution time overhead.
</p>
811 <h3 class=
"function"><a id=
"cupsRasterOpenIO">cupsRasterOpenIO
</a></h3>
812 <p class=
"description">Open a raster stream using a callback function.
</p>
814 <a href=
"#cups_raster_t">cups_raster_t
</a> *cupsRasterOpenIO(
<a href=
"#cups_raster_iocb_t">cups_raster_iocb_t
</a> iocb, void *ctx,
<a href=
"#cups_mode_t">cups_mode_t
</a> mode);
</p>
815 <h4 class=
"parameters">Parameters
</h4>
816 <table class=
"list"><tbody>
818 <td class=
"description">Read/write callback
</td></tr>
820 <td class=
"description">Context pointer for callback
</td></tr>
822 <td class=
"description">Mode -
<code>CUPS_RASTER_READ
</code>,
823 <code>CUPS_RASTER_WRITE
</code>,
824 <code>CUPS_RASTER_WRITE_COMPRESSED
</code>,
825 or
<code>CUPS_RASTER_WRITE_PWG
</code></td></tr>
827 <h4 class=
"returnvalue">Return Value
</h4>
828 <p class=
"description">New stream
</p>
829 <h4 class=
"discussion">Discussion
</h4>
830 <p class=
"discussion">This function associates a raster stream with the given callback function and
833 When writing raster data, the
<code>CUPS_RASTER_WRITE
</code>,
834 <code>CUPS_RASTER_WRITE_COMPRESS
</code>, or
<code>CUPS_RASTER_WRITE_PWG
</code> mode can
835 be used - compressed and PWG output is generally
25-
50% smaller but adds a
836 100-
300% execution time overhead.
</p>
837 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsRasterReadHeader">cupsRasterReadHeader
</a></h3>
838 <p class=
"description">Read a raster page header and store it in a
839 version
1 page header structure.
</p>
841 unsigned cupsRasterReadHeader(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r,
<a href=
"#cups_page_header_t">cups_page_header_t
</a> *h);
</p>
842 <h4 class=
"parameters">Parameters
</h4>
843 <table class=
"list"><tbody>
845 <td class=
"description">Raster stream
</td></tr>
847 <td class=
"description">Pointer to header data
</td></tr>
849 <h4 class=
"returnvalue">Return Value
</h4>
850 <p class=
"description">1 on success,
0 on failure/end-of-file
</p>
851 <h4 class=
"discussion">Discussion
</h4>
852 <p class=
"discussion">This function is deprecated. Use
<a href=
"#cupsRasterReadHeader2"><code>cupsRasterReadHeader2
</code></a> instead.
<br>
854 Version
1 page headers were used in CUPS
1.0 and
1.1 and contain a subset
855 of the version
2 page header data. This function handles reading version
2
856 page headers and copying only the version
1 data into the provided buffer.
859 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsRasterReadHeader2">cupsRasterReadHeader2
</a></h3>
860 <p class=
"description">Read a raster page header and store it in a
861 version
2 page header structure.
</p>
863 unsigned cupsRasterReadHeader2(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r,
<a href=
"#cups_page_header2_t">cups_page_header2_t
</a> *h);
</p>
864 <h4 class=
"parameters">Parameters
</h4>
865 <table class=
"list"><tbody>
867 <td class=
"description">Raster stream
</td></tr>
869 <td class=
"description">Pointer to header data
</td></tr>
871 <h4 class=
"returnvalue">Return Value
</h4>
872 <p class=
"description">1 on success,
0 on failure/end-of-file
</p>
873 <h3 class=
"function"><a id=
"cupsRasterReadPixels">cupsRasterReadPixels
</a></h3>
874 <p class=
"description">Read raster pixels.
</p>
876 unsigned cupsRasterReadPixels(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r, unsigned char *p, unsigned len);
</p>
877 <h4 class=
"parameters">Parameters
</h4>
878 <table class=
"list"><tbody>
880 <td class=
"description">Raster stream
</td></tr>
882 <td class=
"description">Pointer to pixel buffer
</td></tr>
884 <td class=
"description">Number of bytes to read
</td></tr>
886 <h4 class=
"returnvalue">Return Value
</h4>
887 <p class=
"description">Number of bytes read
</p>
888 <h4 class=
"discussion">Discussion
</h4>
889 <p class=
"discussion">For best performance, filters should read one or more whole lines.
890 The
"cupsBytesPerLine
" value from the page header can be used to allocate
891 the line buffer and as the number of bytes to read.
</p>
892 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsRasterWriteHeader">cupsRasterWriteHeader
</a></h3>
893 <p class=
"description">Write a raster page header from a version
1 page
894 header structure.
</p>
896 unsigned cupsRasterWriteHeader(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r,
<a href=
"#cups_page_header_t">cups_page_header_t
</a> *h);
</p>
897 <h4 class=
"parameters">Parameters
</h4>
898 <table class=
"list"><tbody>
900 <td class=
"description">Raster stream
</td></tr>
902 <td class=
"description">Raster page header
</td></tr>
904 <h4 class=
"returnvalue">Return Value
</h4>
905 <p class=
"description">1 on success,
0 on failure
</p>
906 <h4 class=
"discussion">Discussion
</h4>
907 <p class=
"discussion">This function is deprecated. Use
<a href=
"#cupsRasterWriteHeader2"><code>cupsRasterWriteHeader2
</code></a> instead.
910 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsRasterWriteHeader2">cupsRasterWriteHeader2
</a></h3>
911 <p class=
"description">Write a raster page header from a version
2
912 page header structure.
</p>
914 unsigned cupsRasterWriteHeader2(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r,
<a href=
"#cups_page_header2_t">cups_page_header2_t
</a> *h);
</p>
915 <h4 class=
"parameters">Parameters
</h4>
916 <table class=
"list"><tbody>
918 <td class=
"description">Raster stream
</td></tr>
920 <td class=
"description">Raster page header
</td></tr>
922 <h4 class=
"returnvalue">Return Value
</h4>
923 <p class=
"description">1 on success,
0 on failure
</p>
924 <h4 class=
"discussion">Discussion
</h4>
925 <p class=
"discussion">The page header can be initialized using
<a href=
"#cupsRasterInitPWGHeader"><code>cupsRasterInitPWGHeader
</code></a>.
928 <h3 class=
"function"><a id=
"cupsRasterWritePixels">cupsRasterWritePixels
</a></h3>
929 <p class=
"description">Write raster pixels.
</p>
931 unsigned cupsRasterWritePixels(
<a href=
"#cups_raster_t">cups_raster_t
</a> *r, unsigned char *p, unsigned len);
</p>
932 <h4 class=
"parameters">Parameters
</h4>
933 <table class=
"list"><tbody>
935 <td class=
"description">Raster stream
</td></tr>
937 <td class=
"description">Bytes to write
</td></tr>
939 <td class=
"description">Number of bytes to write
</td></tr>
941 <h4 class=
"returnvalue">Return Value
</h4>
942 <p class=
"description">Number of bytes written
</p>
943 <h4 class=
"discussion">Discussion
</h4>
944 <p class=
"discussion">For best performance, filters should write one or more whole lines.
945 The
"cupsBytesPerLine
" value from the page header can be used to allocate
946 the line buffer and as the number of bytes to write.
</p>
947 <h2 class=
"title"><a id=
"TYPES">Data Types
</a></h2>
948 <h3 class=
"typedef"><a id=
"cups_adv_t">cups_adv_t
</a></h3>
949 <p class=
"description">AdvanceMedia attribute values
</p>
951 typedef enum
<a href=
"#cups_adv_e">cups_adv_e
</a> cups_adv_t;
953 <h3 class=
"typedef"><a id=
"cups_bool_t">cups_bool_t
</a></h3>
954 <p class=
"description">Boolean type
</p>
956 typedef enum
<a href=
"#cups_bool_e">cups_bool_e
</a> cups_bool_t;
958 <h3 class=
"typedef"><a id=
"cups_cspace_t">cups_cspace_t
</a></h3>
959 <p class=
"description">cupsColorSpace attribute values
</p>
961 typedef enum
<a href=
"#cups_cspace_e">cups_cspace_e
</a> cups_cspace_t;
963 <h3 class=
"typedef"><a id=
"cups_cut_t">cups_cut_t
</a></h3>
964 <p class=
"description">CutMedia attribute values
</p>
966 typedef enum
<a href=
"#cups_cut_e">cups_cut_e
</a> cups_cut_t;
968 <h3 class=
"typedef"><a id=
"cups_edge_t">cups_edge_t
</a></h3>
969 <p class=
"description">LeadingEdge attribute values
</p>
971 typedef enum
<a href=
"#cups_edge_e">cups_edge_e
</a> cups_edge_t;
973 <h3 class=
"typedef"><a id=
"cups_interpret_cb_t">cups_interpret_cb_t
</a></h3>
974 <p class=
"description">cupsRasterInterpretPPD callback function
</p>
976 typedef int (*cups_interpret_cb_t)(
<a href=
"#cups_page_header2_t">cups_page_header2_t
</a> *header, int preferred_bits);
978 <h3 class=
"typedef"><a id=
"cups_jog_t">cups_jog_t
</a></h3>
979 <p class=
"description">Jog attribute values
</p>
981 typedef enum
<a href=
"#cups_jog_e">cups_jog_e
</a> cups_jog_t;
983 <h3 class=
"typedef"><a id=
"cups_mode_t">cups_mode_t
</a></h3>
984 <p class=
"description">cupsRasterOpen modes
</p>
986 typedef enum
<a href=
"#cups_mode_e">cups_mode_e
</a> cups_mode_t;
988 <h3 class=
"typedef"><a id=
"cups_order_t">cups_order_t
</a></h3>
989 <p class=
"description">cupsColorOrder attribute values
</p>
991 typedef enum
<a href=
"#cups_order_e">cups_order_e
</a> cups_order_t;
993 <h3 class=
"typedef"><a id=
"cups_orient_t">cups_orient_t
</a></h3>
994 <p class=
"description">Orientation attribute values
</p>
996 typedef enum
<a href=
"#cups_orient_e">cups_orient_e
</a> cups_orient_t;
998 <h3 class=
"typedef"><a id=
"cups_page_header2_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>cups_page_header2_t
</a></h3>
999 <p class=
"description">Version
2 page header
</p>
1001 typedef struct
<a href=
"#cups_page_header2_s">cups_page_header2_s
</a> cups_page_header2_t;
1003 <h3 class=
"typedef"><a id=
"cups_page_header_t"><span class=
"info"> DEPRECATED
 </span>cups_page_header_t
</a></h3>
1004 <p class=
"description">Version
1 page header
</p>
1006 typedef struct
<a href=
"#cups_page_header_s">cups_page_header_s
</a> cups_page_header_t;
1008 <h3 class=
"typedef"><a id=
"cups_raster_iocb_t">cups_raster_iocb_t
</a></h3>
1009 <p class=
"description">cupsRasterOpenIO callback function
</p>
1011 typedef ssize_t (*cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length);
1013 <h3 class=
"typedef"><a id=
"cups_raster_t">cups_raster_t
</a></h3>
1014 <p class=
"description">Raster stream data
</p>
1016 typedef struct _cups_raster_s cups_raster_t;
1018 <h2 class=
"title"><a id=
"STRUCTURES">Structures
</a></h2>
1019 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cups_page_header2_s">cups_page_header2_s
</a></h3>
1020 <p class=
"description">Version
2 page header
</p>
1021 <p class=
"code">struct cups_page_header2_s {
<br>
1022     unsigned AdvanceDistance;
<br>
1023     <a href=
"#cups_adv_t">cups_adv_t
</a> AdvanceMedia;
<br>
1024     <a href=
"#cups_bool_t">cups_bool_t
</a> Collate;
<br>
1025     <a href=
"#cups_cut_t">cups_cut_t
</a> CutMedia;
<br>
1026     <a href=
"#cups_bool_t">cups_bool_t
</a> Duplex;
<br>
1027     unsigned HWResolution[
2];
<br>
1028     unsigned ImagingBoundingBox[
4];
<br>
1029     <a href=
"#cups_bool_t">cups_bool_t
</a> InsertSheet;
<br>
1030     <a href=
"#cups_jog_t">cups_jog_t
</a> Jog;
<br>
1031     <a href=
"#cups_edge_t">cups_edge_t
</a> LeadingEdge;
<br>
1032     <a href=
"#cups_bool_t">cups_bool_t
</a> ManualFeed;
<br>
1033     unsigned Margins[
2];
<br>
1034     char MediaClass[
64];
<br>
1035     char MediaColor[
64];
<br>
1036     unsigned MediaPosition;
<br>
1037     char MediaType[
64];
<br>
1038     unsigned MediaWeight;
<br>
1039     <a href=
"#cups_bool_t">cups_bool_t
</a> MirrorPrint;
<br>
1040     <a href=
"#cups_bool_t">cups_bool_t
</a> NegativePrint;
<br>
1041     unsigned NumCopies;
<br>
1042     <a href=
"#cups_orient_t">cups_orient_t
</a> Orientation;
<br>
1043     <a href=
"#cups_bool_t">cups_bool_t
</a> OutputFaceUp;
<br>
1044     char OutputType[
64];
<br>
1045     unsigned PageSize[
2];
<br>
1046     <a href=
"#cups_bool_t">cups_bool_t
</a> Separations;
<br>
1047     <a href=
"#cups_bool_t">cups_bool_t
</a> TraySwitch;
<br>
1048     <a href=
"#cups_bool_t">cups_bool_t
</a> Tumble;
<br>
1049     unsigned cupsBitsPerColor;
<br>
1050     unsigned cupsBitsPerPixel;
<br>
1051     float cupsBorderlessScalingFactor;
<br>
1052     unsigned cupsBytesPerLine;
<br>
1053     <a href=
"#cups_order_t">cups_order_t
</a> cupsColorOrder;
<br>
1054     <a href=
"#cups_cspace_t">cups_cspace_t
</a> cupsColorSpace;
<br>
1055     unsigned cupsCompression;
<br>
1056     unsigned cupsHeight;
<br>
1057     float cupsImagingBBox[
4];
<br>
1058     unsigned cupsInteger[
16];
<br>
1059     char cupsMarkerType[
64];
<br>
1060     unsigned cupsMediaType;
<br>
1061     unsigned cupsNumColors;
<br>
1062     char cupsPageSizeName[
64];
<br>
1063     float cupsPageSize[
2];
<br>
1064     float cupsReal[
16];
<br>
1065     char cupsRenderingIntent[
64];
<br>
1066     unsigned cupsRowCount;
<br>
1067     unsigned cupsRowFeed;
<br>
1068     unsigned cupsRowStep;
<br>
1069     char cupsString[
16][
64];
<br>
1070     unsigned cupsWidth;
<br>
1072 <h4 class=
"members">Members
</h4>
1073 <table class=
"list"><tbody>
1074 <tr><th>AdvanceDistance
</th>
1075 <td class=
"description">AdvanceDistance value in points
</td></tr>
1076 <tr><th>AdvanceMedia
</th>
1077 <td class=
"description">AdvanceMedia value (
<a href=
"#cups_adv_t"><code>cups_adv_t
</code></a>)
</td></tr>
1078 <tr><th>Collate
</th>
1079 <td class=
"description">Collated copies value
</td></tr>
1080 <tr><th>CutMedia
</th>
1081 <td class=
"description">CutMedia value (
<a href=
"#cups_cut_t"><code>cups_cut_t
</code></a>)
</td></tr>
1082 <tr><th>Duplex
</th>
1083 <td class=
"description">Duplexed (double-sided) value
</td></tr>
1084 <tr><th>HWResolution[
2]
</th>
1085 <td class=
"description">Resolution in dots-per-inch
</td></tr>
1086 <tr><th>ImagingBoundingBox[
4]
</th>
1087 <td class=
"description">Pixel region that is painted (points, left, bottom, right, top)
</td></tr>
1088 <tr><th>InsertSheet
</th>
1089 <td class=
"description">InsertSheet value
</td></tr>
1091 <td class=
"description">Jog value (
<a href=
"#cups_jog_t"><code>cups_jog_t
</code></a>)
</td></tr>
1092 <tr><th>LeadingEdge
</th>
1093 <td class=
"description">LeadingEdge value (
<a href=
"#cups_edge_t"><code>cups_edge_t
</code></a>)
</td></tr>
1094 <tr><th>ManualFeed
</th>
1095 <td class=
"description">ManualFeed value
</td></tr>
1096 <tr><th>Margins[
2]
</th>
1097 <td class=
"description">Lower-lefthand margins in points
</td></tr>
1098 <tr><th>MediaClass[
64]
</th>
1099 <td class=
"description">MediaClass string
</td></tr>
1100 <tr><th>MediaColor[
64]
</th>
1101 <td class=
"description">MediaColor string
</td></tr>
1102 <tr><th>MediaPosition
</th>
1103 <td class=
"description">MediaPosition value
</td></tr>
1104 <tr><th>MediaType[
64]
</th>
1105 <td class=
"description">MediaType string
</td></tr>
1106 <tr><th>MediaWeight
</th>
1107 <td class=
"description">MediaWeight value in grams/m^
2</td></tr>
1108 <tr><th>MirrorPrint
</th>
1109 <td class=
"description">MirrorPrint value
</td></tr>
1110 <tr><th>NegativePrint
</th>
1111 <td class=
"description">NegativePrint value
</td></tr>
1112 <tr><th>NumCopies
</th>
1113 <td class=
"description">Number of copies to produce
</td></tr>
1114 <tr><th>Orientation
</th>
1115 <td class=
"description">Orientation value (
<a href=
"#cups_orient_t"><code>cups_orient_t
</code></a>)
</td></tr>
1116 <tr><th>OutputFaceUp
</th>
1117 <td class=
"description">OutputFaceUp value
</td></tr>
1118 <tr><th>OutputType[
64]
</th>
1119 <td class=
"description">OutputType string
</td></tr>
1120 <tr><th>PageSize[
2]
</th>
1121 <td class=
"description">Width and length of page in points
</td></tr>
1122 <tr><th>Separations
</th>
1123 <td class=
"description">Separations value
</td></tr>
1124 <tr><th>TraySwitch
</th>
1125 <td class=
"description">TraySwitch value
</td></tr>
1126 <tr><th>Tumble
</th>
1127 <td class=
"description">Tumble value
</td></tr>
1128 <tr><th>cupsBitsPerColor
</th>
1129 <td class=
"description">Number of bits for each color
</td></tr>
1130 <tr><th>cupsBitsPerPixel
</th>
1131 <td class=
"description">Number of bits for each pixel
</td></tr>
1132 <tr><th>cupsBorderlessScalingFactor
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1133 <td class=
"description">Scaling that was applied to page data
</td></tr>
1134 <tr><th>cupsBytesPerLine
</th>
1135 <td class=
"description">Number of bytes per line
</td></tr>
1136 <tr><th>cupsColorOrder
</th>
1137 <td class=
"description">Order of colors
</td></tr>
1138 <tr><th>cupsColorSpace
</th>
1139 <td class=
"description">True colorspace
</td></tr>
1140 <tr><th>cupsCompression
</th>
1141 <td class=
"description">Device compression to use
</td></tr>
1142 <tr><th>cupsHeight
</th>
1143 <td class=
"description">Height of page image in pixels
</td></tr>
1144 <tr><th>cupsImagingBBox[
4]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1145 <td class=
"description">Floating point ImagingBoundingBox
1146 (scaling factor not applied, left,
1147 bottom, right, top)
</td></tr>
1148 <tr><th>cupsInteger[
16]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1149 <td class=
"description">User-defined integer values
</td></tr>
1150 <tr><th>cupsMarkerType[
64]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1151 <td class=
"description">Ink/toner type
</td></tr>
1152 <tr><th>cupsMediaType
</th>
1153 <td class=
"description">Media type code
</td></tr>
1154 <tr><th>cupsNumColors
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1155 <td class=
"description">Number of color compoents
</td></tr>
1156 <tr><th>cupsPageSizeName[
64]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1157 <td class=
"description">PageSize name
</td></tr>
1158 <tr><th>cupsPageSize[
2]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1159 <td class=
"description">Floating point PageSize (scaling *
1160 factor not applied)
</td></tr>
1161 <tr><th>cupsReal[
16]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1162 <td class=
"description">User-defined floating-point values
</td></tr>
1163 <tr><th>cupsRenderingIntent[
64]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1164 <td class=
"description">Color rendering intent
</td></tr>
1165 <tr><th>cupsRowCount
</th>
1166 <td class=
"description">Rows per band
</td></tr>
1167 <tr><th>cupsRowFeed
</th>
1168 <td class=
"description">Feed between bands
</td></tr>
1169 <tr><th>cupsRowStep
</th>
1170 <td class=
"description">Spacing between lines
</td></tr>
1171 <tr><th>cupsString[
16][
64]
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th>
1172 <td class=
"description">User-defined string values
</td></tr>
1173 <tr><th>cupsWidth
</th>
1174 <td class=
"description">Width of page image in pixels
</td></tr>
1176 <h3 class=
"struct"><span class=
"info"> DEPRECATED
 </span><a id=
"cups_page_header_s">cups_page_header_s
</a></h3>
1177 <p class=
"description">Version
1 page header
</p>
1178 <p class=
"code">struct cups_page_header_s {
<br>
1179     unsigned AdvanceDistance;
<br>
1180     <a href=
"#cups_adv_t">cups_adv_t
</a> AdvanceMedia;
<br>
1181     <a href=
"#cups_bool_t">cups_bool_t
</a> Collate;
<br>
1182     <a href=
"#cups_cut_t">cups_cut_t
</a> CutMedia;
<br>
1183     <a href=
"#cups_bool_t">cups_bool_t
</a> Duplex;
<br>
1184     unsigned HWResolution[
2];
<br>
1185     unsigned ImagingBoundingBox[
4];
<br>
1186     <a href=
"#cups_bool_t">cups_bool_t
</a> InsertSheet;
<br>
1187     <a href=
"#cups_jog_t">cups_jog_t
</a> Jog;
<br>
1188     <a href=
"#cups_edge_t">cups_edge_t
</a> LeadingEdge;
<br>
1189     <a href=
"#cups_bool_t">cups_bool_t
</a> ManualFeed;
<br>
1190     unsigned Margins[
2];
<br>
1191     char MediaClass[
64];
<br>
1192     char MediaColor[
64];
<br>
1193     unsigned MediaPosition;
<br>
1194     char MediaType[
64];
<br>
1195     unsigned MediaWeight;
<br>
1196     <a href=
"#cups_bool_t">cups_bool_t
</a> MirrorPrint;
<br>
1197     <a href=
"#cups_bool_t">cups_bool_t
</a> NegativePrint;
<br>
1198     unsigned NumCopies;
<br>
1199     <a href=
"#cups_orient_t">cups_orient_t
</a> Orientation;
<br>
1200     <a href=
"#cups_bool_t">cups_bool_t
</a> OutputFaceUp;
<br>
1201     char OutputType[
64];
<br>
1202     unsigned PageSize[
2];
<br>
1203     <a href=
"#cups_bool_t">cups_bool_t
</a> Separations;
<br>
1204     <a href=
"#cups_bool_t">cups_bool_t
</a> TraySwitch;
<br>
1205     <a href=
"#cups_bool_t">cups_bool_t
</a> Tumble;
<br>
1206     unsigned cupsBitsPerColor;
<br>
1207     unsigned cupsBitsPerPixel;
<br>
1208     unsigned cupsBytesPerLine;
<br>
1209     <a href=
"#cups_order_t">cups_order_t
</a> cupsColorOrder;
<br>
1210     <a href=
"#cups_cspace_t">cups_cspace_t
</a> cupsColorSpace;
<br>
1211     unsigned cupsCompression;
<br>
1212     unsigned cupsHeight;
<br>
1213     unsigned cupsMediaType;
<br>
1214     unsigned cupsRowCount;
<br>
1215     unsigned cupsRowFeed;
<br>
1216     unsigned cupsRowStep;
<br>
1217     unsigned cupsWidth;
<br>
1219 <h4 class=
"members">Members
</h4>
1220 <table class=
"list"><tbody>
1221 <tr><th>AdvanceDistance
</th>
1222 <td class=
"description">AdvanceDistance value in points
</td></tr>
1223 <tr><th>AdvanceMedia
</th>
1224 <td class=
"description">AdvanceMedia value (
<a href=
"#cups_adv_t"><code>cups_adv_t
</code></a>)
</td></tr>
1225 <tr><th>Collate
</th>
1226 <td class=
"description">Collated copies value
</td></tr>
1227 <tr><th>CutMedia
</th>
1228 <td class=
"description">CutMedia value (
<a href=
"#cups_cut_t"><code>cups_cut_t
</code></a>)
</td></tr>
1229 <tr><th>Duplex
</th>
1230 <td class=
"description">Duplexed (double-sided) value
</td></tr>
1231 <tr><th>HWResolution[
2]
</th>
1232 <td class=
"description">Resolution in dots-per-inch
</td></tr>
1233 <tr><th>ImagingBoundingBox[
4]
</th>
1234 <td class=
"description">Pixel region that is painted (points, left, bottom, right, top)
</td></tr>
1235 <tr><th>InsertSheet
</th>
1236 <td class=
"description">InsertSheet value
</td></tr>
1238 <td class=
"description">Jog value (
<a href=
"#cups_jog_t"><code>cups_jog_t
</code></a>)
</td></tr>
1239 <tr><th>LeadingEdge
</th>
1240 <td class=
"description">LeadingEdge value (
<a href=
"#cups_edge_t"><code>cups_edge_t
</code></a>)
</td></tr>
1241 <tr><th>ManualFeed
</th>
1242 <td class=
"description">ManualFeed value
</td></tr>
1243 <tr><th>Margins[
2]
</th>
1244 <td class=
"description">Lower-lefthand margins in points
</td></tr>
1245 <tr><th>MediaClass[
64]
</th>
1246 <td class=
"description">MediaClass string
</td></tr>
1247 <tr><th>MediaColor[
64]
</th>
1248 <td class=
"description">MediaColor string
</td></tr>
1249 <tr><th>MediaPosition
</th>
1250 <td class=
"description">MediaPosition value
</td></tr>
1251 <tr><th>MediaType[
64]
</th>
1252 <td class=
"description">MediaType string
</td></tr>
1253 <tr><th>MediaWeight
</th>
1254 <td class=
"description">MediaWeight value in grams/m^
2</td></tr>
1255 <tr><th>MirrorPrint
</th>
1256 <td class=
"description">MirrorPrint value
</td></tr>
1257 <tr><th>NegativePrint
</th>
1258 <td class=
"description">NegativePrint value
</td></tr>
1259 <tr><th>NumCopies
</th>
1260 <td class=
"description">Number of copies to produce
</td></tr>
1261 <tr><th>Orientation
</th>
1262 <td class=
"description">Orientation value (
<a href=
"#cups_orient_t"><code>cups_orient_t
</code></a>)
</td></tr>
1263 <tr><th>OutputFaceUp
</th>
1264 <td class=
"description">OutputFaceUp value
</td></tr>
1265 <tr><th>OutputType[
64]
</th>
1266 <td class=
"description">OutputType string
</td></tr>
1267 <tr><th>PageSize[
2]
</th>
1268 <td class=
"description">Width and length of page in points
</td></tr>
1269 <tr><th>Separations
</th>
1270 <td class=
"description">Separations value
</td></tr>
1271 <tr><th>TraySwitch
</th>
1272 <td class=
"description">TraySwitch value
</td></tr>
1273 <tr><th>Tumble
</th>
1274 <td class=
"description">Tumble value
</td></tr>
1275 <tr><th>cupsBitsPerColor
</th>
1276 <td class=
"description">Number of bits for each color
</td></tr>
1277 <tr><th>cupsBitsPerPixel
</th>
1278 <td class=
"description">Number of bits for each pixel
</td></tr>
1279 <tr><th>cupsBytesPerLine
</th>
1280 <td class=
"description">Number of bytes per line
</td></tr>
1281 <tr><th>cupsColorOrder
</th>
1282 <td class=
"description">Order of colors
</td></tr>
1283 <tr><th>cupsColorSpace
</th>
1284 <td class=
"description">True colorspace
</td></tr>
1285 <tr><th>cupsCompression
</th>
1286 <td class=
"description">Device compression to use
</td></tr>
1287 <tr><th>cupsHeight
</th>
1288 <td class=
"description">Height of page image in pixels
</td></tr>
1289 <tr><th>cupsMediaType
</th>
1290 <td class=
"description">Media type code
</td></tr>
1291 <tr><th>cupsRowCount
</th>
1292 <td class=
"description">Rows per band
</td></tr>
1293 <tr><th>cupsRowFeed
</th>
1294 <td class=
"description">Feed between bands
</td></tr>
1295 <tr><th>cupsRowStep
</th>
1296 <td class=
"description">Spacing between lines
</td></tr>
1297 <tr><th>cupsWidth
</th>
1298 <td class=
"description">Width of page image in pixels
</td></tr>
1300 <h2 class=
"title"><a id=
"ENUMERATIONS">Constants
</a></h2>
1301 <h3 class=
"enumeration"><a id=
"cups_adv_e">cups_adv_e
</a></h3>
1302 <p class=
"description">AdvanceMedia attribute values
</p>
1303 <h4 class=
"constants">Constants
</h4>
1304 <table class=
"list"><tbody>
1305 <tr><th>CUPS_ADVANCE_FILE
</th> <td class=
"description">Advance the roll after this file
</td></tr>
1306 <tr><th>CUPS_ADVANCE_JOB
</th> <td class=
"description">Advance the roll after this job
</td></tr>
1307 <tr><th>CUPS_ADVANCE_NONE
</th> <td class=
"description">Never advance the roll
</td></tr>
1308 <tr><th>CUPS_ADVANCE_PAGE
</th> <td class=
"description">Advance the roll after this page
</td></tr>
1309 <tr><th>CUPS_ADVANCE_SET
</th> <td class=
"description">Advance the roll after this set
</td></tr>
1311 <h3 class=
"enumeration"><a id=
"cups_bool_e">cups_bool_e
</a></h3>
1312 <p class=
"description">Boolean type
</p>
1313 <h4 class=
"constants">Constants
</h4>
1314 <table class=
"list"><tbody>
1315 <tr><th>CUPS_FALSE
</th> <td class=
"description">Logical false
</td></tr>
1316 <tr><th>CUPS_TRUE
</th> <td class=
"description">Logical true
</td></tr>
1318 <h3 class=
"enumeration"><a id=
"cups_cspace_e">cups_cspace_e
</a></h3>
1319 <p class=
"description">cupsColorSpace attribute values
</p>
1320 <h4 class=
"constants">Constants
</h4>
1321 <table class=
"list"><tbody>
1322 <tr><th>CUPS_CSPACE_ADOBERGB
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">Red, green, blue (Adobe RGB)
</td></tr>
1323 <tr><th>CUPS_CSPACE_CIELab
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">CIE Lab
</td></tr>
1324 <tr><th>CUPS_CSPACE_CIEXYZ
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">CIE XYZ
</td></tr>
1325 <tr><th>CUPS_CSPACE_CMY
</th> <td class=
"description">Cyan, magenta, yellow (DeviceCMY)
</td></tr>
1326 <tr><th>CUPS_CSPACE_CMYK
</th> <td class=
"description">Cyan, magenta, yellow, black (DeviceCMYK)
</td></tr>
1327 <tr><th>CUPS_CSPACE_DEVICE1
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
1 color
</td></tr>
1328 <tr><th>CUPS_CSPACE_DEVICE2
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
2 colors
</td></tr>
1329 <tr><th>CUPS_CSPACE_DEVICE3
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
3 colors
</td></tr>
1330 <tr><th>CUPS_CSPACE_DEVICE4
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
4 colors
</td></tr>
1331 <tr><th>CUPS_CSPACE_DEVICE5
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
5 colors
</td></tr>
1332 <tr><th>CUPS_CSPACE_DEVICE6
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
6 colors
</td></tr>
1333 <tr><th>CUPS_CSPACE_DEVICE7
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
7 colors
</td></tr>
1334 <tr><th>CUPS_CSPACE_DEVICE8
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
8 colors
</td></tr>
1335 <tr><th>CUPS_CSPACE_DEVICE9
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
9 colors
</td></tr>
1336 <tr><th>CUPS_CSPACE_DEVICEA
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
10 colors
</td></tr>
1337 <tr><th>CUPS_CSPACE_DEVICEB
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
11 colors
</td></tr>
1338 <tr><th>CUPS_CSPACE_DEVICEC
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
12 colors
</td></tr>
1339 <tr><th>CUPS_CSPACE_DEVICED
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
13 colors
</td></tr>
1340 <tr><th>CUPS_CSPACE_DEVICEE
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
14 colors
</td></tr>
1341 <tr><th>CUPS_CSPACE_DEVICEF
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">DeviceN,
15 colors
</td></tr>
1342 <tr><th>CUPS_CSPACE_GMCK
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Gold, magenta, yellow, black
</td></tr>
1343 <tr><th>CUPS_CSPACE_GMCS
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Gold, magenta, yellow, silver
</td></tr>
1344 <tr><th>CUPS_CSPACE_GOLD
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Gold foil
</td></tr>
1345 <tr><th>CUPS_CSPACE_ICC1
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
1 color
</td></tr>
1346 <tr><th>CUPS_CSPACE_ICC2
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
2 colors
</td></tr>
1347 <tr><th>CUPS_CSPACE_ICC3
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
3 colors
</td></tr>
1348 <tr><th>CUPS_CSPACE_ICC4
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
4 colors
</td></tr>
1349 <tr><th>CUPS_CSPACE_ICC5
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
5 colors
</td></tr>
1350 <tr><th>CUPS_CSPACE_ICC6
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
6 colors
</td></tr>
1351 <tr><th>CUPS_CSPACE_ICC7
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
7 colors
</td></tr>
1352 <tr><th>CUPS_CSPACE_ICC8
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
8 colors
</td></tr>
1353 <tr><th>CUPS_CSPACE_ICC9
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
9 colors
</td></tr>
1354 <tr><th>CUPS_CSPACE_ICCA
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
10 colors
</td></tr>
1355 <tr><th>CUPS_CSPACE_ICCB
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
11 colors
</td></tr>
1356 <tr><th>CUPS_CSPACE_ICCC
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
12 colors
</td></tr>
1357 <tr><th>CUPS_CSPACE_ICCD
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
13 colors
</td></tr>
1358 <tr><th>CUPS_CSPACE_ICCE
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
14 colors
</td></tr>
1359 <tr><th>CUPS_CSPACE_ICCF
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th> <td class=
"description">ICC-based,
15 colors
</td></tr>
1360 <tr><th>CUPS_CSPACE_K
</th> <td class=
"description">Black (DeviceK)
</td></tr>
1361 <tr><th>CUPS_CSPACE_KCMY
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Black, cyan, magenta, yellow
</td></tr>
1362 <tr><th>CUPS_CSPACE_KCMYcm
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Black, cyan, magenta, yellow, light-cyan, light-magenta
</td></tr>
1363 <tr><th>CUPS_CSPACE_RGB
</th> <td class=
"description">Red, green, blue (DeviceRGB, sRGB by default)
</td></tr>
1364 <tr><th>CUPS_CSPACE_RGBA
</th> <td class=
"description">Red, green, blue, alpha (DeviceRGB, sRGB by default)
</td></tr>
1365 <tr><th>CUPS_CSPACE_RGBW
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></th> <td class=
"description">Red, green, blue, white (DeviceRGB, sRGB by default)
</td></tr>
1366 <tr><th>CUPS_CSPACE_SILVER
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Silver foil
</td></tr>
1367 <tr><th>CUPS_CSPACE_SRGB
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">Red, green, blue (sRGB)
</td></tr>
1368 <tr><th>CUPS_CSPACE_SW
<span class=
"info"> CUPS
1.4.5 </span></th> <td class=
"description">Luminance (gamma
2.2)
</td></tr>
1369 <tr><th>CUPS_CSPACE_W
</th> <td class=
"description">Luminance (DeviceGray, gamma
2.2 by default)
</td></tr>
1370 <tr><th>CUPS_CSPACE_WHITE
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">White ink (as black)
</td></tr>
1371 <tr><th>CUPS_CSPACE_YMC
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Yellow, magenta, cyan
</td></tr>
1372 <tr><th>CUPS_CSPACE_YMCK
<span class=
"info"> DEPRECATED
 </span></th> <td class=
"description">Yellow, magenta, cyan, black
</td></tr>
1374 <h3 class=
"enumeration"><a id=
"cups_cut_e">cups_cut_e
</a></h3>
1375 <p class=
"description">CutMedia attribute values
</p>
1376 <h4 class=
"constants">Constants
</h4>
1377 <table class=
"list"><tbody>
1378 <tr><th>CUPS_CUT_FILE
</th> <td class=
"description">Cut the roll after this file
</td></tr>
1379 <tr><th>CUPS_CUT_JOB
</th> <td class=
"description">Cut the roll after this job
</td></tr>
1380 <tr><th>CUPS_CUT_NONE
</th> <td class=
"description">Never cut the roll
</td></tr>
1381 <tr><th>CUPS_CUT_PAGE
</th> <td class=
"description">Cut the roll after this page
</td></tr>
1382 <tr><th>CUPS_CUT_SET
</th> <td class=
"description">Cut the roll after this set
</td></tr>
1384 <h3 class=
"enumeration"><a id=
"cups_edge_e">cups_edge_e
</a></h3>
1385 <p class=
"description">LeadingEdge attribute values
</p>
1386 <h4 class=
"constants">Constants
</h4>
1387 <table class=
"list"><tbody>
1388 <tr><th>CUPS_EDGE_BOTTOM
</th> <td class=
"description">Leading edge is the bottom of the page
</td></tr>
1389 <tr><th>CUPS_EDGE_LEFT
</th> <td class=
"description">Leading edge is the left of the page
</td></tr>
1390 <tr><th>CUPS_EDGE_RIGHT
</th> <td class=
"description">Leading edge is the right of the page
</td></tr>
1391 <tr><th>CUPS_EDGE_TOP
</th> <td class=
"description">Leading edge is the top of the page
</td></tr>
1393 <h3 class=
"enumeration"><a id=
"cups_jog_e">cups_jog_e
</a></h3>
1394 <p class=
"description">Jog attribute values
</p>
1395 <h4 class=
"constants">Constants
</h4>
1396 <table class=
"list"><tbody>
1397 <tr><th>CUPS_JOG_FILE
</th> <td class=
"description">Move pages after this file
</td></tr>
1398 <tr><th>CUPS_JOG_JOB
</th> <td class=
"description">Move pages after this job
</td></tr>
1399 <tr><th>CUPS_JOG_NONE
</th> <td class=
"description">Never move pages
</td></tr>
1400 <tr><th>CUPS_JOG_SET
</th> <td class=
"description">Move pages after this set
</td></tr>
1402 <h3 class=
"enumeration"><a id=
"cups_mode_e">cups_mode_e
</a></h3>
1403 <p class=
"description">cupsRasterOpen modes
</p>
1404 <h4 class=
"constants">Constants
</h4>
1405 <table class=
"list"><tbody>
1406 <tr><th>CUPS_RASTER_READ
</th> <td class=
"description">Open stream for reading
</td></tr>
1407 <tr><th>CUPS_RASTER_WRITE
</th> <td class=
"description">Open stream for writing
</td></tr>
1408 <tr><th>CUPS_RASTER_WRITE_COMPRESSED
<span class=
"info"> CUPS
1.3/macOS
10.5 </span></th> <td class=
"description">Open stream for compressed writing
</td></tr>
1409 <tr><th>CUPS_RASTER_WRITE_PWG
<span class=
"info"> CUPS
1.5/macOS
10.7 </span></th> <td class=
"description">Open stream for compressed writing in PWG Raster mode
</td></tr>
1411 <h3 class=
"enumeration"><a id=
"cups_order_e">cups_order_e
</a></h3>
1412 <p class=
"description">cupsColorOrder attribute values
</p>
1413 <h4 class=
"constants">Constants
</h4>
1414 <table class=
"list"><tbody>
1415 <tr><th>CUPS_ORDER_BANDED
</th> <td class=
"description">CCC MMM YYY KKK ...
</td></tr>
1416 <tr><th>CUPS_ORDER_CHUNKED
</th> <td class=
"description">CMYK CMYK CMYK ...
</td></tr>
1417 <tr><th>CUPS_ORDER_PLANAR
</th> <td class=
"description">CCC ... MMM ... YYY ... KKK ...
</td></tr>
1419 <h3 class=
"enumeration"><a id=
"cups_orient_e">cups_orient_e
</a></h3>
1420 <p class=
"description">Orientation attribute values
</p>
1421 <h4 class=
"constants">Constants
</h4>
1422 <table class=
"list"><tbody>
1423 <tr><th>CUPS_ORIENT_0
</th> <td class=
"description">Don't rotate the page
</td></tr>
1424 <tr><th>CUPS_ORIENT_180
</th> <td class=
"description">Turn the page upside down
</td></tr>
1425 <tr><th>CUPS_ORIENT_270
</th> <td class=
"description">Rotate the page clockwise
</td></tr>
1426 <tr><th>CUPS_ORIENT_90
</th> <td class=
"description">Rotate the page counter-clockwise
</td></tr>