home *** CD-ROM | disk | FTP | other *** search
/ jppd.dyndns.org / jppd.dyndns.org.tar / jppd.dyndns.org / QUERYPRO / Impressora_PDF / converter.exe / GPLGS / gs_ciecs2.ps < prev    next >
Text File  |  2002-08-23  |  4KB  |  148 lines

  1. %    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
  2. % This software is provided AS-IS with no warranty, either express or
  3. % implied.
  4. % This software is distributed under license and may not be copied,
  5. % modified or distributed except as expressly authorized under the terms
  6. % of the license contained in the file LICENSE in this distribution.
  7. % For more information about licensing, please refer to
  8. % http://www.ghostscript.com/licensing/. For information on
  9. % commercial licensing, go to http://www.artifex.com/licensing/ or
  10. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. % San Rafael, CA  94903, U.S.A., +1(415)492-9861.
  12.  
  13. % $Id: gs_ciecs2.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
  14. % Level 2 CIEBased color space method dictionaries.
  15.  
  16. %
  17. % The validation routines in these method dictionaries perform only
  18. % partial validations; the .setcie* operators will perform the rest.
  19. %
  20.  
  21. % verify that at least one of the CIEBased color spaces is supported
  22. true
  23.   { /.setcieaspace /.setcieabcspace /.setciedefspace /.setciedefgspace }
  24.   {
  25.     where
  26.       { pop not exit }
  27.     if
  28.   }
  29. forall
  30.   { currentfile closefile }
  31. if
  32.  
  33.  
  34. .currentglobal true .setglobal
  35. .cspace_util begin
  36.  
  37. %
  38. %   <obj>   check_cie_cspace   <obj>
  39. %
  40. % Perform a very basic check that an object is a CIEBased color space
  41. % array.
  42. %
  43. /check_cie_cspace
  44.   {
  45.     //check_array exec
  46.     dup 1 get type /dicttype ne
  47.       //setcspace_typecheck
  48.     if
  49.   }
  50. bind def
  51.  
  52.  
  53.  
  54. /.setcieaspace where
  55.   {
  56.     pop
  57.     colorspacedict
  58.     /CIEBasedA
  59.       mark
  60.         /cs_potential_indexed_base true
  61.         /cs_potential_pattern_base true
  62.         /cs_potential_alternate true
  63.         /cs_potential_icc_alternate true
  64.         /cs_get_ncomps //ncomps_1
  65.  
  66.         /cs_get_range
  67.           {
  68.             1 get /RangeA .knownget not
  69.               { //dflt_range_1 }
  70.             if
  71.           }
  72.         bind
  73.  
  74.         /cs_get_default_color { pop 0 } bind
  75.         /cs_get_currentgray //no_currentgray
  76.         /cs_get_currentrgb //no_currentrgb
  77.         /cs_get_currentcmyk //no_currentcmyk
  78.         /cs_validate //check_cie_cspace
  79.         /cs_substitute //dup_1
  80.         /cs_prepare {}
  81.  
  82.         /cs_install
  83.           {
  84.             NOCIE
  85.               { pop /DeviceGray //.cs_install exec }
  86.               { 1 get .setcieaspace }
  87.             ifelse
  88.           }
  89.         bind
  90.  
  91.         /cs_prepare_color //validate_1
  92.         /cs_complete_setcolor //pop_1
  93.       .dicttomark
  94.     put
  95.   }
  96. if
  97.  
  98. /.setcieabcspace where
  99.   {
  100.     pop
  101.     colorspacedict
  102.     /CIEBasedABC
  103.       mark
  104.         /cs_potential_indexed_base true
  105.         /cs_potential_pattern_base true
  106.         /cs_potential_alternate true
  107.         /cs_potential_icc_alternate true
  108.         /cs_get_ncomps //ncomps_3
  109.  
  110.         /cs_get_range
  111.           {
  112.             1 get /RangeABC .knownget not
  113.               { //dflt_range_3 }
  114.             if
  115.           }
  116.         bind
  117.  
  118.         /cs_get_default_color { pop 0 0 0 } bind
  119.         /cs_get_currentgray //no_currentgray
  120.         /cs_get_currentrgb //no_currentrgb
  121.         /cs_get_currentcmyk //no_currentcmyk
  122.         /cs_validate //check_cie_cspace
  123.         /cs_substitute //dup_1
  124.         /cs_prepare {}
  125.  
  126.         /cs_install
  127.           {
  128.             NOCIE
  129.               { pop /DeviceRGB //.cs_install exec }
  130.               { 1 get .setcieabcspace }
  131.             ifelse
  132.           }
  133.         bind
  134.  
  135.         /cs_prepare_color //validate_3
  136.         /cs_complete_setcolor //pop_1
  137.       .dicttomark
  138.     put
  139.   }
  140. if
  141.  
  142.  
  143. end     % .cspace_util
  144. .setglobal
  145.