summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/lib/gs_devpxl.ps
blob: 4f604f5d71197481ac628581eec878bc3deea2fb (plain)
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
%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
% 
% This software is provided AS-IS with no warranty, either express or
% implied.
% 
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
% 
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA  94903, U.S.A., +1(415)492-9861.

% $Id: gs_devpxl.ps 6300 2005-12-28 19:56:24Z giles $
% DevicePixel color space method dictionaries.

%
% This file implements the DevicePixel color space. See gs_cspace.ps
% for information.
%
% The DevicePixel color space includes a single parameter, the bit
% depth of the device color representation. Color is expressed as
% single integers in an opaque, device-specific format.
%

% verify that the DevicePixel color space is supported
/.setdevicepixelspace where
  { pop }
  { currentfile closefile }
ifelse


.currentglobal true .setglobal

.cspace_util begin


colorspacedict
/DevicePixel
  mark
    /cs_potential_indexed_base true
    /cs_potential_pattern_base true
    /cs_potential_alternate true
    /cs_potential_icc_alternate true
    /cs_get_ncomps //ncomps_1
    /cs_get_range { [ exch 1 get 1 exch bitshift 1 sub ] } bind
    /cs_get_default_color { pop 0 } bind    % no good default
    /cs_get_currentgray //no_currentgray
    /cs_get_currentrgb //no_currentrgb
    /cs_get_currentcmyk //no_currentcmyk

    /cs_validate
      {
        //check_array exec
        dup 1 get dup type /integertype ne
          //setcspace_typecheck
        if
        dup 0 lt
          //setcspace_rangecheck
        if
        31 gt   % 31 bits is an implementation limit
          { /setcolorspace .systemvar /limitcheck signalerror }
        if
      }
    bind

    /cs_substitute //dup_1
    /cs_prepare {}
    /cs_install { .setdevicepixelspace } bind
    /cs_prepare_color //validate_1
    /cs_complete_setcolor //pop_1
  .dicttomark
put

end     % .cspace_util
.setglobal