247
246
/* Exit if we have already installed this color space. */
248
247
if (pcs->pclient_color_space_data != NULL)
252
251
* Get the character string and length for the component name.
254
253
pcs->params.separation.get_colorname_string(dev->memory, name,
257
256
* Compare the colorant name to those in our PANTONE color list.
259
258
for (pan_index = 0; pan_index < num_pantone_colors ; pan_index++) {
260
const char * pan_name = pantone_list[pan_index].name;
259
const char * pan_name = pantone_list[pan_index].name;
262
if (compare_names(pname, name_size, pan_name, strlen(pan_name))) {
263
use_custom_color_callback = true;
261
if (compare_names(pname, name_size, pan_name, strlen(pan_name))) {
262
use_custom_color_callback = true;
268
267
if (use_custom_color_callback) {
269
268
demo_color_space_data_t * pclient_data =
270
allocate_client_data_block(1, pcs->rc.memory->stable_memory);
269
allocate_client_data_block(1, pcs->rc.memory->stable_memory);
272
if (pclient_data == NULL)
274
pclient_data->color_index[0] = pan_index;
271
if (pclient_data == NULL)
273
pclient_data->color_index[0] = pan_index;
275
274
pcs->pclient_color_space_data =
276
(client_color_space_data_t *) pclient_data;
275
(client_color_space_data_t *) pclient_data;
278
277
return use_custom_color_callback;
312
311
/* Exit if we have already installed this color space. */
313
312
if (pcs->pclient_color_space_data != NULL)
317
316
* Now check the names of the color components.
319
318
for(i = 0; i < num_comp; i++ ) {
323
* Get the character string and length for the component name.
325
pcs->params.device_n.get_colorname_string(dev->memory, names[i],
322
* Get the character string and length for the component name.
324
pcs->params.device_n.get_colorname_string(dev->memory, names[i],
328
327
* Postscript does not include /None as a color component but it is
329
328
* allowed in PDF so we accept it. We simply skip components named
332
if (compare_names(none_str, none_size, pname, name_size)) {
333
pantone_color_index[i] = PANTONE_NONE;
337
* Check if our color space includes the CMYK process colors.
339
if (compare_names(cyan_str, cyan_size, pname, name_size)) {
340
pantone_color_index[i] = PANTONE_CYAN;
343
if (compare_names(magenta_str, magenta_size, pname, name_size)) {
344
pantone_color_index[i] = PANTONE_MAGENTA;
347
if (compare_names(yellow_str, yellow_size, pname, name_size)) {
348
pantone_color_index[i] = PANTONE_YELLOW;
351
if (compare_names(black_str, black_size, pname, name_size)) {
352
pantone_color_index[i] = PANTONE_BLACK;
356
* Compare the colorant name to those in our Pantone color list.
358
for (pan_index = 0; pan_index < num_pantone_colors ; pan_index++) {
359
const char * pan_name = pantone_list[pan_index].name;
331
if (compare_names(none_str, none_size, pname, name_size)) {
332
pantone_color_index[i] = PANTONE_NONE;
336
* Check if our color space includes the CMYK process colors.
338
if (compare_names(cyan_str, cyan_size, pname, name_size)) {
339
pantone_color_index[i] = PANTONE_CYAN;
342
if (compare_names(magenta_str, magenta_size, pname, name_size)) {
343
pantone_color_index[i] = PANTONE_MAGENTA;
346
if (compare_names(yellow_str, yellow_size, pname, name_size)) {
347
pantone_color_index[i] = PANTONE_YELLOW;
350
if (compare_names(black_str, black_size, pname, name_size)) {
351
pantone_color_index[i] = PANTONE_BLACK;
355
* Compare the colorant name to those in our Pantone color list.
357
for (pan_index = 0; pan_index < num_pantone_colors ; pan_index++) {
358
const char * pan_name = pantone_list[pan_index].name;
361
if (compare_names(pname, name_size, pan_name, strlen(pan_name))) {
362
pantone_color_index[i] = pan_index;
363
match = pantone_found = true;
367
if (!match) { /* Exit if we find a non Pantone color */
368
other_separation_found = true;
360
if (compare_names(pname, name_size, pan_name, strlen(pan_name))) {
361
pantone_color_index[i] = pan_index;
362
match = pantone_found = true;
366
if (!match) { /* Exit if we find a non Pantone color */
367
other_separation_found = true;
373
372
* Handle this color space as a 'pantone color space' if we have only
515
512
convert_intensity_into_device_color(const frac intensity,
516
gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
517
gs_color_select_t select)
513
gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
514
gs_color_select_t select)
519
516
frac cc, cm, cy, ck;
521
switch (pis->object_tag) {
522
case GS_TEXT_TAG: /* Make text red. */
524
cm = cy = frac_1 - intensity;
526
case GS_IMAGE_TAG: /* Make images green. */
528
cc = cy = frac_1 - intensity;
530
case GS_PATH_TAG: /* Make lines and fills blue. */
533
cc = cm = frac_1 - intensity;
518
switch (dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS) {
519
case GS_TEXT_TAG: /* Make text red. */
521
cm = cy = frac_1 - intensity;
523
case GS_IMAGE_TAG: /* Make images green. */
525
cc = cy = frac_1 - intensity;
527
case GS_PATH_TAG: /* Make lines and fills blue. */
530
cc = cm = frac_1 - intensity;
537
534
/* Send CMYK colors to the device */
548
545
const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
551
#if OBJECT_TYPE_EXAMPLE
553
/* For demo and debug purposes, make our colors a function of the
554
* intensity of the given colors and the object type. */
556
frac intensity = pconc[0];
557
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
561
/* If desired, replace with your own color transformation */
563
gx_remap_concrete_gray(pconc[0], pdc, pis, dev, select);
548
#if OBJECT_TYPE_EXAMPLE
550
/* For demo and debug purposes, make our colors a function of the
551
* intensity of the given colors and the object type. */
553
frac intensity = pconc[0];
554
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
558
/* If desired, replace with your own color transformation */
560
gx_remap_concrete_gray(pconc[0], pdc, pis, dev, select);
587
583
client_remap_DeviceRGB(client_custom_color_params_t * pparams,
588
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
589
const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
584
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
585
const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
592
#if OBJECT_TYPE_EXAMPLE
594
/* For demo and debug purposes, make our colors a function of the
595
* intensity of the given colors and the object type. */
597
frac intensity = (frac)(pconc[0] * 0.30 + pconc[1] * 0.59 + pconc[2] * 0.11);
598
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
602
/* If desired, replace with your own color transformation */
604
gx_remap_concrete_rgb(pconc[0], pconc[1], pconc[2], pdc, pis, dev, select);
588
#if OBJECT_TYPE_EXAMPLE
590
/* For demo and debug purposes, make our colors a function of the
591
* intensity of the given colors and the object type. */
593
frac intensity = (frac)(pconc[0] * 0.30 + pconc[1] * 0.59 + pconc[2] * 0.11);
594
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
598
/* If desired, replace with your own color transformation */
600
gx_remap_concrete_rgb(pconc[0], pconc[1], pconc[2], pdc, pis, dev, select);
626
622
client_remap_DeviceCMYK(client_custom_color_params_t * pparams,
627
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
628
const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
623
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
624
const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
631
#if OBJECT_TYPE_EXAMPLE
634
* For demo and debug purposes, make our colors a function of the
635
* intensity of the given colors and the object type. */
637
frac intensity = frac_1 - (frac)(pconc[0] * 0.30 + pconc[1] * 0.59
638
+ pconc[2] * 0.11 + pconc[3]);
640
if (intensity < frac_0)
642
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
646
/* If desired, replace with your own color transformation */
647
gx_remap_concrete_cmyk(pconc[0], pconc[1], pconc[2], pconc[3],pdc, pis, dev, select);
627
#if OBJECT_TYPE_EXAMPLE
630
* For demo and debug purposes, make our colors a function of the
631
* intensity of the given colors and the object type. */
633
frac intensity = frac_1 - (frac)(pconc[0] * 0.30 + pconc[1] * 0.59
634
+ pconc[2] * 0.11 + pconc[3]);
636
if (intensity < frac_0)
638
convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
642
/* If desired, replace with your own color transformation */
643
gx_remap_concrete_cmyk(pconc[0], pconc[1], pconc[2], pconc[3],pdc, pis, dev, select);
656
652
* given a specified floating point range.
658
654
#define convert2frac(color, range) \
659
(color <= range.rmin) ? frac_0 \
660
: (color >= range.rmax) ? frac_1 \
662
(color - range.rmin) / (range.rmax - range.rmin))
655
(color <= range.rmin) ? frac_0 \
656
: (color >= range.rmax) ? frac_1 \
658
(color - range.rmin) / (range.rmax - range.rmin))
665
661
client_install_CIEtoA(client_custom_color_params_t * pparams,
666
gs_color_space * pcs, gs_state * pgs)
662
gs_color_space * pcs, gs_state * pgs)
668
664
/* get ready for converting to XYZ */
669
665
demo_color_space_data_t * pdata;
671
667
/* Exit if we have already installed this color space. */
672
668
if (pcs->pclient_color_space_data != NULL)
675
671
pdata = allocate_client_data_block(1, pcs->rc.memory->stable_memory);
676
672
pcs->pclient_color_space_data = (client_color_space_data_t *) pdata;
680
gs_cie_a *pcie = pcs->params.a;
681
gs_sample_loop_params_t lp;
684
pdata->client_is_going_to_handle_color_space = 1;
686
/* Fill the caches we need in the CIE color space */
687
gs_cie_cache_init(&pcie->caches.DecodeA.floats.params, &lp,
688
&pcie->RangeA, "DecodeA");
689
for (i = 0; i <= lp.N; ++i) {
690
float in = SAMPLE_LOOP_VALUE(i, lp);
692
pcie->caches.DecodeA.floats.values[i] = (*pcie->DecodeA)(in, pcie);
694
gx_cie_load_common_cache(&pcie->common, pgs);
695
gs_cie_a_complete(pcie);
696
if ((code=gs_cie_cs_complete(pgs, true)) >= 0) {
697
/* Now allocate the conversion imager state in stable_memory */
698
/* so that the garbage collector won't free it */
699
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
700
pcs->rc.memory->stable_memory);
703
client_adjust_cspace_count(pcs, -1); /* free it up */
676
gs_cie_a *pcie = pcs->params.a;
677
gs_sample_loop_params_t lp;
680
pdata->client_is_going_to_handle_color_space = 1;
682
/* Fill the caches we need in the CIE color space */
683
gs_cie_cache_init(&pcie->caches.DecodeA.floats.params, &lp,
684
&pcie->RangeA, "DecodeA");
685
for (i = 0; i <= lp.N; ++i) {
686
float in = SAMPLE_LOOP_VALUE(i, lp);
688
pcie->caches.DecodeA.floats.values[i] = (*pcie->DecodeA)(in, pcie);
690
gx_cie_load_common_cache(&pcie->common, pgs);
691
gs_cie_a_complete(pcie);
692
if ((code=gs_cie_cs_complete(pgs, true)) >= 0) {
693
/* Now allocate the conversion imager state in stable_memory */
694
/* so that the garbage collector won't free it */
695
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
696
pcs->rc.memory->stable_memory);
699
client_adjust_cspace_count(pcs, -1); /* free it up */
711
707
client_install_CIEtoXYZ(client_custom_color_params_t * pparams,
712
gs_color_space * pcs, gs_state * pgs)
708
gs_color_space * pcs, gs_state * pgs)
714
710
/* get ready for converting to XYZ */
715
711
demo_color_space_data_t * pdata;
717
713
/* Exit if we have already installed this color space. */
718
714
if (pcs->pclient_color_space_data != NULL)
721
717
pdata = allocate_client_data_block(1, pcs->rc.memory->stable_memory);
722
718
pcs->pclient_color_space_data = (client_color_space_data_t *) pdata;
726
const gs_cie_abc *pcie;
722
const gs_cie_abc *pcie;
728
pdata->client_is_going_to_handle_color_space = 1;
724
pdata->client_is_going_to_handle_color_space = 1;
729
725
switch (pcs->type->index) {
730
case gs_color_space_index_CIEDEF: {
731
gs_cie_def *pcie_def = pcs->params.def;
733
pcie = (gs_cie_abc *)pcie_def;
734
CIE_LOAD_CACHE_BODY(pcie_def->caches_def.DecodeDEF, pcie_def->RangeDEF.ranges,
735
&pcie_def->DecodeDEF, DecodeDEF_default, pcie_def,
739
case gs_color_space_index_CIEDEFG: {
740
gs_cie_defg *pcie_defg = pcs->params.defg;
742
pcie = (gs_cie_abc *)pcie_defg;
743
CIE_LOAD_CACHE_BODY(pcie_defg->caches_defg.DecodeDEFG, pcie_defg->RangeDEFG.ranges,
744
&pcie_defg->DecodeDEFG, DecodeDEFG_default, pcie_defg,
748
case gs_color_space_index_CIEABC: {
749
pcie = pcs->params.abc;
753
/* can't happen since we only come here for certain color spaces */
756
/* Fill the caches we need in the CIE color space */
726
case gs_color_space_index_CIEDEF: {
727
gs_cie_def *pcie_def = pcs->params.def;
729
pcie = (gs_cie_abc *)pcie_def;
730
CIE_LOAD_CACHE_BODY(pcie_def->caches_def.DecodeDEF, pcie_def->RangeDEF.ranges,
731
&pcie_def->DecodeDEF, DecodeDEF_default, pcie_def,
735
case gs_color_space_index_CIEDEFG: {
736
gs_cie_defg *pcie_defg = pcs->params.defg;
738
pcie = (gs_cie_abc *)pcie_defg;
739
CIE_LOAD_CACHE_BODY(pcie_defg->caches_defg.DecodeDEFG, pcie_defg->RangeDEFG.ranges,
740
&pcie_defg->DecodeDEFG, DecodeDEFG_default, pcie_defg,
744
case gs_color_space_index_CIEABC: {
745
pcie = pcs->params.abc;
749
/* can't happen since we only come here for certain color spaces */
752
/* Fill the caches we need in the CIE color space */
757
753
if ((code=gx_install_cie_abc((gs_cie_abc *)pcie, pgs)) >= 0) {
758
/* Now allocate the conversion imager state in stable_memory */
759
/* so that the garbage collector won't free it */
760
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
761
pcs->rc.memory->stable_memory);
764
client_adjust_cspace_count(pcs, -1); /* free it up */
754
/* Now allocate the conversion imager state in stable_memory */
755
/* so that the garbage collector won't free it */
756
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
757
pcs->rc.memory->stable_memory);
760
client_adjust_cspace_count(pcs, -1); /* free it up */
773
768
client_install_ICCtoXYZ(client_custom_color_params_t * pparams,
774
gs_color_space * pcs, gs_state * pgs)
769
gs_color_space * pcs, gs_state * pgs)
777
772
const gs_icc_params * picc_params = (const gs_icc_params *)&pcs->params.icc;
779
774
demo_color_space_data_t * pdata;
781
776
if (pcs->pclient_color_space_data != NULL)
784
779
pdata = allocate_client_data_block(1, pcs->rc.memory->stable_memory);
785
780
pcs->pclient_color_space_data = (client_color_space_data_t *) pdata;
787
/* Need to initialize the client data. The imager_state is what is needed in pdata->CIEtoXZY_ps */
782
/* Need to initialize the client data. The imager_state is what is needed in pdata->CIEtoXZY_ps */
789
784
/* update the stub information used by the joint caches */
790
785
gx_cie_load_common_cache(&picc_info->common, pgs);
791
786
gx_cie_common_complete(&picc_info->common);
793
788
if ((code=gs_cie_cs_complete(pgs, true)) < 0) {
794
client_adjust_cspace_count(pcs, -1); /* free it up */
789
client_adjust_cspace_count(pcs, -1); /* free it up */
798
/* Now allocate the conversion imager state in stable_memory */
799
/* so that the garbage collector won't free it */
800
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
801
pcs->rc.memory->stable_memory);
793
/* Now allocate the conversion imager state in stable_memory */
794
/* so that the garbage collector won't free it */
795
code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
796
pcs->rc.memory->stable_memory);
804
client_adjust_cspace_count(pcs, -1); /* free it up */
799
client_adjust_cspace_count(pcs, -1); /* free it up */
813
807
* Convert a CIEBasedA color into device color.
819
813
gs_color_select_t select)
821
815
demo_color_space_data_t * pdata =
822
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
816
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
823
817
frac gray = convert2frac(pc->paint.values[0], pcs->params.a->RangeA);
825
819
/*** Demonstrate method to convert to XYZ ***/
826
820
if (pdata->CIEtoXYZ_pis) {
829
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
830
/* We don't really do anything with these values, but this */
831
/* is where a real client could convert to a device color */
832
if_debug4('|', "[c]client_remap CIEA [%g] -> XYZ [%g, %g, %g]\n",
834
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
823
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
824
/* We don't really do anything with these values, but this */
825
/* is where a real client could convert to a device color */
826
if_debug4('|', "[c]client_remap CIEA [%g] -> XYZ [%g, %g, %g]\n",
828
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
851
845
gs_color_select_t select)
853
847
demo_color_space_data_t * pdata =
854
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
848
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
858
852
/*** Demonstrate method to convert to XYZ ***/
859
853
if (pdata->CIEtoXYZ_pis) {
862
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
863
/* We don't really do anything with these values, but this */
864
/* is where a real client could convert to a device color */
865
if_debug6('|', "[c]client_remap CIEABC [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
866
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
867
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
856
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
857
/* We don't really do anything with these values, but this */
858
/* is where a real client could convert to a device color */
859
if_debug6('|', "[c]client_remap CIEABC [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
860
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
861
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
870
864
* For demo and debug purposes, make our colors a function of the
888
882
gs_color_select_t select)
890
884
demo_color_space_data_t * pdata =
891
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
885
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
895
889
/*** Demonstrate method to convert to XYZ ***/
896
890
if (pdata->CIEtoXYZ_pis) {
899
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
900
/* We don't really do anything with these values, but this */
901
/* is where a real client could convert to a device color */
902
if_debug6('|', "[c]client_remap CIEDEF [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
903
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
904
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
893
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
894
/* We don't really do anything with these values, but this */
895
/* is where a real client could convert to a device color */
896
if_debug6('|', "[c]client_remap CIEDEF [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
897
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
898
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
907
901
* For demo and debug purposes, make our colors a function of the
925
919
gs_color_select_t select)
927
921
demo_color_space_data_t * pdata =
928
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
922
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
932
926
/*** Demonstrate method to convert to XYZ ***/
933
927
if (pdata->CIEtoXYZ_pis) {
936
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
937
/* We don't really do anything with these values, but this */
938
/* is where a real client could convert to a device color */
939
if_debug7('|', "[c]client_remap CIEDEFG [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
940
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
942
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
930
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
931
/* We don't really do anything with these values, but this */
932
/* is where a real client could convert to a device color */
933
if_debug7('|', "[c]client_remap CIEDEFG [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
934
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
936
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
945
939
* For demo and debug purposes, make our colors a function of the
963
957
gs_color_select_t select)
965
959
demo_color_space_data_t * pdata =
966
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
960
(demo_color_space_data_t *)(pcs->pclient_color_space_data);
967
961
frac frac_color[GS_CLIENT_COLOR_MAX_COMPONENTS];
968
962
int i, num_values = pcs->params.icc.picc_info->num_components;
970
964
/*** Demonstrate method to convert to XYZ ***/
971
965
if (pdata->CIEtoXYZ_pis) {
975
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
976
/* We don't really do anything with these values, but this */
977
/* is where a real client could convert to a device color */
978
if_debug6('|', "[c]client_remap ICCBased [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
979
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
980
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
969
cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
970
/* We don't really do anything with these values, but this */
971
/* is where a real client could convert to a device color */
972
if_debug6('|', "[c]client_remap ICCBased [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
973
pc->paint.values[0], pc->paint.values[1], pc->paint.values[2],
974
frac2float(xyz[0]), frac2float(xyz[1]), frac2float(xyz[2]));
988
982
* gray, RGB, or CMYK values.
990
984
for (i = 0; i < num_values; i++)
991
frac_color[i] = convert2frac(pc->paint.values[i],
992
pcs->params.icc.picc_info->Range.ranges[i]);
985
frac_color[i] = convert2frac(pc->paint.values[i],
986
pcs->params.icc.picc_info->Range.ranges[i]);
993
987
switch (num_values) {
996
return_error(gs_error_rangecheck);
998
return client_remap_DeviceGray(pparams, frac_color, pcs,
999
pdc, pis, dev, select);
1001
return client_remap_DeviceRGB(pparams, frac_color, pcs,
1002
pdc, pis, dev, select);
1005
return client_remap_DeviceCMYK(pparams, frac_color, pcs,
1006
pdc, pis, dev, select);
990
return_error(gs_error_rangecheck);
992
return client_remap_DeviceGray(pparams, frac_color, pcs,
993
pdc, pis, dev, select);
995
return client_remap_DeviceRGB(pparams, frac_color, pcs,
996
pdc, pis, dev, select);
999
return client_remap_DeviceCMYK(pparams, frac_color, pcs,
1000
pdc, pis, dev, select);
1014
1008
#if PANTONE_ONLY
1017
* For PANTONE colors, we only need to handle Separation and DeviceN
1018
* color spaces. These are the only color spaces that can have PANTONE
1021
client_custom_color_procs_t demo_procs = {
1022
client_install_no_op, /* DeviceGray */
1024
client_install_no_op, /* DeviceRGB */
1026
client_install_no_op, /* DeviceCMYK */
1028
client_pantone_install_Separation, /* Separation */
1029
client_pantone_remap_Separation,
1030
client_pantone_install_DeviceN, /* DeviceN */
1031
client_pantone_remap_DeviceN,
1032
client_install_no_op, /* CIEBasedA */
1034
client_install_no_op, /* CIEBasedABC */
1036
client_install_no_op, /* CIEBasedDEF */
1038
client_install_no_op, /* CIEBasedDEFG */
1040
client_install_no_op, /* ICCBased */
1011
* For PANTONE colors, we only need to handle Separation and DeviceN
1012
* color spaces. These are the only color spaces that can have PANTONE
1015
client_custom_color_procs_t demo_procs = {
1016
client_install_no_op, /* DeviceGray */
1018
client_install_no_op, /* DeviceRGB */
1020
client_install_no_op, /* DeviceCMYK */
1022
client_pantone_install_Separation, /* Separation */
1023
client_pantone_remap_Separation,
1024
client_pantone_install_DeviceN, /* DeviceN */
1025
client_pantone_remap_DeviceN,
1026
client_install_no_op, /* CIEBasedA */
1028
client_install_no_op, /* CIEBasedABC */
1030
client_install_no_op, /* CIEBasedDEF */
1032
client_install_no_op, /* CIEBasedDEFG */
1034
client_install_no_op, /* ICCBased */
1044
1038
#else /* Not PANTONE_ONLY special */