2 %%Creator: (ImageMagick)
4 %%CreationDate: (2016-03-09T10:39:25+01:00)
5 %%BoundingBox: -0 -0 1855 1176
6 %%HiResBoundingBox: 0 0 1855 1176
7 %%DocumentData: Clean7Bit
9 %%Orientation: Portrait
19 % Display a color image. The image is displayed in color on
20 % Postscript viewers or printers that support color, otherwise
21 % it is displayed as grayscale.
26 % Get a DirectClass packet.
32 % length: number of pixels minus one of this color (optional).
34 currentfile color_packet readhexstring pop pop
40 currentfile byte readhexstring pop 0 get
41 /number_pixels exch 1 add 3 mul def
43 0 3 number_pixels 1 sub
45 pixels exch color_packet putinterval
47 pixels 0 number_pixels getinterval
53 % Display a DirectClass image.
55 systemdict /colorimage known
62 { DirectClassPacket } false 3 colorimage
66 % No colorimage operator; convert to grayscale.
73 { GrayDirectClassPacket } image
77 /GrayDirectClassPacket
80 % Get a DirectClass packet; convert to grayscale.
86 % length: number of pixels minus one of this color (optional).
88 currentfile color_packet readhexstring pop pop
89 color_packet 0 get 0.299 mul
90 color_packet 1 get 0.587 mul add
91 color_packet 2 get 0.114 mul add
99 currentfile byte readhexstring pop 0 get
100 /number_pixels exch 1 add def
102 0 1 number_pixels 1 sub
104 pixels exch gray_packet put
106 pixels 0 number_pixels getinterval
109 /GrayPseudoClassPacket
112 % Get a PseudoClass packet; convert to grayscale.
115 % index: index into the colormap.
116 % length: number of pixels minus one of this color (optional).
118 currentfile byte readhexstring pop 0 get
119 /offset exch 3 mul def
120 /color_packet colormap offset 3 getinterval def
121 color_packet 0 get 0.299 mul
122 color_packet 1 get 0.587 mul add
123 color_packet 2 get 0.114 mul add
125 /gray_packet exch def
131 currentfile byte readhexstring pop 0 get
132 /number_pixels exch 1 add def
134 0 1 number_pixels 1 sub
136 pixels exch gray_packet put
138 pixels 0 number_pixels getinterval
144 % Get a PseudoClass packet.
147 % index: index into the colormap.
148 % length: number of pixels minus one of this color (optional).
150 currentfile byte readhexstring pop 0 get
151 /offset exch 3 mul def
152 /color_packet colormap offset 3 getinterval def
158 currentfile byte readhexstring pop 0 get
159 /number_pixels exch 1 add 3 mul def
161 0 3 number_pixels 1 sub
163 pixels exch color_packet putinterval
165 pixels 0 number_pixels getinterval
171 % Display a PseudoClass image.
174 % class: 0-PseudoClass or 1-Grayscale.
176 currentfile buffer readline pop
177 token pop /class exch def pop
180 currentfile buffer readline pop
181 token pop /depth exch def pop
182 /grays columns 8 add depth sub depth mul 8 idiv string def
188 { currentfile grays readhexstring pop } image
193 % colors: number of colors in the colormap.
194 % colormap: red, green, blue color packets.
196 currentfile buffer readline pop
197 token pop /colors exch def pop
198 /colors colors 3 mul def
199 /colormap colors string def
200 currentfile colormap readhexstring pop pop
201 systemdict /colorimage known