gs_ciecs3.ps 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. % Copyright (C) 2002 Aladdin Enterprises. All rights reserved.
  2. %
  3. % This software is provided AS-IS with no warranty, either express or
  4. % implied.
  5. %
  6. % This software is distributed under license and may not be copied,
  7. % modified or distributed except as expressly authorized under the terms
  8. % of the license contained in the file LICENSE in this distribution.
  9. %
  10. % For more information about licensing, please refer to
  11. % http://www.ghostscript.com/licensing/. For information on
  12. % commercial licensing, go to http://www.artifex.com/licensing/ or
  13. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  14. % San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  15. % $Id: gs_ciecs3.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
  16. % Level 3 CIEBased color space method dictionaries.
  17. % This assumes gs_ciecs2.ps has already been processed.
  18. %
  19. % The validation routines in these method dictionaries perform only
  20. % partial validations; the .setcie* operators will perform the rest.
  21. %
  22. .currentglobal true .setglobal
  23. .cspace_util begin
  24. /.setciedefspace where
  25. {
  26. pop
  27. colorspacedict
  28. /CIEBasedDEF
  29. mark
  30. /cs_potential_indexed_base true
  31. /cs_potential_pattern_base true
  32. /cs_potential_alternate true
  33. /cs_potential_icc_alternate true
  34. /cs_get_ncomps //ncomps_3
  35. /cs_get_range
  36. {
  37. 1 get /RangeDEF .knownget not
  38. { //dflt_range_3 }
  39. if
  40. }
  41. bind
  42. /cs_get_default_color { pop 0 0 0 } bind
  43. /cs_get_currentgray //no_currentgray
  44. /cs_get_currentrgb //no_currentrgb
  45. /cs_get_currentcmyk //no_currentcmyk
  46. /cs_validate //check_cie_cspace
  47. /cs_substitute //dup_1
  48. /cs_prepare {}
  49. /cs_install
  50. {
  51. NOCIE
  52. { pop /DeviceRGB //.cs_install exec }
  53. { 1 get .setciedefspace }
  54. ifelse
  55. }
  56. bind
  57. /cs_prepare_color //validate_3
  58. /cs_complete_setcolor //pop_1
  59. .dicttomark
  60. put
  61. }
  62. if
  63. /.setciedefgspace where
  64. {
  65. pop
  66. colorspacedict
  67. /CIEBasedDEFG
  68. mark
  69. /cs_potential_indexed_base true
  70. /cs_potential_pattern_base true
  71. /cs_potential_alternate true
  72. /cs_potential_icc_alternate true
  73. /cs_get_ncomps //ncomps_4
  74. /cs_get_range
  75. {
  76. 1 get /RangeDEFG .knownget not
  77. { //dflt_range_4 }
  78. if
  79. }
  80. bind
  81. /cs_get_default_color { pop 0 0 0 0 } bind
  82. /cs_get_currentgray //no_currentgray
  83. /cs_get_currentrgb //no_currentrgb
  84. /cs_get_currentcmyk //no_currentcmyk
  85. /cs_validate //check_cie_cspace
  86. /cs_substitute //dup_1
  87. /cs_prepare {}
  88. % the use of the DeviceCMYK color space is questionable:
  89. % it will likely have the wrong polarity
  90. /cs_install
  91. {
  92. NOCIE
  93. { pop /DeviceCMYK //.cs_install exec }
  94. { 1 get .setciedefgspace }
  95. ifelse
  96. }
  97. bind
  98. /cs_prepare_color //validate_4
  99. /cs_complete_setcolor //pop_1
  100. .dicttomark
  101. put
  102. }
  103. if
  104. end % .cspace_util
  105. .setglobal