1
0

gs_devpxl.ps 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_devpxl.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
  16. % DevicePixel color space method dictionaries.
  17. %
  18. % This file implements the DevicePixel color space. See gs_cspace.ps
  19. % for information.
  20. %
  21. % The DevicePixel color space includes a single parameter, the bit
  22. % depth of the device color representation. Color is expressed as
  23. % single integers in an opaque, device-specific format.
  24. %
  25. % verify that the DevicePixel color space is supported
  26. /.setdevicepixelspace where
  27. { pop }
  28. { currentfile closefile }
  29. ifelse
  30. .currentglobal true .setglobal
  31. .cspace_util begin
  32. colorspacedict
  33. /DevicePixel
  34. mark
  35. /cs_potential_indexed_base true
  36. /cs_potential_pattern_base true
  37. /cs_potential_alternate true
  38. /cs_potential_icc_alternate true
  39. /cs_get_ncomps //ncomps_1
  40. /cs_get_range { [ exch 1 get 1 exch bitshift 1 sub ] } bind
  41. /cs_get_default_color { pop 0 } bind % no good default
  42. /cs_get_currentgray //no_currentgray
  43. /cs_get_currentrgb //no_currentrgb
  44. /cs_get_currentcmyk //no_currentcmyk
  45. /cs_validate
  46. {
  47. //check_array exec
  48. dup 1 get dup type /integertype ne
  49. //setcspace_typecheck
  50. if
  51. dup 0 lt
  52. //setcspace_rangecheck
  53. if
  54. 31 gt % 31 bits is an implementation limit
  55. { /setcolorspace cvx /limitcheck signalerror }
  56. if
  57. }
  58. bind
  59. /cs_substitute //dup_1
  60. /cs_prepare {}
  61. /cs_install { .setdevicepixelspace } bind
  62. /cs_prepare_color //validate_1
  63. /cs_complete_setcolor //pop_1
  64. .dicttomark
  65. put
  66. end % .cspace_util
  67. .setglobal