File: cupsdriver.html

package info (click to toggle)
cupsddk 1.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,488 kB
  • ctags: 1,125
  • sloc: ansic: 7,074; cpp: 5,423; makefile: 526; xml: 227; sh: 153
file content (982 lines) | stat: -rw-r--r-- 32,853 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
	<title>Documentation</title>
	<style><!--
	h1, h2, h3, p { font-family: sans-serif; text-align: justify; }
	tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }
	pre { font-weight: bold; color: #7f0000; margin-left: 2em; }
	--></style>
</head>
<body>
<h2>Contents</h2>
<ul>
	<li><a href='#_functions'>Functions</a></li>
	<li><a href='#_structures'>Structures</a></li>
	<li><a href='#_types'>Types</a></li>
	<li><a href='#_variables'>Variables</a></li>
</ul>
<!-- NEW PAGE -->
<h2><a name='_functions'>Functions</a></h2>
<ul>
	<li><a href='#cupsCMYKDelete'><tt>cupsCMYKDelete()</tt></a></li>
	<li><a href='#cupsCMYKDoBlack'><tt>cupsCMYKDoBlack()</tt></a></li>
	<li><a href='#cupsCMYKDoCMYK'><tt>cupsCMYKDoCMYK()</tt></a></li>
	<li><a href='#cupsCMYKDoGray'><tt>cupsCMYKDoGray()</tt></a></li>
	<li><a href='#cupsCMYKDoRGB'><tt>cupsCMYKDoRGB()</tt></a></li>
	<li><a href='#cupsCMYKLoad'><tt>cupsCMYKLoad()</tt></a></li>
	<li><a href='#cupsCMYKNew'><tt>cupsCMYKNew()</tt></a></li>
	<li><a href='#cupsCMYKSetBlack'><tt>cupsCMYKSetBlack()</tt></a></li>
	<li><a href='#cupsCMYKSetCurve'><tt>cupsCMYKSetCurve()</tt></a></li>
	<li><a href='#cupsCMYKSetGamma'><tt>cupsCMYKSetGamma()</tt></a></li>
	<li><a href='#cupsCMYKSetInkLimit'><tt>cupsCMYKSetInkLimit()</tt></a></li>
	<li><a href='#cupsCMYKSetLtDk'><tt>cupsCMYKSetLtDk()</tt></a></li>
	<li><a href='#cupsCheckBytes'><tt>cupsCheckBytes()</tt></a></li>
	<li><a href='#cupsCheckValue'><tt>cupsCheckValue()</tt></a></li>
	<li><a href='#cupsDitherDelete'><tt>cupsDitherDelete()</tt></a></li>
	<li><a href='#cupsDitherLine'><tt>cupsDitherLine()</tt></a></li>
	<li><a href='#cupsDitherNew'><tt>cupsDitherNew()</tt></a></li>
	<li><a href='#cupsFindAttr'><tt>cupsFindAttr()</tt></a></li>
	<li><a href='#cupsLutDelete'><tt>cupsLutDelete()</tt></a></li>
	<li><a href='#cupsLutLoad'><tt>cupsLutLoad()</tt></a></li>
	<li><a href='#cupsLutNew'><tt>cupsLutNew()</tt></a></li>
	<li><a href='#cupsPackHorizontal'><tt>cupsPackHorizontal()</tt></a></li>
	<li><a href='#cupsPackHorizontal2'><tt>cupsPackHorizontal2()</tt></a></li>
	<li><a href='#cupsPackHorizontalBit'><tt>cupsPackHorizontalBit()</tt></a></li>
	<li><a href='#cupsPackVertical'><tt>cupsPackVertical()</tt></a></li>
	<li><a href='#cupsRGBDelete'><tt>cupsRGBDelete()</tt></a></li>
	<li><a href='#cupsRGBDoGray'><tt>cupsRGBDoGray()</tt></a></li>
	<li><a href='#cupsRGBDoRGB'><tt>cupsRGBDoRGB()</tt></a></li>
	<li><a href='#cupsRGBLoad'><tt>cupsRGBLoad()</tt></a></li>
	<li><a href='#cupsRGBNew'><tt>cupsRGBNew()</tt></a></li>
</ul>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKDelete'>cupsCMYKDelete()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Delete a color separation.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKDelete(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>Color separation</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKDoBlack'>cupsCMYKDoBlack()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do a black separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKDoBlack(
    const <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input grayscale pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKDoCMYK'>cupsCMYKDoCMYK()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do a CMYK separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKDoCMYK(
    const <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input grayscale pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKDoGray'>cupsCMYKDoGray()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do a grayscale separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKDoGray(
    const <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input grayscale pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKDoRGB'>cupsCMYKDoRGB()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do an sRGB separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKDoRGB(
    const <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input grayscale pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKLoad'>cupsCMYKLoad()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Load a CMYK color profile from PPD attributes.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_cmyk_t'>cups_cmyk_t</a> *
cupsCMYKLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>colormodel</tt></td><td>ColorModel value</td></tr>
<tr><td><tt>media</tt></td><td>MediaType value</td></tr>
<tr><td><tt>resolution</tt></td><td>Resolution value</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>CMYK color separation</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKNew'>cupsCMYKNew()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Create a new CMYK color separation.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_cmyk_t'>cups_cmyk_t</a> *
cupsCMYKNew(
    int num_channels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>num_channels</tt></td><td>Number of color components</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New CMYK separation or NULL</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKSetBlack'>cupsCMYKSetBlack()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Set the transition range for CMY to black.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKSetBlack(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    float lower,
    float upper);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>CMYK color separation</td></tr>
<tr><td><tt>lower</tt></td><td>No black ink</td></tr>
<tr><td><tt>upper</tt></td><td>Only black ink</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKSetCurve'>cupsCMYKSetCurve()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Set a color transform curve using points.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKSetCurve(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    int channel,
    int num_xypoints,
    const float * xypoints);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>CMYK color separation</td></tr>
<tr><td><tt>channel</tt></td><td>Color channel</td></tr>
<tr><td><tt>num_xypoints</tt></td><td>Number of X,Y points</td></tr>
<tr><td><tt>xypoints</tt></td><td>X,Y points</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKSetGamma'>cupsCMYKSetGamma()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Set a color transform curve using gamma and density.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKSetGamma(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    int channel,
    float gamval,
    float density);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>CMYK color separation</td></tr>
<tr><td><tt>channel</tt></td><td>Ink channel</td></tr>
<tr><td><tt>gamval</tt></td><td>Gamma correction</td></tr>
<tr><td><tt>density</tt></td><td>Maximum density</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKSetInkLimit'>cupsCMYKSetInkLimit()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Set the limit on the amount of ink.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKSetInkLimit(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    float limit);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>CMYK color separation</td></tr>
<tr><td><tt>limit</tt></td><td>Limit of ink</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCMYKSetLtDk'>cupsCMYKSetLtDk()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Set light/dark ink transforms.</p>
<h4>Syntax</h4>
<pre>
void
cupsCMYKSetLtDk(
    <a href='#cups_cmyk_t'>cups_cmyk_t</a> * cmyk,
    int channel,
    float light,
    float dark);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>cmyk</tt></td><td>CMYK color separation</td></tr>
<tr><td><tt>channel</tt></td><td>Dark ink channel (+1 for light)</td></tr>
<tr><td><tt>light</tt></td><td>Light ink only level</td></tr>
<tr><td><tt>dark</tt></td><td>Dark ink only level</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsCheckBytes'>cupsCheckBytes()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Check to see if all bytes are zero.</p>
<h4>Syntax</h4>
<pre>
int
cupsCheckBytes(
    const unsigned char * bytes,
    int length);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>bytes</tt></td><td>Bytes to check</td></tr>
<tr><td><tt>length</tt></td><td>Number of bytes to check</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>1 if they match</p>
<!-- NEW PAGE -->
<h3><a name='cupsCheckValue'>cupsCheckValue()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Check to see if all bytes match the given value.</p>
<h4>Syntax</h4>
<pre>
int
cupsCheckValue(
    const unsigned char * bytes,
    int length,
    const unsigned char value);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>bytes</tt></td><td>Bytes to check</td></tr>
<tr><td><tt>length</tt></td><td>Number of bytes to check</td></tr>
<tr><td><tt>value</tt></td><td>Value to check</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>1 if they match</p>
<!-- NEW PAGE -->
<h3><a name='cupsDitherDelete'>cupsDitherDelete()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Free a dithering buffer.

Returns 0 on success, -1 on failure.</p>
<h4>Syntax</h4>
<pre>
void
cupsDitherDelete(
    <a href='#cups_dither_t'>cups_dither_t</a> * d);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>d</tt></td><td>Dithering buffer</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsDitherLine'>cupsDitherLine()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Dither a line of pixels...</p>
<h4>Syntax</h4>
<pre>
void
cupsDitherLine(
    <a href='#cups_dither_t'>cups_dither_t</a> * d,
    const <a href='#cups_lut_t'>cups_lut_t</a> * lut,
    const short * data,
    int num_channels,
    unsigned char * p);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>d</tt></td><td>Dither data</td></tr>
<tr><td><tt>lut</tt></td><td>Lookup table</td></tr>
<tr><td><tt>data</tt></td><td>Separation data</td></tr>
<tr><td><tt>num_channels</tt></td><td>Number of components</td></tr>
<tr><td><tt>p</tt></td><td>Pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsDitherNew'>cupsDitherNew()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Create an error-diffusion dithering buffer.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_dither_t'>cups_dither_t</a> *
cupsDitherNew(
    int width);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>width</tt></td><td>Width of output in pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New state array</p>
<!-- NEW PAGE -->
<h3><a name='cupsFindAttr'>cupsFindAttr()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Find a PPD attribute based on the colormodel,
media, and resolution.</p>
<h4>Syntax</h4>
<pre>
ppd_attr_t *
cupsFindAttr(
    ppd_file_t * ppd,
    const char * name,
    const char * colormodel,
    const char * media,
    const char * resolution,
    char * spec,
    int specsize);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>name</tt></td><td>Attribute name</td></tr>
<tr><td><tt>colormodel</tt></td><td>Color model</td></tr>
<tr><td><tt>media</tt></td><td>Media type</td></tr>
<tr><td><tt>resolution</tt></td><td>Resolution</td></tr>
<tr><td><tt>spec</tt></td><td>Final selection string</td></tr>
<tr><td><tt>specsize</tt></td><td>Size of string buffer</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Matching attribute or NULL</p>
<!-- NEW PAGE -->
<h3><a name='cupsLutDelete'>cupsLutDelete()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Free the memory used by a lookup table.</p>
<h4>Syntax</h4>
<pre>
void
cupsLutDelete(
    <a href='#cups_lut_t'>cups_lut_t</a> * lut);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>lut</tt></td><td>Lookup table to free</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsLutLoad'>cupsLutLoad()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Load a LUT from a PPD file.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_lut_t'>cups_lut_t</a> *
cupsLutLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution,
    const char * ink);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>colormodel</tt></td><td>Color model</td></tr>
<tr><td><tt>media</tt></td><td>Media type</td></tr>
<tr><td><tt>resolution</tt></td><td>Resolution</td></tr>
<tr><td><tt>ink</tt></td><td>Ink name</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New lookup table</p>
<!-- NEW PAGE -->
<h3><a name='cupsLutNew'>cupsLutNew()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Make a lookup table from a list of pixel values.

Returns a pointer to the lookup table on success, NULL on failure.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_lut_t'>cups_lut_t</a> *
cupsLutNew(
    int num_values,
    const float * values);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>num_values</tt></td><td>Number of values</td></tr>
<tr><td><tt>values</tt></td><td>Lookup table values</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New lookup table</p>
<!-- NEW PAGE -->
<h3><a name='cupsPackHorizontal'>cupsPackHorizontal()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Pack pixels horizontally...</p>
<h4>Syntax</h4>
<pre>
void
cupsPackHorizontal(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char clearto,
    const int step);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ipixels</tt></td><td>Input pixels</td></tr>
<tr><td><tt>obytes</tt></td><td>Output bytes</td></tr>
<tr><td><tt>width</tt></td><td>Number of pixels</td></tr>
<tr><td><tt>clearto</tt></td><td>Initial value of bytes</td></tr>
<tr><td><tt>step</tt></td><td>Step value between pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsPackHorizontal2'>cupsPackHorizontal2()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Pack 2-bit pixels horizontally...</p>
<h4>Syntax</h4>
<pre>
void
cupsPackHorizontal2(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const int step);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ipixels</tt></td><td>Input pixels</td></tr>
<tr><td><tt>obytes</tt></td><td>Output bytes</td></tr>
<tr><td><tt>width</tt></td><td>Number of pixels</td></tr>
<tr><td><tt>step</tt></td><td>Stepping value</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsPackHorizontalBit'>cupsPackHorizontalBit()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Pack pixels horizontally by bit...</p>
<h4>Syntax</h4>
<pre>
void
cupsPackHorizontalBit(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char clearto,
    const unsigned char bit);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ipixels</tt></td><td>Input pixels</td></tr>
<tr><td><tt>obytes</tt></td><td>Output bytes</td></tr>
<tr><td><tt>width</tt></td><td>Number of pixels</td></tr>
<tr><td><tt>clearto</tt></td><td>Initial value of bytes</td></tr>
<tr><td><tt>bit</tt></td><td>Bit to check</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsPackVertical'>cupsPackVertical()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Pack pixels vertically...</p>
<h4>Syntax</h4>
<pre>
void
cupsPackVertical(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char bit,
    const int step);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ipixels</tt></td><td>Input pixels</td></tr>
<tr><td><tt>obytes</tt></td><td>Output bytes</td></tr>
<tr><td><tt>width</tt></td><td>Number of input pixels</td></tr>
<tr><td><tt>bit</tt></td><td>Output bit</td></tr>
<tr><td><tt>step</tt></td><td>Number of bytes between columns</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsRGBDelete'>cupsRGBDelete()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Delete a color separation.</p>
<h4>Syntax</h4>
<pre>
void
cupsRGBDelete(
    <a href='#cups_rgb_t'>cups_rgb_t</a> * rgbptr);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>rgbptr</tt></td><td>Color separation</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsRGBDoGray'>cupsRGBDoGray()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do a grayscale separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsRGBDoGray(
    <a href='#cups_rgb_t'>cups_rgb_t</a> * rgbptr,
    const unsigned char * input,
    unsigned char * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>rgbptr</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input grayscale pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsRGBDoRGB'>cupsRGBDoRGB()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Do a RGB separation...</p>
<h4>Syntax</h4>
<pre>
void
cupsRGBDoRGB(
    <a href='#cups_rgb_t'>cups_rgb_t</a> * rgbptr,
    const unsigned char * input,
    unsigned char * output,
    int num_pixels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>rgbptr</tt></td><td>Color separation</td></tr>
<tr><td><tt>input</tt></td><td>Input RGB pixels</td></tr>
<tr><td><tt>output</tt></td><td>Output Device-N pixels</td></tr>
<tr><td><tt>num_pixels</tt></td><td>Number of pixels</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3><a name='cupsRGBLoad'>cupsRGBLoad()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Load a RGB color profile from a PPD file.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_rgb_t'>cups_rgb_t</a> *
cupsRGBLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>colormodel</tt></td><td>Color model</td></tr>
<tr><td><tt>media</tt></td><td>Media type</td></tr>
<tr><td><tt>resolution</tt></td><td>Resolution</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New color profile</p>
<!-- NEW PAGE -->
<h3><a name='cupsRGBNew'>cupsRGBNew()</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Create a new RGB color separation.</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_rgb_t'>cups_rgb_t</a> *
cupsRGBNew(
    int num_samples,
    <a href='#cups_sample_t'>cups_sample_t</a> * samples,
    int cube_size,
    int num_channels);
</pre>
<h4>Arguments</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>num_samples</tt></td><td>Number of samples</td></tr>
<tr><td><tt>samples</tt></td><td>Samples</td></tr>
<tr><td><tt>cube_size</tt></td><td>Size of LUT cube</td></tr>
<tr><td><tt>num_channels</tt></td><td>Number of color components</td></tr>
</tbody></table></p>
<h4>Returns</h4>
<p>New color separation or NULL</p>
<!-- NEW PAGE -->
<h2><a name='_structures'>Structures</a></h2>
<ul>
	<li><a href='#cups_cmyk_s'><tt>cups_cmyk_s</tt></a></li>
	<li><a href='#cups_dither_s'><tt>cups_dither_s</tt></a></li>
	<li><a href='#cups_lut_s'><tt>cups_lut_s</tt></a></li>
	<li><a href='#cups_rgb_s'><tt>cups_rgb_s</tt></a></li>
	<li><a href='#cups_sample_s'><tt>cups_sample_s</tt></a></li>
</ul>
<!-- NEW PAGE -->
<h3><a name='cups_cmyk_s'>cups_cmyk_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Simple CMYK lookup table</p>
<h4>Definition</h4>
<pre>
struct cups_cmyk_s
{
  unsigned char black_lut[256];
  short * channels[CUPS_MAX_CHAN];
  unsigned char color_lut[256];
  int ink_limit;
  int num_channels;
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>black_lut[256]</tt></td><td>Black generation LUT</td></tr>
<tr><td><tt>channels[CUPS_MAX_CHAN]</tt></td><td>Lookup tables</td></tr>
<tr><td><tt>color_lut[256]</tt></td><td>Color removal LUT</td></tr>
<tr><td><tt>ink_limit</tt></td><td>Ink limit</td></tr>
<tr><td><tt>num_channels</tt></td><td>Number of components</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h3><a name='cups_dither_s'>cups_dither_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Dithering State</p>
<h4>Definition</h4>
<pre>
struct cups_dither_s
{
  int errors[96];
  int row;
  int width;
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>errors[96]</tt></td><td>Error values</td></tr>
<tr><td><tt>row</tt></td><td>Current row</td></tr>
<tr><td><tt>width</tt></td><td>Width of buffer</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h3><a name='cups_lut_s'>cups_lut_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Lookup Table for Dithering</p>
<h4>Definition</h4>
<pre>
struct cups_lut_s
{
  int error;
  short intensity;
  short pixel;
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>error</tt></td><td>Error from desired value</td></tr>
<tr><td><tt>intensity</tt></td><td>Adjusted intensity</td></tr>
<tr><td><tt>pixel</tt></td><td>Output pixel value</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h3><a name='cups_rgb_s'>cups_rgb_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Color separation lookup table</p>
<h4>Definition</h4>
<pre>
struct cups_rgb_s
{
  unsigned char black[CUPS_MAX_RGB];
  int cache_init;
  unsigned char **** colors;
  int cube_index[256];
  int cube_mult[256];
  int cube_size;
  int num_channels;
  unsigned char white[CUPS_MAX_RGB];
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>black[CUPS_MAX_RGB]</tt></td><td>Cached black (sRGB = 0,0,0)</td></tr>
<tr><td><tt>cache_init</tt></td><td>Are cached values initialized?</td></tr>
<tr><td><tt>colors</tt></td><td>4-D array of sample values</td></tr>
<tr><td><tt>cube_index[256]</tt></td><td>Index into cube for a given sRGB value</td></tr>
<tr><td><tt>cube_mult[256]</tt></td><td>Multiplier value for a given sRGB value</td></tr>
<tr><td><tt>cube_size</tt></td><td>Size of color cube (2-N) on a side</td></tr>
<tr><td><tt>num_channels</tt></td><td>Number of colors per sample</td></tr>
<tr><td><tt>white[CUPS_MAX_RGB]</tt></td><td>Cached white (sRGB = 255,255,255)</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h3><a name='cups_sample_s'>cups_sample_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Color sample point</p>
<h4>Definition</h4>
<pre>
struct cups_sample_s
{
  unsigned char colors[CUPS_MAX_RGB];
  unsigned char rgb[3];
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' width='80%'>
<thead><tr bgcolor='#cccccc'><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>colors[CUPS_MAX_RGB]</tt></td><td>Color values</td></tr>
<tr><td><tt>rgb[3]</tt></td><td>sRGB values</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h2><a name='_types'>Types</a></h2>
<ul>
	<li><a href='#cups_cmyk_t'><tt>cups_cmyk_t</tt></a></li>
	<li><a href='#cups_dither_t'><tt>cups_dither_t</tt></a></li>
	<li><a href='#cups_lut_t'><tt>cups_lut_t</tt></a></li>
	<li><a href='#cups_rgb_t'><tt>cups_rgb_t</tt></a></li>
	<li><a href='#cups_sample_t'><tt>cups_sample_t</tt></a></li>
</ul>
<!-- NEW PAGE -->
<h3><a name='cups_cmyk_t'>cups_cmyk_t</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Simple CMYK lookup table</p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_cmyk_s'>cups_cmyk_s</a> cups_cmyk_t;
</pre>
<!-- NEW PAGE -->
<h3><a name='cups_dither_t'>cups_dither_t</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Dithering State</p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_dither_s'>cups_dither_s</a> cups_dither_t;
</pre>
<!-- NEW PAGE -->
<h3><a name='cups_lut_t'>cups_lut_t</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Lookup Table for Dithering</p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_lut_s'>cups_lut_s</a> cups_lut_t;
</pre>
<!-- NEW PAGE -->
<h3><a name='cups_rgb_t'>cups_rgb_t</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Color separation lookup table</p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_rgb_s'>cups_rgb_s</a> cups_rgb_t;
</pre>
<!-- NEW PAGE -->
<h3><a name='cups_sample_t'>cups_sample_t</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>Color sample point</p>
<h4>Definition</h4>
<pre>
typedef struct <a href='#cups_sample_s'>cups_sample_s</a> cups_sample_t;
</pre>
<!-- NEW PAGE -->
<h2><a name='_variables'>Variables</a></h2>
<ul>
	<li><a href='#cups_scmy_lut[256]'><tt>cups_scmy_lut[256]</tt></a></li>
	<li><a href='#cups_srgb_lut[256]'><tt>cups_srgb_lut[256]</tt></a></li>
</ul>
<!-- NEW PAGE -->
<h3><a name='cups_scmy_lut[256]'>cups_scmy_lut[256]</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>sRGB gamma lookup table (inverted)</p>
<h4>Definition</h4>
<pre>
extern const unsigned char cups_scmy_lut[256];
</pre>
<!-- NEW PAGE -->
<h3><a name='cups_srgb_lut[256]'>cups_srgb_lut[256]</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>sRGB gamma lookup table</p>
<h4>Definition</h4>
<pre>
extern const unsigned char cups_srgb_lut[256];
</pre>
</body>
</html>