~ubuntu-branches/ubuntu/oneiric/ghostscript/oneiric

« back to all changes in this revision

Viewing changes to lib/viewrgb.ps

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-07-15 16:49:55 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715164955-uga6qibao6kez05c
Tags: 9.04~dfsg~20110715-0ubuntu1
* New upstream release
   - GIT snapshot from Jult, 12 2011.
* debian/patches/020110406~a54df2d.patch,
  debian/patches/020110408~0791cc8.patch,
  debian/patches/020110408~507cbee.patch,
  debian/patches/020110411~4509a49.patch,
  debian/patches/020110412~78bb9a6.patch,
  debian/patches/020110418~a05ab8a.patch,
  debian/patches/020110420~20b6c78.patch,
  debian/patches/020110420~4ddefa2.patch: Removed upstream patches.
* debian/rules: Generate ABI version number (variable "abi") correctly,
  cutting off repackaging and pre-release parts.
* debian/rules: Added ./lcms2/ directory to DEB_UPSTREAM_REPACKAGE_EXCLUDES.
* debian/copyright: Added lcms2/* to the list of excluded files.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%    Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
2
 
 
2
%
3
3
% This software is provided AS-IS with no warranty, either express or
4
4
% implied.
5
 
 
5
%
6
6
% This software is distributed under license and may not be copied, modified
7
7
% or distributed except as expressly authorized under the terms of that
8
8
% license.  Refer to licensing information at http://www.artifex.com/
9
9
% or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
10
10
% San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
11
11
 
12
 
% $Id: viewrgb.ps 11603 2010-08-05 19:16:11Z ray $
 
12
% $Id$
13
13
 
14
14
% viewrgb.ps
15
15
% Display a raw RGB file created by  -sDEVICE=bitrgb.
34
34
  } if
35
35
  mul 7 add 8 idiv idiv def
36
36
  QUIET not { (Dimensions: ) print [w h] == flush } if
37
 
                % Set up scaling.
 
37
                % Set up scaling.
38
38
  /SCALE where {
39
39
    pop
40
 
        % Map pixels SCALE-for-1.  Assume orthogonal transformation.
 
40
        % Map pixels SCALE-for-1.  Assume orthogonal transformation.
41
41
    SCALE 1 0 dtransform add abs div
42
42
    SCALE 0 1 dtransform add abs div
43
43
  } {
44
 
        % Scale the image (uniformly) to fit the page.
 
44
        % Scale the image (uniformly) to fit the page.
45
45
    clippath pathbbox pop pop translate
46
46
    pathbbox 3 -1 roll sub h div
47
47
    3 1 roll exch sub w div .min dup
48
48
  } ifelse scale
49
49
  bpc 1 eq {
50
50
    [ /Indexed /DeviceRGB 15 <
51
 
        000000
52
 
        0000FF
53
 
        00FF00
54
 
        00FFFF
55
 
        FF0000
56
 
        FF00FF
57
 
        FFFF00
58
 
        FFFFFF
59
 
        000000
60
 
        0000FF
61
 
        00FF00
62
 
        00FFFF
63
 
        FF0000
64
 
        FF00FF
65
 
        FFFF00
66
 
        FFFFFF
 
51
        000000
 
52
        0000FF
 
53
        00FF00
 
54
        00FFFF
 
55
        FF0000
 
56
        FF00FF
 
57
        FFFF00
 
58
        FFFFFF
 
59
        000000
 
60
        0000FF
 
61
        00FF00
 
62
        00FFFF
 
63
        FF0000
 
64
        FF00FF
 
65
        FFFF00
 
66
        FFFFFF
67
67
      >
68
68
    ] setcolorspace
69
69
    /BPC 4 def                  % change to 4 bit indexed
70
70
  } {
71
71
    bpc 2 eq {
72
72
    [ /Indexed /DeviceRGB 255 <
73
 
        000000 000055 0000AA 0000FF
74
 
        005500 005555 0055AA 0055FF
75
 
        00AA00 00AA55 00AAAA 00AAFF
76
 
        00FF00 00FF55 00FFAA 00FFFF
 
73
        000000 000055 0000AA 0000FF
 
74
        005500 005555 0055AA 0055FF
 
75
        00AA00 00AA55 00AAAA 00AAFF
 
76
        00FF00 00FF55 00FFAA 00FFFF
77
77
        550000 550055 5500AA 5500FF
78
78
        555500 555555 5555AA 5555FF
79
79
        55AA00 55AA55 55AAAA 55AAFF
87
87
        FFAA00 FFAA55 FFAAAA FFAAFF
88
88
        FFFF00 FFFF55 FFFFAA FFFFFF
89
89
 
90
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
91
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
92
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
93
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
94
 
 
95
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
96
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
97
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
98
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
99
 
 
100
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
101
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
102
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
103
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
104
 
 
105
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
106
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
107
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
108
 
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 
 
90
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
91
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
92
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
93
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
94
 
 
95
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
96
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
97
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
98
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
99
 
 
100
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
101
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
102
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
103
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
104
 
 
105
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
106
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
107
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
108
        000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
109
109
      >
110
110
    ] setcolorspace
111
111
    /BPC 8 def                  % change to 4 bit indexed
117
117
  }
118
118
  ifelse
119
119
  <<    /ImageType 1
120
 
        /Width w
121
 
        /Height h
122
 
        /BitsPerComponent BPC
123
 
        /ImageMatrix [1 0 0 -1 0 h]
124
 
        /DataSource f
125
 
        /MultipleDataSources false
126
 
        bpc 4 lt { /Decode [ 0 [ 0 15 255 ] bpc get ] } { /Decode [ 0 1 0 1 0 1 ] } ifelse
 
120
        /Width w
 
121
        /Height h
 
122
        /BitsPerComponent BPC
 
123
        /ImageMatrix [1 0 0 -1 0 h]
 
124
        /DataSource f
 
125
        /MultipleDataSources false
 
126
        bpc 4 lt { /Decode [ 0 [ 0 15 255 ] bpc get ] } { /Decode [ 0 1 0 1 0 1 ] } ifelse
127
127
  >> image
128
128
  showpage
129
129
  f closefile