1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>Printer Driver 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.7">
9 <style type=
"text/css"><!--
11 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
14 H1, H2, H3, H4, H5, H6, P, TD, TH {
15 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
19 font-family: monaco, courier, monospace;
24 font-family: monaco, courier, monospace;
28 border: dotted thin #7f7f7f;
44 border: dotted thin #999999;
49 PRE.command EM, PRE.example EM {
50 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
54 font-family: monaco, courier, monospace;
65 border: solid thin #999999;
76 -moz-border-radius: 10px;
81 text-decoration: none;
84 A:link:hover, A:visited:hover, A:active {
85 text-decoration: underline;
92 TR.data, TD.data, TR.data TD {
95 border-bottom: solid 1pt #999999;
99 border-bottom: solid 1pt #999999;
106 border: solid thin #999999;
107 border-collapse: collapse;
123 border: solid thin #cccccc;
130 border-bottom: solid thin #999999;
139 caption-side: bottom;
163 border: thin solid black;
171 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
180 border-bottom: solid 2pt #000000;
183 DIV.indent, TABLE.indent {
191 border-collapse: collapse;
194 TABLE.indent TD, TABLE.indent TH {
199 border-collapse: collapse;
207 border-bottom: solid thin #cccccc;
212 vertical-align: bottom;
221 border-bottom: solid thin #eeeeee;
226 TABLE.list TR:nth-child(even) {
230 TABLE.list TR:nth-child(odd) {
249 font-family: monaco, courier, monospace;
253 border: solid thin #999999;
254 border-collapse: collapse;
259 DIV.summary TABLE TD, DIV.summary TABLE TH {
260 border: solid thin #999999;
266 DIV.summary TABLE THEAD TH {
270 /* API documentation styles... */
277 div.body h3, div.body h4, div.body h5 {
278 margin-bottom: 0.5em;
281 .class, .enumeration, .function, .struct, .typedef, .union {
282 border-bottom: solid thin #999999;
289 code, p.code, pre, ul.code li {
290 font-family: monaco, courier, monospace;
293 ul.code, ul.contents, ul.subcontents {
294 list-style-type: none;
304 ul.contents li ul.code, ul.contents li ul.subcontents {
317 margin-bottom: 0.5em;
320 /* This is just for the HTML files generated with the framedhelp target */
323 border: solid thin black;
332 div.contents ul.contents {
335 div.contents ul.subcontents li {
346 Driver API header for CUPS.
348 Copyright 2009 by Apple Inc.
350 These coded instructions, statements, and computer programs are the
351 property of Apple Inc. and are protected by Federal copyright
352 law. Distribution and use rights are outlined in the file "LICENSE.txt"
353 which should have been included with this file. If this file is
354 file is missing or damaged, see the license at "http://www.cups.org/".
357 <h1 class='title'
>Driver API
</h1>
359 <div class='summary'
><table summary='General Information'
>
363 <th>cups/driver.h
</th>
369 <td>-lcupsdriver
</td>
373 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a></td>
377 <h2 class=
"title">Contents
</h2>
378 <ul class=
"contents">
379 <li><a href=
"#OVERVIEW">Overview
</a></li>
380 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
381 <li><a href=
"#cupsCMYKDelete" title=
"Delete a color separation.">cupsCMYKDelete
</a></li>
382 <li><a href=
"#cupsCMYKDoBlack" title=
"Do a black separation...">cupsCMYKDoBlack
</a></li>
383 <li><a href=
"#cupsCMYKDoCMYK" title=
"Do a CMYK separation...">cupsCMYKDoCMYK
</a></li>
384 <li><a href=
"#cupsCMYKDoGray" title=
"Do a grayscale separation...">cupsCMYKDoGray
</a></li>
385 <li><a href=
"#cupsCMYKDoRGB" title=
"Do an sRGB separation...">cupsCMYKDoRGB
</a></li>
386 <li><a href=
"#cupsCMYKLoad" title=
"Load a CMYK color profile from PPD attributes.">cupsCMYKLoad
</a></li>
387 <li><a href=
"#cupsCMYKNew" title=
"Create a new CMYK color separation.">cupsCMYKNew
</a></li>
388 <li><a href=
"#cupsCMYKSetBlack" title=
"Set the transition range for CMY to black.">cupsCMYKSetBlack
</a></li>
389 <li><a href=
"#cupsCMYKSetCurve" title=
"Set a color transform curve using points.">cupsCMYKSetCurve
</a></li>
390 <li><a href=
"#cupsCMYKSetGamma" title=
"Set a color transform curve using gamma and density.">cupsCMYKSetGamma
</a></li>
391 <li><a href=
"#cupsCMYKSetInkLimit" title=
"Set the limit on the amount of ink.">cupsCMYKSetInkLimit
</a></li>
392 <li><a href=
"#cupsCMYKSetLtDk" title=
"Set light/dark ink transforms.">cupsCMYKSetLtDk
</a></li>
393 <li><a href=
"#cupsCheckBytes" title=
"Check to see if all bytes are zero.">cupsCheckBytes
</a></li>
394 <li><a href=
"#cupsCheckValue" title=
"Check to see if all bytes match the given value.">cupsCheckValue
</a></li>
395 <li><a href=
"#cupsDitherDelete" title=
"Free a dithering buffer.">cupsDitherDelete
</a></li>
396 <li><a href=
"#cupsDitherLine" title=
"Dither a line of pixels...">cupsDitherLine
</a></li>
397 <li><a href=
"#cupsDitherNew" title=
"Create an error-diffusion dithering buffer.">cupsDitherNew
</a></li>
398 <li><a href=
"#cupsFindAttr" title=
"Find a PPD attribute based on the colormodel,
399 media, and resolution.">cupsFindAttr
</a></li>
400 <li><a href=
"#cupsLutDelete" title=
"Free the memory used by a lookup table.">cupsLutDelete
</a></li>
401 <li><a href=
"#cupsLutLoad" title=
"Load a LUT from a PPD file.">cupsLutLoad
</a></li>
402 <li><a href=
"#cupsLutNew" title=
"Make a lookup table from a list of pixel values.">cupsLutNew
</a></li>
403 <li><a href=
"#cupsPackHorizontal" title=
"Pack pixels horizontally...">cupsPackHorizontal
</a></li>
404 <li><a href=
"#cupsPackHorizontal2" title=
"Pack 2-bit pixels horizontally...">cupsPackHorizontal2
</a></li>
405 <li><a href=
"#cupsPackHorizontalBit" title=
"Pack pixels horizontally by bit...">cupsPackHorizontalBit
</a></li>
406 <li><a href=
"#cupsPackVertical" title=
"Pack pixels vertically...">cupsPackVertical
</a></li>
407 <li><a href=
"#cupsRGBDelete" title=
"Delete a color separation.">cupsRGBDelete
</a></li>
408 <li><a href=
"#cupsRGBDoGray" title=
"Do a grayscale separation...">cupsRGBDoGray
</a></li>
409 <li><a href=
"#cupsRGBDoRGB" title=
"Do a RGB separation...">cupsRGBDoRGB
</a></li>
410 <li><a href=
"#cupsRGBLoad" title=
"Load a RGB color profile from a PPD file.">cupsRGBLoad
</a></li>
411 <li><a href=
"#cupsRGBNew" title=
"Create a new RGB color separation.">cupsRGBNew
</a></li>
413 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
414 <li><a href=
"#cups_cmyk_t" title=
"Simple CMYK lookup table">cups_cmyk_t
</a></li>
415 <li><a href=
"#cups_dither_t" title=
"Dithering State">cups_dither_t
</a></li>
416 <li><a href=
"#cups_lut_t" title=
"Lookup Table for Dithering">cups_lut_t
</a></li>
417 <li><a href=
"#cups_rgb_t" title=
"Color separation lookup table">cups_rgb_t
</a></li>
418 <li><a href=
"#cups_sample_t" title=
"Color sample point">cups_sample_t
</a></li>
420 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
421 <li><a href=
"#cups_cmyk_s" title=
"Simple CMYK lookup table">cups_cmyk_s
</a></li>
422 <li><a href=
"#cups_dither_s" title=
"Dithering State">cups_dither_s
</a></li>
423 <li><a href=
"#cups_lut_s" title=
"Lookup Table for Dithering">cups_lut_s
</a></li>
424 <li><a href=
"#cups_rgb_s" title=
"Color separation lookup table">cups_rgb_s
</a></li>
425 <li><a href=
"#cups_sample_s" title=
"Color sample point">cups_sample_s
</a></li>
427 <li><a href=
"#VARIABLES">Variables
</a><ul class=
"code">
428 <li><a href=
"#cups_scmy_lut[256]" title=
"sRGB gamma lookup table (inverted)">cups_scmy_lut[
256]
</a></li>
429 <li><a href=
"#cups_srgb_lut[256]" title=
"sRGB gamma lookup table">cups_srgb_lut[
256]
</a></li>
435 Driver API introduction for CUPS.
437 Copyright 2009 by Apple Inc.
439 These coded instructions, statements, and computer programs are the
440 property of Apple Inc. and are protected by Federal copyright
441 law. Distribution and use rights are outlined in the file "LICENSE.txt"
442 which should have been included with this file. If this file is
443 file is missing or damaged, see the license at "http://www.cups.org/".
446 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
448 <p>The driver API provides common dithering, color conversion, and utility
449 functions for CUPS drivers.
</p>
450 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
451 <h3 class=
"function"><a name=
"cupsCMYKDelete">cupsCMYKDelete
</a></h3>
452 <p class=
"description">Delete a color separation.
</p>
454 void cupsCMYKDelete (
<br>
455 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk
<br>
457 <h4 class=
"parameters">Parameters
</h4>
460 <dd class=
"description">Color separation
</dd>
462 <h3 class=
"function"><a name=
"cupsCMYKDoBlack">cupsCMYKDoBlack
</a></h3>
463 <p class=
"description">Do a black separation...
</p>
465 void cupsCMYKDoBlack (
<br>
466 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
467 const unsigned char *input,
<br>
468 short *output,
<br>
469 int num_pixels
<br>
471 <h4 class=
"parameters">Parameters
</h4>
474 <dd class=
"description">Color separation
</dd>
476 <dd class=
"description">Input grayscale pixels
</dd>
478 <dd class=
"description">Output Device-N pixels
</dd>
480 <dd class=
"description">Number of pixels
</dd>
482 <h3 class=
"function"><a name=
"cupsCMYKDoCMYK">cupsCMYKDoCMYK
</a></h3>
483 <p class=
"description">Do a CMYK separation...
</p>
485 void cupsCMYKDoCMYK (
<br>
486 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
487 const unsigned char *input,
<br>
488 short *output,
<br>
489 int num_pixels
<br>
491 <h4 class=
"parameters">Parameters
</h4>
494 <dd class=
"description">Color separation
</dd>
496 <dd class=
"description">Input grayscale pixels
</dd>
498 <dd class=
"description">Output Device-N pixels
</dd>
500 <dd class=
"description">Number of pixels
</dd>
502 <h3 class=
"function"><a name=
"cupsCMYKDoGray">cupsCMYKDoGray
</a></h3>
503 <p class=
"description">Do a grayscale separation...
</p>
505 void cupsCMYKDoGray (
<br>
506 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
507 const unsigned char *input,
<br>
508 short *output,
<br>
509 int num_pixels
<br>
511 <h4 class=
"parameters">Parameters
</h4>
514 <dd class=
"description">Color separation
</dd>
516 <dd class=
"description">Input grayscale pixels
</dd>
518 <dd class=
"description">Output Device-N pixels
</dd>
520 <dd class=
"description">Number of pixels
</dd>
522 <h3 class=
"function"><a name=
"cupsCMYKDoRGB">cupsCMYKDoRGB
</a></h3>
523 <p class=
"description">Do an sRGB separation...
</p>
525 void cupsCMYKDoRGB (
<br>
526 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
527 const unsigned char *input,
<br>
528 short *output,
<br>
529 int num_pixels
<br>
531 <h4 class=
"parameters">Parameters
</h4>
534 <dd class=
"description">Color separation
</dd>
536 <dd class=
"description">Input grayscale pixels
</dd>
538 <dd class=
"description">Output Device-N pixels
</dd>
540 <dd class=
"description">Number of pixels
</dd>
542 <h3 class=
"function"><a name=
"cupsCMYKLoad">cupsCMYKLoad
</a></h3>
543 <p class=
"description">Load a CMYK color profile from PPD attributes.
</p>
545 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cupsCMYKLoad (
<br>
546 ppd_file_t *ppd,
<br>
547 const char *colormodel,
<br>
548 const char *media,
<br>
549 const char *resolution
<br>
551 <h4 class=
"parameters">Parameters
</h4>
554 <dd class=
"description">PPD file
</dd>
556 <dd class=
"description">ColorModel value
</dd>
558 <dd class=
"description">MediaType value
</dd>
560 <dd class=
"description">Resolution value
</dd>
562 <h4 class=
"returnvalue">Return Value
</h4>
563 <p class=
"description">CMYK color separation
</p>
564 <h3 class=
"function"><a name=
"cupsCMYKNew">cupsCMYKNew
</a></h3>
565 <p class=
"description">Create a new CMYK color separation.
</p>
567 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cupsCMYKNew (
<br>
568 int num_channels
<br>
570 <h4 class=
"parameters">Parameters
</h4>
572 <dt>num_channels
</dt>
573 <dd class=
"description">Number of color components
</dd>
575 <h4 class=
"returnvalue">Return Value
</h4>
576 <p class=
"description">New CMYK separation or NULL
</p>
577 <h3 class=
"function"><a name=
"cupsCMYKSetBlack">cupsCMYKSetBlack
</a></h3>
578 <p class=
"description">Set the transition range for CMY to black.
</p>
580 void cupsCMYKSetBlack (
<br>
581 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
582 float lower,
<br>
583 float upper
<br>
585 <h4 class=
"parameters">Parameters
</h4>
588 <dd class=
"description">CMYK color separation
</dd>
590 <dd class=
"description">No black ink
</dd>
592 <dd class=
"description">Only black ink
</dd>
594 <h3 class=
"function"><a name=
"cupsCMYKSetCurve">cupsCMYKSetCurve
</a></h3>
595 <p class=
"description">Set a color transform curve using points.
</p>
597 void cupsCMYKSetCurve (
<br>
598 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
599 int channel,
<br>
600 int num_xypoints,
<br>
601 const float *xypoints
<br>
603 <h4 class=
"parameters">Parameters
</h4>
606 <dd class=
"description">CMYK color separation
</dd>
608 <dd class=
"description">Color channel
</dd>
609 <dt>num_xypoints
</dt>
610 <dd class=
"description">Number of X,Y points
</dd>
612 <dd class=
"description">X,Y points
</dd>
614 <h3 class=
"function"><a name=
"cupsCMYKSetGamma">cupsCMYKSetGamma
</a></h3>
615 <p class=
"description">Set a color transform curve using gamma and density.
</p>
617 void cupsCMYKSetGamma (
<br>
618 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
619 int channel,
<br>
620 float gamval,
<br>
621 float density
<br>
623 <h4 class=
"parameters">Parameters
</h4>
626 <dd class=
"description">CMYK color separation
</dd>
628 <dd class=
"description">Ink channel
</dd>
630 <dd class=
"description">Gamma correction
</dd>
632 <dd class=
"description">Maximum density
</dd>
634 <h3 class=
"function"><a name=
"cupsCMYKSetInkLimit">cupsCMYKSetInkLimit
</a></h3>
635 <p class=
"description">Set the limit on the amount of ink.
</p>
637 void cupsCMYKSetInkLimit (
<br>
638 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
639 float limit
<br>
641 <h4 class=
"parameters">Parameters
</h4>
644 <dd class=
"description">CMYK color separation
</dd>
646 <dd class=
"description">Limit of ink
</dd>
648 <h3 class=
"function"><a name=
"cupsCMYKSetLtDk">cupsCMYKSetLtDk
</a></h3>
649 <p class=
"description">Set light/dark ink transforms.
</p>
651 void cupsCMYKSetLtDk (
<br>
652 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
653 int channel,
<br>
654 float light,
<br>
655 float dark
<br>
657 <h4 class=
"parameters">Parameters
</h4>
660 <dd class=
"description">CMYK color separation
</dd>
662 <dd class=
"description">Dark ink channel (+
1 for light)
</dd>
664 <dd class=
"description">Light ink only level
</dd>
666 <dd class=
"description">Dark ink only level
</dd>
668 <h3 class=
"function"><a name=
"cupsCheckBytes">cupsCheckBytes
</a></h3>
669 <p class=
"description">Check to see if all bytes are zero.
</p>
671 int cupsCheckBytes (
<br>
672 const unsigned char *bytes,
<br>
673 int length
<br>
675 <h4 class=
"parameters">Parameters
</h4>
678 <dd class=
"description">Bytes to check
</dd>
680 <dd class=
"description">Number of bytes to check
</dd>
682 <h4 class=
"returnvalue">Return Value
</h4>
683 <p class=
"description">1 if they match
</p>
684 <h3 class=
"function"><a name=
"cupsCheckValue">cupsCheckValue
</a></h3>
685 <p class=
"description">Check to see if all bytes match the given value.
</p>
687 int cupsCheckValue (
<br>
688 const unsigned char *bytes,
<br>
689 int length,
<br>
690 const unsigned char value
<br>
692 <h4 class=
"parameters">Parameters
</h4>
695 <dd class=
"description">Bytes to check
</dd>
697 <dd class=
"description">Number of bytes to check
</dd>
699 <dd class=
"description">Value to check
</dd>
701 <h4 class=
"returnvalue">Return Value
</h4>
702 <p class=
"description">1 if they match
</p>
703 <h3 class=
"function"><a name=
"cupsDitherDelete">cupsDitherDelete
</a></h3>
704 <p class=
"description">Free a dithering buffer.
</p>
706 void cupsDitherDelete (
<br>
707 <a href=
"#cups_dither_t">cups_dither_t
</a> *d
<br>
709 <h4 class=
"parameters">Parameters
</h4>
712 <dd class=
"description">Dithering buffer
</dd>
714 <h4 class=
"discussion">Discussion
</h4>
715 <p class=
"discussion">Returns
0 on success, -
1 on failure.
</p>
716 <h3 class=
"function"><a name=
"cupsDitherLine">cupsDitherLine
</a></h3>
717 <p class=
"description">Dither a line of pixels...
</p>
719 void cupsDitherLine (
<br>
720 <a href=
"#cups_dither_t">cups_dither_t
</a> *d,
<br>
721 const
<a href=
"#cups_lut_t">cups_lut_t
</a> *lut,
<br>
722 const short *data,
<br>
723 int num_channels,
<br>
724 unsigned char *p
<br>
726 <h4 class=
"parameters">Parameters
</h4>
729 <dd class=
"description">Dither data
</dd>
731 <dd class=
"description">Lookup table
</dd>
733 <dd class=
"description">Separation data
</dd>
734 <dt>num_channels
</dt>
735 <dd class=
"description">Number of components
</dd>
737 <dd class=
"description">Pixels
</dd>
739 <h3 class=
"function"><a name=
"cupsDitherNew">cupsDitherNew
</a></h3>
740 <p class=
"description">Create an error-diffusion dithering buffer.
</p>
742 <a href=
"#cups_dither_t">cups_dither_t
</a> *cupsDitherNew (
<br>
743 int width
<br>
745 <h4 class=
"parameters">Parameters
</h4>
748 <dd class=
"description">Width of output in pixels
</dd>
750 <h4 class=
"returnvalue">Return Value
</h4>
751 <p class=
"description">New state array
</p>
752 <h3 class=
"function"><a name=
"cupsFindAttr">cupsFindAttr
</a></h3>
753 <p class=
"description">Find a PPD attribute based on the colormodel,
754 media, and resolution.
</p>
756 ppd_attr_t *cupsFindAttr (
<br>
757 ppd_file_t *ppd,
<br>
758 const char *name,
<br>
759 const char *colormodel,
<br>
760 const char *media,
<br>
761 const char *resolution,
<br>
762 char *spec,
<br>
763 int specsize
<br>
765 <h4 class=
"parameters">Parameters
</h4>
768 <dd class=
"description">PPD file
</dd>
770 <dd class=
"description">Attribute name
</dd>
772 <dd class=
"description">Color model
</dd>
774 <dd class=
"description">Media type
</dd>
776 <dd class=
"description">Resolution
</dd>
778 <dd class=
"description">Final selection string
</dd>
780 <dd class=
"description">Size of string buffer
</dd>
782 <h4 class=
"returnvalue">Return Value
</h4>
783 <p class=
"description">Matching attribute or NULL
</p>
784 <h3 class=
"function"><a name=
"cupsLutDelete">cupsLutDelete
</a></h3>
785 <p class=
"description">Free the memory used by a lookup table.
</p>
787 void cupsLutDelete (
<br>
788 <a href=
"#cups_lut_t">cups_lut_t
</a> *lut
<br>
790 <h4 class=
"parameters">Parameters
</h4>
793 <dd class=
"description">Lookup table to free
</dd>
795 <h3 class=
"function"><a name=
"cupsLutLoad">cupsLutLoad
</a></h3>
796 <p class=
"description">Load a LUT from a PPD file.
</p>
798 <a href=
"#cups_lut_t">cups_lut_t
</a> *cupsLutLoad (
<br>
799 ppd_file_t *ppd,
<br>
800 const char *colormodel,
<br>
801 const char *media,
<br>
802 const char *resolution,
<br>
803 const char *ink
<br>
805 <h4 class=
"parameters">Parameters
</h4>
808 <dd class=
"description">PPD file
</dd>
810 <dd class=
"description">Color model
</dd>
812 <dd class=
"description">Media type
</dd>
814 <dd class=
"description">Resolution
</dd>
816 <dd class=
"description">Ink name
</dd>
818 <h4 class=
"returnvalue">Return Value
</h4>
819 <p class=
"description">New lookup table
</p>
820 <h3 class=
"function"><a name=
"cupsLutNew">cupsLutNew
</a></h3>
821 <p class=
"description">Make a lookup table from a list of pixel values.
</p>
823 <a href=
"#cups_lut_t">cups_lut_t
</a> *cupsLutNew (
<br>
824 int num_values,
<br>
825 const float *values
<br>
827 <h4 class=
"parameters">Parameters
</h4>
830 <dd class=
"description">Number of values
</dd>
832 <dd class=
"description">Lookup table values
</dd>
834 <h4 class=
"returnvalue">Return Value
</h4>
835 <p class=
"description">New lookup table
</p>
836 <h4 class=
"discussion">Discussion
</h4>
837 <p class=
"discussion">Returns a pointer to the lookup table on success, NULL on failure.
</p>
838 <h3 class=
"function"><a name=
"cupsPackHorizontal">cupsPackHorizontal
</a></h3>
839 <p class=
"description">Pack pixels horizontally...
</p>
841 void cupsPackHorizontal (
<br>
842 const unsigned char *ipixels,
<br>
843 unsigned char *obytes,
<br>
844 int width,
<br>
845 const unsigned char clearto,
<br>
846 const int step
<br>
848 <h4 class=
"parameters">Parameters
</h4>
851 <dd class=
"description">Input pixels
</dd>
853 <dd class=
"description">Output bytes
</dd>
855 <dd class=
"description">Number of pixels
</dd>
857 <dd class=
"description">Initial value of bytes
</dd>
859 <dd class=
"description">Step value between pixels
</dd>
861 <h3 class=
"function"><a name=
"cupsPackHorizontal2">cupsPackHorizontal2
</a></h3>
862 <p class=
"description">Pack
2-bit pixels horizontally...
</p>
864 void cupsPackHorizontal2 (
<br>
865 const unsigned char *ipixels,
<br>
866 unsigned char *obytes,
<br>
867 int width,
<br>
868 const int step
<br>
870 <h4 class=
"parameters">Parameters
</h4>
873 <dd class=
"description">Input pixels
</dd>
875 <dd class=
"description">Output bytes
</dd>
877 <dd class=
"description">Number of pixels
</dd>
879 <dd class=
"description">Stepping value
</dd>
881 <h3 class=
"function"><a name=
"cupsPackHorizontalBit">cupsPackHorizontalBit
</a></h3>
882 <p class=
"description">Pack pixels horizontally by bit...
</p>
884 void cupsPackHorizontalBit (
<br>
885 const unsigned char *ipixels,
<br>
886 unsigned char *obytes,
<br>
887 int width,
<br>
888 const unsigned char clearto,
<br>
889 const unsigned char bit
<br>
891 <h4 class=
"parameters">Parameters
</h4>
894 <dd class=
"description">Input pixels
</dd>
896 <dd class=
"description">Output bytes
</dd>
898 <dd class=
"description">Number of pixels
</dd>
900 <dd class=
"description">Initial value of bytes
</dd>
902 <dd class=
"description">Bit to check
</dd>
904 <h3 class=
"function"><a name=
"cupsPackVertical">cupsPackVertical
</a></h3>
905 <p class=
"description">Pack pixels vertically...
</p>
907 void cupsPackVertical (
<br>
908 const unsigned char *ipixels,
<br>
909 unsigned char *obytes,
<br>
910 int width,
<br>
911 const unsigned char bit,
<br>
912 const int step
<br>
914 <h4 class=
"parameters">Parameters
</h4>
917 <dd class=
"description">Input pixels
</dd>
919 <dd class=
"description">Output bytes
</dd>
921 <dd class=
"description">Number of input pixels
</dd>
923 <dd class=
"description">Output bit
</dd>
925 <dd class=
"description">Number of bytes between columns
</dd>
927 <h3 class=
"function"><a name=
"cupsRGBDelete">cupsRGBDelete
</a></h3>
928 <p class=
"description">Delete a color separation.
</p>
930 void cupsRGBDelete (
<br>
931 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr
<br>
933 <h4 class=
"parameters">Parameters
</h4>
936 <dd class=
"description">Color separation
</dd>
938 <h3 class=
"function"><a name=
"cupsRGBDoGray">cupsRGBDoGray
</a></h3>
939 <p class=
"description">Do a grayscale separation...
</p>
941 void cupsRGBDoGray (
<br>
942 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr,
<br>
943 const unsigned char *input,
<br>
944 unsigned char *output,
<br>
945 int num_pixels
<br>
947 <h4 class=
"parameters">Parameters
</h4>
950 <dd class=
"description">Color separation
</dd>
952 <dd class=
"description">Input grayscale pixels
</dd>
954 <dd class=
"description">Output Device-N pixels
</dd>
956 <dd class=
"description">Number of pixels
</dd>
958 <h3 class=
"function"><a name=
"cupsRGBDoRGB">cupsRGBDoRGB
</a></h3>
959 <p class=
"description">Do a RGB separation...
</p>
961 void cupsRGBDoRGB (
<br>
962 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr,
<br>
963 const unsigned char *input,
<br>
964 unsigned char *output,
<br>
965 int num_pixels
<br>
967 <h4 class=
"parameters">Parameters
</h4>
970 <dd class=
"description">Color separation
</dd>
972 <dd class=
"description">Input RGB pixels
</dd>
974 <dd class=
"description">Output Device-N pixels
</dd>
976 <dd class=
"description">Number of pixels
</dd>
978 <h3 class=
"function"><a name=
"cupsRGBLoad">cupsRGBLoad
</a></h3>
979 <p class=
"description">Load a RGB color profile from a PPD file.
</p>
981 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *cupsRGBLoad (
<br>
982 ppd_file_t *ppd,
<br>
983 const char *colormodel,
<br>
984 const char *media,
<br>
985 const char *resolution
<br>
987 <h4 class=
"parameters">Parameters
</h4>
990 <dd class=
"description">PPD file
</dd>
992 <dd class=
"description">Color model
</dd>
994 <dd class=
"description">Media type
</dd>
996 <dd class=
"description">Resolution
</dd>
998 <h4 class=
"returnvalue">Return Value
</h4>
999 <p class=
"description">New color profile
</p>
1000 <h3 class=
"function"><a name=
"cupsRGBNew">cupsRGBNew
</a></h3>
1001 <p class=
"description">Create a new RGB color separation.
</p>
1003 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *cupsRGBNew (
<br>
1004 int num_samples,
<br>
1005 <a href=
"#cups_sample_t">cups_sample_t
</a> *samples,
<br>
1006 int cube_size,
<br>
1007 int num_channels
<br>
1009 <h4 class=
"parameters">Parameters
</h4>
1011 <dt>num_samples
</dt>
1012 <dd class=
"description">Number of samples
</dd>
1014 <dd class=
"description">Samples
</dd>
1016 <dd class=
"description">Size of LUT cube
</dd>
1017 <dt>num_channels
</dt>
1018 <dd class=
"description">Number of color components
</dd>
1020 <h4 class=
"returnvalue">Return Value
</h4>
1021 <p class=
"description">New color separation or NULL
</p>
1022 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1023 <h3 class=
"typedef"><a name=
"cups_cmyk_t">cups_cmyk_t
</a></h3>
1024 <p class=
"description">Simple CMYK lookup table
</p>
1026 typedef struct
<a href=
"#cups_cmyk_s">cups_cmyk_s
</a> cups_cmyk_t;
1028 <h3 class=
"typedef"><a name=
"cups_dither_t">cups_dither_t
</a></h3>
1029 <p class=
"description">Dithering State
</p>
1031 typedef struct
<a href=
"#cups_dither_s">cups_dither_s
</a> cups_dither_t;
1033 <h3 class=
"typedef"><a name=
"cups_lut_t">cups_lut_t
</a></h3>
1034 <p class=
"description">Lookup Table for Dithering
</p>
1036 typedef struct
<a href=
"#cups_lut_s">cups_lut_s
</a> cups_lut_t;
1038 <h3 class=
"typedef"><a name=
"cups_rgb_t">cups_rgb_t
</a></h3>
1039 <p class=
"description">Color separation lookup table
</p>
1041 typedef struct
<a href=
"#cups_rgb_s">cups_rgb_s
</a> cups_rgb_t;
1043 <h3 class=
"typedef"><a name=
"cups_sample_t">cups_sample_t
</a></h3>
1044 <p class=
"description">Color sample point
</p>
1046 typedef struct
<a href=
"#cups_sample_s">cups_sample_s
</a> cups_sample_t;
1048 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1049 <h3 class=
"struct"><a name=
"cups_cmyk_s">cups_cmyk_s
</a></h3>
1050 <p class=
"description">Simple CMYK lookup table
</p>
1051 <p class=
"code">struct cups_cmyk_s {
<br>
1052 unsigned char black_lut[
256];
<br>
1053 short *channels[CUPS_MAX_CHAN];
<br>
1054 unsigned char color_lut[
256];
<br>
1055 int ink_limit;
<br>
1056 int num_channels;
<br>
1058 <h4 class=
"members">Members
</h4>
1060 <dt>black_lut[
256]
</dt>
1061 <dd class=
"description">Black generation LUT
</dd>
1062 <dt>channels[CUPS_MAX_CHAN]
</dt>
1063 <dd class=
"description">Lookup tables
</dd>
1064 <dt>color_lut[
256]
</dt>
1065 <dd class=
"description">Color removal LUT
</dd>
1067 <dd class=
"description">Ink limit
</dd>
1068 <dt>num_channels
</dt>
1069 <dd class=
"description">Number of components
</dd>
1071 <h3 class=
"struct"><a name=
"cups_dither_s">cups_dither_s
</a></h3>
1072 <p class=
"description">Dithering State
</p>
1073 <p class=
"code">struct cups_dither_s {
<br>
1074 int errors[
96];
<br>
1075 int row;
<br>
1076 int width;
<br>
1078 <h4 class=
"members">Members
</h4>
1080 <dt>errors[
96]
</dt>
1081 <dd class=
"description">Error values
</dd>
1083 <dd class=
"description">Current row
</dd>
1085 <dd class=
"description">Width of buffer
</dd>
1087 <h3 class=
"struct"><a name=
"cups_lut_s">cups_lut_s
</a></h3>
1088 <p class=
"description">Lookup Table for Dithering
</p>
1089 <p class=
"code">struct cups_lut_s {
<br>
1090 int error;
<br>
1091 short intensity;
<br>
1092 short pixel;
<br>
1094 <h4 class=
"members">Members
</h4>
1097 <dd class=
"description">Error from desired value
</dd>
1099 <dd class=
"description">Adjusted intensity
</dd>
1101 <dd class=
"description">Output pixel value
</dd>
1103 <h3 class=
"struct"><a name=
"cups_rgb_s">cups_rgb_s
</a></h3>
1104 <p class=
"description">Color separation lookup table
</p>
1105 <p class=
"code">struct cups_rgb_s {
<br>
1106 unsigned char black[CUPS_MAX_RGB];
<br>
1107 int cache_init;
<br>
1108 unsigned char ****colors;
<br>
1109 int cube_index[
256];
<br>
1110 int cube_mult[
256];
<br>
1111 int cube_size;
<br>
1112 int num_channels;
<br>
1113 unsigned char white[CUPS_MAX_RGB];
<br>
1115 <h4 class=
"members">Members
</h4>
1117 <dt>black[CUPS_MAX_RGB]
</dt>
1118 <dd class=
"description">Cached black (sRGB =
0,
0,
0)
</dd>
1119 <dt>cache_init
</dt>
1120 <dd class=
"description">Are cached values initialized?
</dd>
1122 <dd class=
"description">4-D array of sample values
</dd>
1123 <dt>cube_index[
256]
</dt>
1124 <dd class=
"description">Index into cube for a given sRGB value
</dd>
1125 <dt>cube_mult[
256]
</dt>
1126 <dd class=
"description">Multiplier value for a given sRGB value
</dd>
1128 <dd class=
"description">Size of color cube (
2-N) on a side
</dd>
1129 <dt>num_channels
</dt>
1130 <dd class=
"description">Number of colors per sample
</dd>
1131 <dt>white[CUPS_MAX_RGB]
</dt>
1132 <dd class=
"description">Cached white (sRGB =
255,
255,
255)
</dd>
1134 <h3 class=
"struct"><a name=
"cups_sample_s">cups_sample_s
</a></h3>
1135 <p class=
"description">Color sample point
</p>
1136 <p class=
"code">struct cups_sample_s {
<br>
1137 unsigned char colors[CUPS_MAX_RGB];
<br>
1138 unsigned char rgb[
3];
<br>
1140 <h4 class=
"members">Members
</h4>
1142 <dt>colors[CUPS_MAX_RGB]
</dt>
1143 <dd class=
"description">Color values
</dd>
1145 <dd class=
"description">sRGB values
</dd>
1147 <h2 class=
"title"><a name=
"VARIABLES">Variables
</a></h2>
1148 <h3 class=
"variable"><a name=
"cups_scmy_lut[256]">cups_scmy_lut[
256]
</a></h3>
1149 <p class=
"description">sRGB gamma lookup table (inverted)
</p>
1150 <p class=
"code">extern const unsigned char cups_scmy_lut[
256];
</p>
1151 <h3 class=
"variable"><a name=
"cups_srgb_lut[256]">cups_srgb_lut[
256]
</a></h3>
1152 <p class=
"description">sRGB gamma lookup table
</p>
1153 <p class=
"code">extern const unsigned char cups_srgb_lut[
256];
</p>