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