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 name=
"creator" content=
"Mini-XML v2.6">
8 <style type=
"text/css"><!--
10 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
13 H1, H2, H3, H4, H5, H6, P, TD, TH {
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
18 font-family: monaco, courier, monospace;
23 font-family: monaco, courier, monospace;
41 border: dotted thin #999999;
46 PRE.command EM, PRE.example EM {
47 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
51 font-family: monaco, courier, monospace;
62 border: solid thin #999999;
73 -moz-border-radius: 10px;
78 text-decoration: none;
81 A:link:hover, A:visited:hover, A:active {
82 text-decoration: underline;
89 TR.data, TD.data, TR.data TD {
92 border-bottom: solid 1pt #999999;
96 border-bottom: solid 1pt #999999;
103 border: solid thin #999999;
104 border-collapse: collapse;
120 border: solid thin #cccccc;
127 border-bottom: solid thin #999999;
136 caption-side: bottom;
160 border: thin solid black;
168 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
177 border-bottom: solid 2pt #000000;
180 DIV.indent, TABLE.indent {
188 border-collapse: collapse;
191 TABLE.indent TD, TABLE.indent TH {
196 border-collapse: collapse;
204 border-bottom: solid thin #cccccc;
209 vertical-align: bottom;
218 border-bottom: solid thin #eeeeee;
223 TABLE.list TR:nth-child(even) {
227 TABLE.list TR:nth-child(odd) {
246 font-family: monaco, courier, monospace;
250 border: solid thin #999999;
251 border-collapse: collapse;
256 DIV.summary TABLE TD, DIV.summary TABLE TH {
257 border: solid thin #999999;
263 DIV.summary TABLE THEAD TH {
267 /* API documentation styles... */
274 div.body h3, div.body h4, div.body h5 {
275 margin-bottom: 0.5em;
278 .class, .enumeration, .function, .struct, .typedef, .union {
279 border-bottom: solid thin #999999;
286 code, p.code, pre, ul.code li {
287 font-family: monaco, courier, monospace;
290 ul.code, ul.contents, ul.subcontents {
291 list-style-type: none;
301 ul.contents li ul.code, ul.contents li ul.subcontents {
314 margin-bottom: 0.5em;
317 /* This is just for the HTML files generated with the framedhelp target */
320 border: solid thin black;
329 div.contents ul.contents {
332 div.contents ul.subcontents li {
341 "$Id: api-array.header 8087 2008-10-27 21:37:05Z mike $"
343 Driver API header for CUPS.
345 Copyright 2009 by Apple Inc.
347 These coded instructions, statements, and computer programs are the
348 property of Apple Inc. and are protected by Federal copyright
349 law. Distribution and use rights are outlined in the file "LICENSE.txt"
350 which should have been included with this file. If this file is
351 file is missing or damaged, see the license at "http://www.cups.org/".
354 <h1 class='title'
>Driver API
</h1>
356 <div class='summary'
><table summary='General Information'
>
360 <th>cups/driver.h
</th>
366 <td>-lcupsdriver
</td>
370 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a></td>
374 <h2 class=
"title">Contents
</h2>
375 <ul class=
"contents">
376 <ul class=
"subcontents">
377 <li><a href=
"#OVERVIEW">Overview
</a></li>
378 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
379 <li><a href=
"#cupsCMYKDelete" title=
"Delete a color separation.">cupsCMYKDelete
</a></li>
380 <li><a href=
"#cupsCMYKDoBlack" title=
"Do a black separation...">cupsCMYKDoBlack
</a></li>
381 <li><a href=
"#cupsCMYKDoCMYK" title=
"Do a CMYK separation...">cupsCMYKDoCMYK
</a></li>
382 <li><a href=
"#cupsCMYKDoGray" title=
"Do a grayscale separation...">cupsCMYKDoGray
</a></li>
383 <li><a href=
"#cupsCMYKDoRGB" title=
"Do an sRGB separation...">cupsCMYKDoRGB
</a></li>
384 <li><a href=
"#cupsCMYKLoad" title=
"Load a CMYK color profile from PPD attributes.">cupsCMYKLoad
</a></li>
385 <li><a href=
"#cupsCMYKNew" title=
"Create a new CMYK color separation.">cupsCMYKNew
</a></li>
386 <li><a href=
"#cupsCMYKSetBlack" title=
"Set the transition range for CMY to black.">cupsCMYKSetBlack
</a></li>
387 <li><a href=
"#cupsCMYKSetCurve" title=
"Set a color transform curve using points.">cupsCMYKSetCurve
</a></li>
388 <li><a href=
"#cupsCMYKSetGamma" title=
"Set a color transform curve using gamma and density.">cupsCMYKSetGamma
</a></li>
389 <li><a href=
"#cupsCMYKSetInkLimit" title=
"Set the limit on the amount of ink.">cupsCMYKSetInkLimit
</a></li>
390 <li><a href=
"#cupsCMYKSetLtDk" title=
"Set light/dark ink transforms.">cupsCMYKSetLtDk
</a></li>
391 <li><a href=
"#cupsCheckBytes" title=
"Check to see if all bytes are zero.">cupsCheckBytes
</a></li>
392 <li><a href=
"#cupsCheckValue" title=
"Check to see if all bytes match the given value.">cupsCheckValue
</a></li>
393 <li><a href=
"#cupsDitherDelete" title=
"Free a dithering buffer.">cupsDitherDelete
</a></li>
394 <li><a href=
"#cupsDitherLine" title=
"Dither a line of pixels...">cupsDitherLine
</a></li>
395 <li><a href=
"#cupsDitherNew" title=
"Create an error-diffusion dithering buffer.">cupsDitherNew
</a></li>
396 <li><a href=
"#cupsFindAttr" title=
"Find a PPD attribute based on the colormodel,
397 media, and resolution.">cupsFindAttr
</a></li>
398 <li><a href=
"#cupsLutDelete" title=
"Free the memory used by a lookup table.">cupsLutDelete
</a></li>
399 <li><a href=
"#cupsLutLoad" title=
"Load a LUT from a PPD file.">cupsLutLoad
</a></li>
400 <li><a href=
"#cupsLutNew" title=
"Make a lookup table from a list of pixel values.">cupsLutNew
</a></li>
401 <li><a href=
"#cupsPackHorizontal" title=
"Pack pixels horizontally...">cupsPackHorizontal
</a></li>
402 <li><a href=
"#cupsPackHorizontal2" title=
"Pack 2-bit pixels horizontally...">cupsPackHorizontal2
</a></li>
403 <li><a href=
"#cupsPackHorizontalBit" title=
"Pack pixels horizontally by bit...">cupsPackHorizontalBit
</a></li>
404 <li><a href=
"#cupsPackVertical" title=
"Pack pixels vertically...">cupsPackVertical
</a></li>
405 <li><a href=
"#cupsRGBDelete" title=
"Delete a color separation.">cupsRGBDelete
</a></li>
406 <li><a href=
"#cupsRGBDoGray" title=
"Do a grayscale separation...">cupsRGBDoGray
</a></li>
407 <li><a href=
"#cupsRGBDoRGB" title=
"Do a RGB separation...">cupsRGBDoRGB
</a></li>
408 <li><a href=
"#cupsRGBLoad" title=
"Load a RGB color profile from a PPD file.">cupsRGBLoad
</a></li>
409 <li><a href=
"#cupsRGBNew" title=
"Create a new RGB color separation.">cupsRGBNew
</a></li>
411 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
412 <li><a href=
"#cups_cmyk_t" title=
"Simple CMYK lookup table">cups_cmyk_t
</a></li>
413 <li><a href=
"#cups_dither_t" title=
"Dithering State">cups_dither_t
</a></li>
414 <li><a href=
"#cups_lut_t" title=
"Lookup Table for Dithering">cups_lut_t
</a></li>
415 <li><a href=
"#cups_rgb_t" title=
"Color separation lookup table">cups_rgb_t
</a></li>
416 <li><a href=
"#cups_sample_t" title=
"Color sample point">cups_sample_t
</a></li>
418 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
419 <li><a href=
"#cups_cmyk_s" title=
"Simple CMYK lookup table">cups_cmyk_s
</a></li>
420 <li><a href=
"#cups_dither_s" title=
"Dithering State">cups_dither_s
</a></li>
421 <li><a href=
"#cups_lut_s" title=
"Lookup Table for Dithering">cups_lut_s
</a></li>
422 <li><a href=
"#cups_rgb_s" title=
"Color separation lookup table">cups_rgb_s
</a></li>
423 <li><a href=
"#cups_sample_s" title=
"Color sample point">cups_sample_s
</a></li>
425 <li><a href=
"#VARIABLES">Variables
</a><ul class=
"code">
426 <li><a href=
"#cups_scmy_lut[256]" title=
"sRGB gamma lookup table (inverted)">cups_scmy_lut[
256]
</a></li>
427 <li><a href=
"#cups_srgb_lut[256]" title=
"sRGB gamma lookup table">cups_srgb_lut[
256]
</a></li>
430 "$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
432 Driver API introduction for CUPS.
434 Copyright 2009 by Apple Inc.
436 These coded instructions, statements, and computer programs are the
437 property of Apple Inc. and are protected by Federal copyright
438 law. Distribution and use rights are outlined in the file "LICENSE.txt"
439 which should have been included with this file. If this file is
440 file is missing or damaged, see the license at "http://www.cups.org/".
443 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
445 <p>The driver API provides common dithering, color conversion, and utility
446 functions for CUPS drivers.
</p>
447 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
448 <h3 class=
"function"><a name=
"cupsCMYKDelete">cupsCMYKDelete
</a></h3>
449 <p class=
"description">Delete a color separation.
</p>
451 void cupsCMYKDelete (
<br>
452 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk
<br>
454 <h4 class=
"parameters">Parameters
</h4>
457 <dd class=
"description">Color separation
</dd>
459 <h3 class=
"function"><a name=
"cupsCMYKDoBlack">cupsCMYKDoBlack
</a></h3>
460 <p class=
"description">Do a black separation...
</p>
462 void cupsCMYKDoBlack (
<br>
463 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
464 const unsigned char *input,
<br>
465 short *output,
<br>
466 int num_pixels
<br>
468 <h4 class=
"parameters">Parameters
</h4>
471 <dd class=
"description">Color separation
</dd>
473 <dd class=
"description">Input grayscale pixels
</dd>
475 <dd class=
"description">Output Device-N pixels
</dd>
477 <dd class=
"description">Number of pixels
</dd>
479 <h3 class=
"function"><a name=
"cupsCMYKDoCMYK">cupsCMYKDoCMYK
</a></h3>
480 <p class=
"description">Do a CMYK separation...
</p>
482 void cupsCMYKDoCMYK (
<br>
483 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
484 const unsigned char *input,
<br>
485 short *output,
<br>
486 int num_pixels
<br>
488 <h4 class=
"parameters">Parameters
</h4>
491 <dd class=
"description">Color separation
</dd>
493 <dd class=
"description">Input grayscale pixels
</dd>
495 <dd class=
"description">Output Device-N pixels
</dd>
497 <dd class=
"description">Number of pixels
</dd>
499 <h3 class=
"function"><a name=
"cupsCMYKDoGray">cupsCMYKDoGray
</a></h3>
500 <p class=
"description">Do a grayscale separation...
</p>
502 void cupsCMYKDoGray (
<br>
503 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
504 const unsigned char *input,
<br>
505 short *output,
<br>
506 int num_pixels
<br>
508 <h4 class=
"parameters">Parameters
</h4>
511 <dd class=
"description">Color separation
</dd>
513 <dd class=
"description">Input grayscale pixels
</dd>
515 <dd class=
"description">Output Device-N pixels
</dd>
517 <dd class=
"description">Number of pixels
</dd>
519 <h3 class=
"function"><a name=
"cupsCMYKDoRGB">cupsCMYKDoRGB
</a></h3>
520 <p class=
"description">Do an sRGB separation...
</p>
522 void cupsCMYKDoRGB (
<br>
523 const
<a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
524 const unsigned char *input,
<br>
525 short *output,
<br>
526 int num_pixels
<br>
528 <h4 class=
"parameters">Parameters
</h4>
531 <dd class=
"description">Color separation
</dd>
533 <dd class=
"description">Input grayscale pixels
</dd>
535 <dd class=
"description">Output Device-N pixels
</dd>
537 <dd class=
"description">Number of pixels
</dd>
539 <h3 class=
"function"><a name=
"cupsCMYKLoad">cupsCMYKLoad
</a></h3>
540 <p class=
"description">Load a CMYK color profile from PPD attributes.
</p>
542 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cupsCMYKLoad (
<br>
543 ppd_file_t *ppd,
<br>
544 const char *colormodel,
<br>
545 const char *media,
<br>
546 const char *resolution
<br>
548 <h4 class=
"parameters">Parameters
</h4>
551 <dd class=
"description">PPD file
</dd>
553 <dd class=
"description">ColorModel value
</dd>
555 <dd class=
"description">MediaType value
</dd>
557 <dd class=
"description">Resolution value
</dd>
559 <h4 class=
"returnvalue">Return Value
</h4>
560 <p class=
"description">CMYK color separation
</p>
561 <h3 class=
"function"><a name=
"cupsCMYKNew">cupsCMYKNew
</a></h3>
562 <p class=
"description">Create a new CMYK color separation.
</p>
564 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cupsCMYKNew (
<br>
565 int num_channels
<br>
567 <h4 class=
"parameters">Parameters
</h4>
569 <dt>num_channels
</dt>
570 <dd class=
"description">Number of color components
</dd>
572 <h4 class=
"returnvalue">Return Value
</h4>
573 <p class=
"description">New CMYK separation or NULL
</p>
574 <h3 class=
"function"><a name=
"cupsCMYKSetBlack">cupsCMYKSetBlack
</a></h3>
575 <p class=
"description">Set the transition range for CMY to black.
</p>
577 void cupsCMYKSetBlack (
<br>
578 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
579 float lower,
<br>
580 float upper
<br>
582 <h4 class=
"parameters">Parameters
</h4>
585 <dd class=
"description">CMYK color separation
</dd>
587 <dd class=
"description">No black ink
</dd>
589 <dd class=
"description">Only black ink
</dd>
591 <h3 class=
"function"><a name=
"cupsCMYKSetCurve">cupsCMYKSetCurve
</a></h3>
592 <p class=
"description">Set a color transform curve using points.
</p>
594 void cupsCMYKSetCurve (
<br>
595 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
596 int channel,
<br>
597 int num_xypoints,
<br>
598 const float *xypoints
<br>
600 <h4 class=
"parameters">Parameters
</h4>
603 <dd class=
"description">CMYK color separation
</dd>
605 <dd class=
"description">Color channel
</dd>
606 <dt>num_xypoints
</dt>
607 <dd class=
"description">Number of X,Y points
</dd>
609 <dd class=
"description">X,Y points
</dd>
611 <h3 class=
"function"><a name=
"cupsCMYKSetGamma">cupsCMYKSetGamma
</a></h3>
612 <p class=
"description">Set a color transform curve using gamma and density.
</p>
614 void cupsCMYKSetGamma (
<br>
615 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
616 int channel,
<br>
617 float gamval,
<br>
618 float density
<br>
620 <h4 class=
"parameters">Parameters
</h4>
623 <dd class=
"description">CMYK color separation
</dd>
625 <dd class=
"description">Ink channel
</dd>
627 <dd class=
"description">Gamma correction
</dd>
629 <dd class=
"description">Maximum density
</dd>
631 <h3 class=
"function"><a name=
"cupsCMYKSetInkLimit">cupsCMYKSetInkLimit
</a></h3>
632 <p class=
"description">Set the limit on the amount of ink.
</p>
634 void cupsCMYKSetInkLimit (
<br>
635 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
636 float limit
<br>
638 <h4 class=
"parameters">Parameters
</h4>
641 <dd class=
"description">CMYK color separation
</dd>
643 <dd class=
"description">Limit of ink
</dd>
645 <h3 class=
"function"><a name=
"cupsCMYKSetLtDk">cupsCMYKSetLtDk
</a></h3>
646 <p class=
"description">Set light/dark ink transforms.
</p>
648 void cupsCMYKSetLtDk (
<br>
649 <a href=
"#cups_cmyk_t">cups_cmyk_t
</a> *cmyk,
<br>
650 int channel,
<br>
651 float light,
<br>
652 float dark
<br>
654 <h4 class=
"parameters">Parameters
</h4>
657 <dd class=
"description">CMYK color separation
</dd>
659 <dd class=
"description">Dark ink channel (+
1 for light)
</dd>
661 <dd class=
"description">Light ink only level
</dd>
663 <dd class=
"description">Dark ink only level
</dd>
665 <h3 class=
"function"><a name=
"cupsCheckBytes">cupsCheckBytes
</a></h3>
666 <p class=
"description">Check to see if all bytes are zero.
</p>
668 int cupsCheckBytes (
<br>
669 const unsigned char *bytes,
<br>
670 int length
<br>
672 <h4 class=
"parameters">Parameters
</h4>
675 <dd class=
"description">Bytes to check
</dd>
677 <dd class=
"description">Number of bytes to check
</dd>
679 <h4 class=
"returnvalue">Return Value
</h4>
680 <p class=
"description">1 if they match
</p>
681 <h3 class=
"function"><a name=
"cupsCheckValue">cupsCheckValue
</a></h3>
682 <p class=
"description">Check to see if all bytes match the given value.
</p>
684 int cupsCheckValue (
<br>
685 const unsigned char *bytes,
<br>
686 int length,
<br>
687 const unsigned char value
<br>
689 <h4 class=
"parameters">Parameters
</h4>
692 <dd class=
"description">Bytes to check
</dd>
694 <dd class=
"description">Number of bytes to check
</dd>
696 <dd class=
"description">Value to check
</dd>
698 <h4 class=
"returnvalue">Return Value
</h4>
699 <p class=
"description">1 if they match
</p>
700 <h3 class=
"function"><a name=
"cupsDitherDelete">cupsDitherDelete
</a></h3>
701 <p class=
"description">Free a dithering buffer.
</p>
703 void cupsDitherDelete (
<br>
704 <a href=
"#cups_dither_t">cups_dither_t
</a> *d
<br>
706 <h4 class=
"parameters">Parameters
</h4>
709 <dd class=
"description">Dithering buffer
</dd>
711 <h4 class=
"discussion">Discussion
</h4>
712 <p class=
"discussion">Returns
0 on success, -
1 on failure.
</p>
713 <h3 class=
"function"><a name=
"cupsDitherLine">cupsDitherLine
</a></h3>
714 <p class=
"description">Dither a line of pixels...
</p>
716 void cupsDitherLine (
<br>
717 <a href=
"#cups_dither_t">cups_dither_t
</a> *d,
<br>
718 const
<a href=
"#cups_lut_t">cups_lut_t
</a> *lut,
<br>
719 const short *data,
<br>
720 int num_channels,
<br>
721 unsigned char *p
<br>
723 <h4 class=
"parameters">Parameters
</h4>
726 <dd class=
"description">Dither data
</dd>
728 <dd class=
"description">Lookup table
</dd>
730 <dd class=
"description">Separation data
</dd>
731 <dt>num_channels
</dt>
732 <dd class=
"description">Number of components
</dd>
734 <dd class=
"description">Pixels
</dd>
736 <h3 class=
"function"><a name=
"cupsDitherNew">cupsDitherNew
</a></h3>
737 <p class=
"description">Create an error-diffusion dithering buffer.
</p>
739 <a href=
"#cups_dither_t">cups_dither_t
</a> *cupsDitherNew (
<br>
740 int width
<br>
742 <h4 class=
"parameters">Parameters
</h4>
745 <dd class=
"description">Width of output in pixels
</dd>
747 <h4 class=
"returnvalue">Return Value
</h4>
748 <p class=
"description">New state array
</p>
749 <h3 class=
"function"><a name=
"cupsFindAttr">cupsFindAttr
</a></h3>
750 <p class=
"description">Find a PPD attribute based on the colormodel,
751 media, and resolution.
</p>
753 ppd_attr_t *cupsFindAttr (
<br>
754 ppd_file_t *ppd,
<br>
755 const char *name,
<br>
756 const char *colormodel,
<br>
757 const char *media,
<br>
758 const char *resolution,
<br>
759 char *spec,
<br>
760 int specsize
<br>
762 <h4 class=
"parameters">Parameters
</h4>
765 <dd class=
"description">PPD file
</dd>
767 <dd class=
"description">Attribute name
</dd>
769 <dd class=
"description">Color model
</dd>
771 <dd class=
"description">Media type
</dd>
773 <dd class=
"description">Resolution
</dd>
775 <dd class=
"description">Final selection string
</dd>
777 <dd class=
"description">Size of string buffer
</dd>
779 <h4 class=
"returnvalue">Return Value
</h4>
780 <p class=
"description">Matching attribute or NULL
</p>
781 <h3 class=
"function"><a name=
"cupsLutDelete">cupsLutDelete
</a></h3>
782 <p class=
"description">Free the memory used by a lookup table.
</p>
784 void cupsLutDelete (
<br>
785 <a href=
"#cups_lut_t">cups_lut_t
</a> *lut
<br>
787 <h4 class=
"parameters">Parameters
</h4>
790 <dd class=
"description">Lookup table to free
</dd>
792 <h3 class=
"function"><a name=
"cupsLutLoad">cupsLutLoad
</a></h3>
793 <p class=
"description">Load a LUT from a PPD file.
</p>
795 <a href=
"#cups_lut_t">cups_lut_t
</a> *cupsLutLoad (
<br>
796 ppd_file_t *ppd,
<br>
797 const char *colormodel,
<br>
798 const char *media,
<br>
799 const char *resolution,
<br>
800 const char *ink
<br>
802 <h4 class=
"parameters">Parameters
</h4>
805 <dd class=
"description">PPD file
</dd>
807 <dd class=
"description">Color model
</dd>
809 <dd class=
"description">Media type
</dd>
811 <dd class=
"description">Resolution
</dd>
813 <dd class=
"description">Ink name
</dd>
815 <h4 class=
"returnvalue">Return Value
</h4>
816 <p class=
"description">New lookup table
</p>
817 <h3 class=
"function"><a name=
"cupsLutNew">cupsLutNew
</a></h3>
818 <p class=
"description">Make a lookup table from a list of pixel values.
</p>
820 <a href=
"#cups_lut_t">cups_lut_t
</a> *cupsLutNew (
<br>
821 int num_values,
<br>
822 const float *values
<br>
824 <h4 class=
"parameters">Parameters
</h4>
827 <dd class=
"description">Number of values
</dd>
829 <dd class=
"description">Lookup table values
</dd>
831 <h4 class=
"returnvalue">Return Value
</h4>
832 <p class=
"description">New lookup table
</p>
833 <h4 class=
"discussion">Discussion
</h4>
834 <p class=
"discussion">Returns a pointer to the lookup table on success, NULL on failure.
</p>
835 <h3 class=
"function"><a name=
"cupsPackHorizontal">cupsPackHorizontal
</a></h3>
836 <p class=
"description">Pack pixels horizontally...
</p>
838 void cupsPackHorizontal (
<br>
839 const unsigned char *ipixels,
<br>
840 unsigned char *obytes,
<br>
841 int width,
<br>
842 const unsigned char clearto,
<br>
843 const int step
<br>
845 <h4 class=
"parameters">Parameters
</h4>
848 <dd class=
"description">Input pixels
</dd>
850 <dd class=
"description">Output bytes
</dd>
852 <dd class=
"description">Number of pixels
</dd>
854 <dd class=
"description">Initial value of bytes
</dd>
856 <dd class=
"description">Step value between pixels
</dd>
858 <h3 class=
"function"><a name=
"cupsPackHorizontal2">cupsPackHorizontal2
</a></h3>
859 <p class=
"description">Pack
2-bit pixels horizontally...
</p>
861 void cupsPackHorizontal2 (
<br>
862 const unsigned char *ipixels,
<br>
863 unsigned char *obytes,
<br>
864 int width,
<br>
865 const int step
<br>
867 <h4 class=
"parameters">Parameters
</h4>
870 <dd class=
"description">Input pixels
</dd>
872 <dd class=
"description">Output bytes
</dd>
874 <dd class=
"description">Number of pixels
</dd>
876 <dd class=
"description">Stepping value
</dd>
878 <h3 class=
"function"><a name=
"cupsPackHorizontalBit">cupsPackHorizontalBit
</a></h3>
879 <p class=
"description">Pack pixels horizontally by bit...
</p>
881 void cupsPackHorizontalBit (
<br>
882 const unsigned char *ipixels,
<br>
883 unsigned char *obytes,
<br>
884 int width,
<br>
885 const unsigned char clearto,
<br>
886 const unsigned char bit
<br>
888 <h4 class=
"parameters">Parameters
</h4>
891 <dd class=
"description">Input pixels
</dd>
893 <dd class=
"description">Output bytes
</dd>
895 <dd class=
"description">Number of pixels
</dd>
897 <dd class=
"description">Initial value of bytes
</dd>
899 <dd class=
"description">Bit to check
</dd>
901 <h3 class=
"function"><a name=
"cupsPackVertical">cupsPackVertical
</a></h3>
902 <p class=
"description">Pack pixels vertically...
</p>
904 void cupsPackVertical (
<br>
905 const unsigned char *ipixels,
<br>
906 unsigned char *obytes,
<br>
907 int width,
<br>
908 const unsigned char bit,
<br>
909 const int step
<br>
911 <h4 class=
"parameters">Parameters
</h4>
914 <dd class=
"description">Input pixels
</dd>
916 <dd class=
"description">Output bytes
</dd>
918 <dd class=
"description">Number of input pixels
</dd>
920 <dd class=
"description">Output bit
</dd>
922 <dd class=
"description">Number of bytes between columns
</dd>
924 <h3 class=
"function"><a name=
"cupsRGBDelete">cupsRGBDelete
</a></h3>
925 <p class=
"description">Delete a color separation.
</p>
927 void cupsRGBDelete (
<br>
928 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr
<br>
930 <h4 class=
"parameters">Parameters
</h4>
933 <dd class=
"description">Color separation
</dd>
935 <h3 class=
"function"><a name=
"cupsRGBDoGray">cupsRGBDoGray
</a></h3>
936 <p class=
"description">Do a grayscale separation...
</p>
938 void cupsRGBDoGray (
<br>
939 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr,
<br>
940 const unsigned char *input,
<br>
941 unsigned char *output,
<br>
942 int num_pixels
<br>
944 <h4 class=
"parameters">Parameters
</h4>
947 <dd class=
"description">Color separation
</dd>
949 <dd class=
"description">Input grayscale pixels
</dd>
951 <dd class=
"description">Output Device-N pixels
</dd>
953 <dd class=
"description">Number of pixels
</dd>
955 <h3 class=
"function"><a name=
"cupsRGBDoRGB">cupsRGBDoRGB
</a></h3>
956 <p class=
"description">Do a RGB separation...
</p>
958 void cupsRGBDoRGB (
<br>
959 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *rgbptr,
<br>
960 const unsigned char *input,
<br>
961 unsigned char *output,
<br>
962 int num_pixels
<br>
964 <h4 class=
"parameters">Parameters
</h4>
967 <dd class=
"description">Color separation
</dd>
969 <dd class=
"description">Input RGB pixels
</dd>
971 <dd class=
"description">Output Device-N pixels
</dd>
973 <dd class=
"description">Number of pixels
</dd>
975 <h3 class=
"function"><a name=
"cupsRGBLoad">cupsRGBLoad
</a></h3>
976 <p class=
"description">Load a RGB color profile from a PPD file.
</p>
978 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *cupsRGBLoad (
<br>
979 ppd_file_t *ppd,
<br>
980 const char *colormodel,
<br>
981 const char *media,
<br>
982 const char *resolution
<br>
984 <h4 class=
"parameters">Parameters
</h4>
987 <dd class=
"description">PPD file
</dd>
989 <dd class=
"description">Color model
</dd>
991 <dd class=
"description">Media type
</dd>
993 <dd class=
"description">Resolution
</dd>
995 <h4 class=
"returnvalue">Return Value
</h4>
996 <p class=
"description">New color profile
</p>
997 <h3 class=
"function"><a name=
"cupsRGBNew">cupsRGBNew
</a></h3>
998 <p class=
"description">Create a new RGB color separation.
</p>
1000 <a href=
"#cups_rgb_t">cups_rgb_t
</a> *cupsRGBNew (
<br>
1001 int num_samples,
<br>
1002 <a href=
"#cups_sample_t">cups_sample_t
</a> *samples,
<br>
1003 int cube_size,
<br>
1004 int num_channels
<br>
1006 <h4 class=
"parameters">Parameters
</h4>
1008 <dt>num_samples
</dt>
1009 <dd class=
"description">Number of samples
</dd>
1011 <dd class=
"description">Samples
</dd>
1013 <dd class=
"description">Size of LUT cube
</dd>
1014 <dt>num_channels
</dt>
1015 <dd class=
"description">Number of color components
</dd>
1017 <h4 class=
"returnvalue">Return Value
</h4>
1018 <p class=
"description">New color separation or NULL
</p>
1019 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1020 <h3 class=
"typedef"><a name=
"cups_cmyk_t">cups_cmyk_t
</a></h3>
1021 <p class=
"description">Simple CMYK lookup table
</p>
1023 typedef struct
<a href=
"#cups_cmyk_s">cups_cmyk_s
</a> cups_cmyk_t;
1025 <h3 class=
"typedef"><a name=
"cups_dither_t">cups_dither_t
</a></h3>
1026 <p class=
"description">Dithering State
</p>
1028 typedef struct
<a href=
"#cups_dither_s">cups_dither_s
</a> cups_dither_t;
1030 <h3 class=
"typedef"><a name=
"cups_lut_t">cups_lut_t
</a></h3>
1031 <p class=
"description">Lookup Table for Dithering
</p>
1033 typedef struct
<a href=
"#cups_lut_s">cups_lut_s
</a> cups_lut_t;
1035 <h3 class=
"typedef"><a name=
"cups_rgb_t">cups_rgb_t
</a></h3>
1036 <p class=
"description">Color separation lookup table
</p>
1038 typedef struct
<a href=
"#cups_rgb_s">cups_rgb_s
</a> cups_rgb_t;
1040 <h3 class=
"typedef"><a name=
"cups_sample_t">cups_sample_t
</a></h3>
1041 <p class=
"description">Color sample point
</p>
1043 typedef struct
<a href=
"#cups_sample_s">cups_sample_s
</a> cups_sample_t;
1045 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1046 <h3 class=
"struct"><a name=
"cups_cmyk_s">cups_cmyk_s
</a></h3>
1047 <p class=
"description">Simple CMYK lookup table
</p>
1048 <p class=
"code">struct cups_cmyk_s {
<br>
1049 unsigned char black_lut[
256];
<br>
1050 short *channels[CUPS_MAX_CHAN];
<br>
1051 unsigned char color_lut[
256];
<br>
1052 int ink_limit;
<br>
1053 int num_channels;
<br>
1055 <h4 class=
"members">Members
</h4>
1057 <dt>black_lut[
256]
</dt>
1058 <dd class=
"description">Black generation LUT
</dd>
1059 <dt>channels[CUPS_MAX_CHAN]
</dt>
1060 <dd class=
"description">Lookup tables
</dd>
1061 <dt>color_lut[
256]
</dt>
1062 <dd class=
"description">Color removal LUT
</dd>
1064 <dd class=
"description">Ink limit
</dd>
1065 <dt>num_channels
</dt>
1066 <dd class=
"description">Number of components
</dd>
1068 <h3 class=
"struct"><a name=
"cups_dither_s">cups_dither_s
</a></h3>
1069 <p class=
"description">Dithering State
</p>
1070 <p class=
"code">struct cups_dither_s {
<br>
1071 int errors[
96];
<br>
1072 int row;
<br>
1073 int width;
<br>
1075 <h4 class=
"members">Members
</h4>
1077 <dt>errors[
96]
</dt>
1078 <dd class=
"description">Error values
</dd>
1080 <dd class=
"description">Current row
</dd>
1082 <dd class=
"description">Width of buffer
</dd>
1084 <h3 class=
"struct"><a name=
"cups_lut_s">cups_lut_s
</a></h3>
1085 <p class=
"description">Lookup Table for Dithering
</p>
1086 <p class=
"code">struct cups_lut_s {
<br>
1087 int error;
<br>
1088 short intensity;
<br>
1089 short pixel;
<br>
1091 <h4 class=
"members">Members
</h4>
1094 <dd class=
"description">Error from desired value
</dd>
1096 <dd class=
"description">Adjusted intensity
</dd>
1098 <dd class=
"description">Output pixel value
</dd>
1100 <h3 class=
"struct"><a name=
"cups_rgb_s">cups_rgb_s
</a></h3>
1101 <p class=
"description">Color separation lookup table
</p>
1102 <p class=
"code">struct cups_rgb_s {
<br>
1103 unsigned char black[CUPS_MAX_RGB];
<br>
1104 int cache_init;
<br>
1105 unsigned char ****colors;
<br>
1106 int cube_index[
256];
<br>
1107 int cube_mult[
256];
<br>
1108 int cube_size;
<br>
1109 int num_channels;
<br>
1110 unsigned char white[CUPS_MAX_RGB];
<br>
1112 <h4 class=
"members">Members
</h4>
1114 <dt>black[CUPS_MAX_RGB]
</dt>
1115 <dd class=
"description">Cached black (sRGB =
0,
0,
0)
</dd>
1116 <dt>cache_init
</dt>
1117 <dd class=
"description">Are cached values initialized?
</dd>
1119 <dd class=
"description">4-D array of sample values
</dd>
1120 <dt>cube_index[
256]
</dt>
1121 <dd class=
"description">Index into cube for a given sRGB value
</dd>
1122 <dt>cube_mult[
256]
</dt>
1123 <dd class=
"description">Multiplier value for a given sRGB value
</dd>
1125 <dd class=
"description">Size of color cube (
2-N) on a side
</dd>
1126 <dt>num_channels
</dt>
1127 <dd class=
"description">Number of colors per sample
</dd>
1128 <dt>white[CUPS_MAX_RGB]
</dt>
1129 <dd class=
"description">Cached white (sRGB =
255,
255,
255)
</dd>
1131 <h3 class=
"struct"><a name=
"cups_sample_s">cups_sample_s
</a></h3>
1132 <p class=
"description">Color sample point
</p>
1133 <p class=
"code">struct cups_sample_s {
<br>
1134 unsigned char colors[CUPS_MAX_RGB];
<br>
1135 unsigned char rgb[
3];
<br>
1137 <h4 class=
"members">Members
</h4>
1139 <dt>colors[CUPS_MAX_RGB]
</dt>
1140 <dd class=
"description">Color values
</dd>
1142 <dd class=
"description">sRGB values
</dd>
1144 <h2 class=
"title"><a name=
"VARIABLES">Variables
</a></h2>
1145 <h3 class=
"variable"><a name=
"cups_scmy_lut[256]">cups_scmy_lut[
256]
</a></h3>
1146 <p class=
"description">sRGB gamma lookup table (inverted)
</p>
1147 <p class=
"code">extern const unsigned char cups_scmy_lut[
256];
</p>
1148 <h3 class=
"variable"><a name=
"cups_srgb_lut[256]">cups_srgb_lut[
256]
</a></h3>
1149 <p class=
"description">sRGB gamma lookup table
</p>
1150 <p class=
"code">extern const unsigned char cups_srgb_lut[
256];
</p>