1804
|
1 |
"{ Package: 'stx:libview2' }"
|
|
2 |
|
|
3 |
ImageReader subclass:#PICTReader
|
1806
|
4 |
instanceVariableNames:'currentOpcode rowBytes bounds srcRect dstRect mode ctSeed ctFlags
|
|
5 |
ctSize ctTable packType baseAddr pmVersion packSize hRes vRes
|
|
6 |
pixelType pixelSize cmpCount cmpSize planeBytes pmTable
|
|
7 |
pmReserved picSize picFrame picVersion'
|
|
8 |
classVariableNames:'Opcodes'
|
1804
|
9 |
poolDictionaries:''
|
|
10 |
category:'Graphics-Images-Readers'
|
|
11 |
!
|
|
12 |
|
1849
|
13 |
Object subclass:#PICTFrame
|
|
14 |
instanceVariableNames:'image sourceRectangle destinationRectangle mode maskRegion'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
privateIn:PICTReader
|
|
18 |
!
|
|
19 |
|
1804
|
20 |
!PICTReader class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
documentation
|
|
23 |
"
|
1807
|
24 |
this class will eventually provide fnctionality for loading and storing
|
|
25 |
Apple PICT files. (QuickTime).
|
1804
|
26 |
|
1807
|
27 |
WARNING: this is a first sceletton, ported from the AidaWeb PICTReader.
|
1808
|
28 |
The implementation is VERY incomplete - it is provided here to provide a starting
|
|
29 |
point for porters.
|
1804
|
30 |
|
1850
|
31 |
For now, it does read a few sample images from the GFF books example CD.
|
|
32 |
|
1804
|
33 |
[See also:]
|
|
34 |
Image Form Icon
|
|
35 |
BlitImageReader FaceReader JPEGReader GIFReader PBMReader PCXReader
|
|
36 |
ST80FormReader TargaReader TIFFReader WindowsIconReader
|
|
37 |
XBMReader XPMReader XWDReader
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
|
41 |
examples
|
|
42 |
"
|
1849
|
43 |
PICTReader fromFile:'/unsaved2/stefan/nil/home/stefan/dos/winword/shared/ms.pct'
|
|
44 |
PICTReader fromFile:'/phys/exept/tmp/pict/BLK.PCT'
|
|
45 |
PICTReader fromFile:'/phys/exept/tmp/pict/BLU.PCT'
|
|
46 |
PICTReader fromFile:'/phys/exept/tmp/pict/GRN.PCT'
|
|
47 |
PICTReader fromFile:'/phys/exept/tmp/pict/RED.PCT'
|
|
48 |
PICTReader fromFile:'/phys/exept/tmp/pict/WHT.PCT'
|
|
49 |
PICTReader fromFile:'/phys/exept/tmp/pict/YEL.PCT'
|
|
50 |
PICTReader fromFile:'/phys/exept/tmp/pict/FLAG_B24.PCT'
|
|
51 |
PICTReader fromFile:'/phys/exept/tmp/pict/MARBLES.PCT'
|
|
52 |
PICTReader fromFile:'/phys/exept/tmp/pict/TRU256.PCT'
|
|
53 |
PICTReader fromFile:'/phys/exept/tmp/pict/VENUS.PCT'
|
1807
|
54 |
|
|
55 |
|
|
56 |
example7 --- Version 2 PICTure ---
|
|
57 |
|
|
58 |
| array stream image |
|
|
59 |
array := #(
|
|
60 |
16r0078
|
|
61 |
16r0000 16r0000 16r006C 16r00A8
|
|
62 |
16r0011
|
|
63 |
16r02FF
|
|
64 |
16r0C00
|
|
65 |
16rFFFE
|
|
66 |
16r0000
|
|
67 |
16r0048 16r0000
|
|
68 |
16r0048 16r0000
|
|
69 |
16r0002 16r0002 16r006E 16r00AA
|
|
70 |
16r0000
|
|
71 |
16r001E
|
|
72 |
16r0001
|
|
73 |
16r000A
|
|
74 |
16r0002 16r0002 16r006E 16r00AA
|
|
75 |
16r000A
|
|
76 |
16r77DD 16r77DD 16r77DD 16r77DD
|
|
77 |
16r0034
|
|
78 |
16r0002 16r0002 16r006E 16r00AA
|
|
79 |
16r000A
|
|
80 |
16r8822 16r8822 16r8822 16r8822
|
|
81 |
16r005C
|
|
82 |
16r0008
|
|
83 |
16r0008
|
|
84 |
16r0071
|
|
85 |
16r001A
|
|
86 |
16r0002 16r0002 16r006E 16r00AA
|
|
87 |
16r006E 16r0002 16r0002 16r0054 16r006E 16r00AA 16r006E 16r0002
|
|
88 |
16r00FF
|
|
89 |
).
|
|
90 |
|
|
91 |
stream := WriteStream on: (ByteArray new: array size * 2 + 512).
|
1843
|
92 |
stream next:512 put:0.
|
1807
|
93 |
array do:
|
|
94 |
[:n |
|
|
95 |
stream nextPut: ((n bitAnd:16rFF00) bitShift: -8).
|
|
96 |
stream nextPut: (n bitAnd: 16r00FF)
|
|
97 |
].
|
|
98 |
image := PICTReader fromStream: (ReadStream on: stream contents).
|
|
99 |
image
|
|
100 |
|
|
101 |
|
1804
|
102 |
example8
|
|
103 |
--- Version 1 PICTure ---
|
|
104 |
|
|
105 |
| array image |
|
|
106 |
array := #[
|
|
107 |
16r00 16r4F
|
|
108 |
16r00 16r02 16r00 16r02 16r00 16r6E 16r00 16rAA
|
|
109 |
16r11
|
|
110 |
16r01
|
|
111 |
16r01
|
|
112 |
16r00 16r0A
|
|
113 |
16r00 16r02 16r00 16r02 16r00 16r6E 16r00 16rAA
|
|
114 |
16r0A
|
|
115 |
16r77 16rDD 16r77 16rDD 16r77 16rDD 16r77 16rDD
|
|
116 |
16r34
|
|
117 |
16r00 16r02 16r00 16r02 16r00 16r6E 16r00 16rAA
|
|
118 |
16r0A
|
|
119 |
16r88 16r22 16r88 16r22 16r88 16r22 16r88 16r22
|
|
120 |
16r5C
|
|
121 |
16r71
|
|
122 |
16r00 16r1A
|
|
123 |
16r00 16r02 16r00 16r02 16r00 16r6E 16r00 16rAA
|
|
124 |
16r00 16r6E 16r00 16r02 16r00 16r02 16r00 16r54 16r00 16r6E 16r00 16rAA 16r00 16r6E 16r00 16r02
|
|
125 |
16rFF
|
|
126 |
].
|
1807
|
127 |
array := (ByteArray new:512) , array.
|
1804
|
128 |
image := PICTReader fromStream: (ReadStream on: array).
|
1816
|
129 |
image
|
1804
|
130 |
"
|
|
131 |
! !
|
|
132 |
|
|
133 |
!PICTReader class methodsFor:'initialization'!
|
|
134 |
|
1806
|
135 |
defineOpcodes00
|
|
136 |
Opcodes at: 16r0000 put: ('NOP' -> 0).
|
|
137 |
Opcodes at: 16r0001 put: ('Clip' -> 'Region size').
|
|
138 |
Opcodes at: 16r0002 put: ('BkPat' -> 8).
|
|
139 |
Opcodes at: 16r0003 put: ('TxFont' -> 2).
|
|
140 |
Opcodes at: 16r0004 put: ('TxFace' -> 1).
|
|
141 |
Opcodes at: 16r0005 put: ('TxMode' -> 2).
|
|
142 |
Opcodes at: 16r0006 put: ('SpExtra' -> 4).
|
|
143 |
Opcodes at: 16r0007 put: ('PnSize' -> 4).
|
|
144 |
Opcodes at: 16r0008 put: ('PnMode' -> 2).
|
|
145 |
Opcodes at: 16r0009 put: ('PnPat' -> 8).
|
|
146 |
Opcodes at: 16r000A put: ('FillPat' -> 8).
|
|
147 |
Opcodes at: 16r000B put: ('OvSize' -> 4).
|
|
148 |
Opcodes at: 16r000C put: ('Origin' -> 4).
|
|
149 |
Opcodes at: 16r000D put: ('TxSize' -> 2).
|
|
150 |
Opcodes at: 16r000E put: ('FgColor' -> 4).
|
|
151 |
Opcodes at: 16r000F put: ('BkColor' -> 4).
|
|
152 |
!
|
|
153 |
|
|
154 |
defineOpcodes01
|
|
155 |
Opcodes at: 16r0010 put: ('TxRatio' -> 8).
|
|
156 |
Opcodes at: 16r0011 put: ('VersionOp' -> 1).
|
|
157 |
Opcodes at: 16r0012 put: ('BkPixPat' -> 'Variable').
|
|
158 |
Opcodes at: 16r0013 put: ('PnPixPat' -> 'Variable').
|
|
159 |
Opcodes at: 16r0014 put: ('FillPixPat' -> 'Variable').
|
|
160 |
Opcodes at: 16r0015 put: ('PnLocHFrac' -> 2).
|
|
161 |
Opcodes at: 16r0016 put: ('ChExtra' -> 2).
|
|
162 |
Opcodes at: 16r0017 put: ('Apple0017' -> 'Not determined').
|
|
163 |
Opcodes at: 16r0018 put: ('Apple0018' -> 'Not determined').
|
|
164 |
Opcodes at: 16r0019 put: ('Apple0019' -> 'Not determined').
|
|
165 |
Opcodes at: 16r001A put: ('RGBFgCol' -> 6).
|
|
166 |
Opcodes at: 16r001B put: ('RGBBkCol' -> 6).
|
|
167 |
Opcodes at: 16r001C put: ('HiliteMode' -> 0).
|
|
168 |
Opcodes at: 16r001D put: ('HiliteColor' -> 6).
|
|
169 |
Opcodes at: 16r001E put: ('DefHilite' -> 0).
|
|
170 |
Opcodes at: 16r001F put: ('OpColor' -> 6).
|
|
171 |
!
|
|
172 |
|
|
173 |
defineOpcodes02
|
|
174 |
Opcodes at: 16r0020 put: ('Line' -> 8).
|
|
175 |
Opcodes at: 16r0021 put: ('LineFrom' -> 4).
|
|
176 |
Opcodes at: 16r0022 put: ('ShortLine' -> 6).
|
|
177 |
Opcodes at: 16r0023 put: ('ShortLineFrom' -> 2).
|
|
178 |
Opcodes at: 16r0024 put: ('Apple0024' -> '2 + data length').
|
|
179 |
Opcodes at: 16r0025 put: ('Apple0025' -> '2 + data length').
|
|
180 |
Opcodes at: 16r0026 put: ('Apple0026' -> '2 + data length').
|
|
181 |
Opcodes at: 16r0027 put: ('Apple0027' -> '2 + data length').
|
|
182 |
Opcodes at: 16r0028 put: ('LongText' -> '5 + text').
|
|
183 |
Opcodes at: 16r0029 put: ('DHText' -> '2 + text').
|
|
184 |
Opcodes at: 16r002A put: ('DVText' -> '2 + text').
|
|
185 |
Opcodes at: 16r002B put: ('DHDVText' -> '3 + text').
|
|
186 |
Opcodes at: 16r002C put: ('fontName' -> '5 + name length').
|
|
187 |
Opcodes at: 16r002D put: ('lineJustify' -> 10).
|
|
188 |
Opcodes at: 16r002E put: ('glyphState' -> 8).
|
|
189 |
Opcodes at: 16r002F put: ('Apple002F' -> '2 + data length').
|
|
190 |
!
|
|
191 |
|
|
192 |
defineOpcodes03
|
|
193 |
Opcodes at: 16r0030 put: ('frameRect' -> 8).
|
|
194 |
Opcodes at: 16r0031 put: ('paintRect' -> 8).
|
|
195 |
Opcodes at: 16r0032 put: ('eraseRect' -> 8).
|
|
196 |
Opcodes at: 16r0033 put: ('invertRect' -> 8).
|
|
197 |
Opcodes at: 16r0034 put: ('fillRect' -> 8).
|
|
198 |
Opcodes at: 16r0035 put: ('Apple0035' -> 8).
|
|
199 |
Opcodes at: 16r0036 put: ('Apple0036' -> 8).
|
|
200 |
Opcodes at: 16r0037 put: ('Apple0037' -> 8).
|
|
201 |
Opcodes at: 16r0038 put: ('frameSameRect' -> 0).
|
|
202 |
Opcodes at: 16r0039 put: ('paintSameRect' -> 0).
|
|
203 |
Opcodes at: 16r003A put: ('eraseSameRect' -> 0).
|
|
204 |
Opcodes at: 16r003B put: ('invertSameRect' -> 0).
|
|
205 |
Opcodes at: 16r003C put: ('fillSameRect' -> 0).
|
|
206 |
Opcodes at: 16r003D put: ('Apple003D' -> 0).
|
|
207 |
Opcodes at: 16r003E put: ('Apple003E' -> 0).
|
|
208 |
Opcodes at: 16r003F put: ('Apple003F' -> 0).
|
|
209 |
!
|
|
210 |
|
|
211 |
defineOpcodes04
|
|
212 |
Opcodes at: 16r0040 put: ('frameRRect' -> 8).
|
|
213 |
Opcodes at: 16r0041 put: ('paintRRect' -> 8).
|
|
214 |
Opcodes at: 16r0042 put: ('eraseRRect' -> 8).
|
|
215 |
Opcodes at: 16r0043 put: ('invertRRect' -> 8).
|
|
216 |
Opcodes at: 16r0044 put: ('fillRect' -> 8).
|
|
217 |
Opcodes at: 16r0045 put: ('Apple0045' -> 8).
|
|
218 |
Opcodes at: 16r0046 put: ('Apple0046' -> 8).
|
|
219 |
Opcodes at: 16r0047 put: ('Apple0047' -> 8).
|
|
220 |
Opcodes at: 16r0048 put: ('frameSameRRect' -> 0).
|
|
221 |
Opcodes at: 16r0049 put: ('paintSameRRect' -> 0).
|
|
222 |
Opcodes at: 16r004A put: ('eraseSameRRect' -> 0).
|
|
223 |
Opcodes at: 16r004B put: ('invertSameRRect' -> 0).
|
|
224 |
Opcodes at: 16r004C put: ('fillSameRRect' -> 0).
|
|
225 |
Opcodes at: 16r004D put: ('Apple004D' -> 0).
|
|
226 |
Opcodes at: 16r004E put: ('Apple004E' -> 0).
|
|
227 |
Opcodes at: 16r004F put: ('Apple004F' -> 0).
|
|
228 |
!
|
|
229 |
|
|
230 |
defineOpcodes05
|
|
231 |
Opcodes at: 16r0050 put: ('frameOval' -> 8).
|
|
232 |
Opcodes at: 16r0051 put: ('paintOval' -> 8).
|
|
233 |
Opcodes at: 16r0052 put: ('eraseOval' -> 8).
|
|
234 |
Opcodes at: 16r0053 put: ('invertOval' -> 8).
|
|
235 |
Opcodes at: 16r0054 put: ('fillRect' -> 8).
|
|
236 |
Opcodes at: 16r0055 put: ('Apple0055' -> 8).
|
|
237 |
Opcodes at: 16r0056 put: ('Apple0056' -> 8).
|
|
238 |
Opcodes at: 16r0057 put: ('Apple0057' -> 8).
|
|
239 |
Opcodes at: 16r0058 put: ('frameSameOval' -> 0).
|
|
240 |
Opcodes at: 16r0059 put: ('paintSameOval' -> 0).
|
|
241 |
Opcodes at: 16r005A put: ('eraseSameOval' -> 0).
|
|
242 |
Opcodes at: 16r005B put: ('invertSameOval' -> 0).
|
|
243 |
Opcodes at: 16r005C put: ('fillSameOval' -> 0).
|
|
244 |
Opcodes at: 16r005D put: ('Apple005D' -> 0).
|
|
245 |
Opcodes at: 16r005E put: ('Apple005E' -> 0).
|
|
246 |
Opcodes at: 16r005F put: ('Apple005F' -> 0).
|
|
247 |
!
|
|
248 |
|
|
249 |
defineOpcodes06
|
|
250 |
Opcodes at: 16r0060 put: ('frameArc' -> 12).
|
|
251 |
Opcodes at: 16r0061 put: ('paintArc' -> 12).
|
|
252 |
Opcodes at: 16r0062 put: ('eraseArc' -> 12).
|
|
253 |
Opcodes at: 16r0063 put: ('invertArc' -> 12).
|
|
254 |
Opcodes at: 16r0064 put: ('fillRect' -> 12).
|
|
255 |
Opcodes at: 16r0065 put: ('Apple0065' -> 12).
|
|
256 |
Opcodes at: 16r0066 put: ('Apple0066' -> 12).
|
|
257 |
Opcodes at: 16r0067 put: ('Apple0067' -> 12).
|
|
258 |
Opcodes at: 16r0068 put: ('frameSameArc' -> 4).
|
|
259 |
Opcodes at: 16r0069 put: ('paintSameArc' -> 4).
|
|
260 |
Opcodes at: 16r006A put: ('eraseSameArc' -> 4).
|
|
261 |
Opcodes at: 16r006B put: ('invertSameArc' -> 4).
|
|
262 |
Opcodes at: 16r006C put: ('fillSameArc' -> 4).
|
|
263 |
Opcodes at: 16r006D put: ('Apple006D' -> 4).
|
|
264 |
Opcodes at: 16r006E put: ('Apple006E' -> 4).
|
|
265 |
Opcodes at: 16r006F put: ('Apple006F' -> 4).
|
|
266 |
!
|
|
267 |
|
|
268 |
defineOpcodes07
|
|
269 |
Opcodes at: 16r0070 put: ('framePoly' -> 'Polygon size').
|
|
270 |
Opcodes at: 16r0071 put: ('paintPoly' -> 'Polygon size').
|
|
271 |
Opcodes at: 16r0072 put: ('erasePoly' -> 'Polygon size').
|
|
272 |
Opcodes at: 16r0073 put: ('invertPoly' -> 'Polygon size').
|
|
273 |
Opcodes at: 16r0074 put: ('fillRect' -> 'Polygon size').
|
|
274 |
Opcodes at: 16r0075 put: ('Apple0075' -> 'Polygon size').
|
|
275 |
Opcodes at: 16r0076 put: ('Apple0076' -> 'Polygon size').
|
|
276 |
Opcodes at: 16r0077 put: ('Apple0077' -> 'Polygon size').
|
|
277 |
Opcodes at: 16r0078 put: ('frameSamePoly' -> 0).
|
|
278 |
Opcodes at: 16r0079 put: ('paintSamePoly' -> 0).
|
|
279 |
Opcodes at: 16r007A put: ('eraseSamePoly' -> 0).
|
|
280 |
Opcodes at: 16r007B put: ('invertSamePoly' -> 0).
|
|
281 |
Opcodes at: 16r007C put: ('fillSamePoly' -> 0).
|
|
282 |
Opcodes at: 16r007D put: ('Apple007D' -> 0).
|
|
283 |
Opcodes at: 16r007E put: ('Apple007E' -> 0).
|
|
284 |
Opcodes at: 16r007F put: ('Apple007F' -> 0).
|
|
285 |
!
|
|
286 |
|
|
287 |
defineOpcodes08
|
|
288 |
Opcodes at: 16r0080 put: ('frameRgn' -> 'Region size').
|
|
289 |
Opcodes at: 16r0081 put: ('paintRgn' -> 'Region size').
|
|
290 |
Opcodes at: 16r0082 put: ('eraseRgn' -> 'Region size').
|
|
291 |
Opcodes at: 16r0083 put: ('invertRgn' -> 'Region size').
|
|
292 |
Opcodes at: 16r0084 put: ('fillRect' -> 'Region size').
|
|
293 |
Opcodes at: 16r0085 put: ('Apple0085' -> 'Region size').
|
|
294 |
Opcodes at: 16r0086 put: ('Apple0086' -> 'Region size').
|
|
295 |
Opcodes at: 16r0087 put: ('Apple0087' -> 'Region size').
|
|
296 |
Opcodes at: 16r0088 put: ('frameSameRgn' -> 0).
|
|
297 |
Opcodes at: 16r0089 put: ('paintSameRgn' -> 0).
|
|
298 |
Opcodes at: 16r008A put: ('eraseSameRgn' -> 0).
|
|
299 |
Opcodes at: 16r008B put: ('invertSameRgn' -> 0).
|
|
300 |
Opcodes at: 16r008C put: ('fillSameRgn' -> 0).
|
|
301 |
Opcodes at: 16r008D put: ('Apple008D' -> 0).
|
|
302 |
Opcodes at: 16r008E put: ('Apple008E' -> 0).
|
|
303 |
Opcodes at: 16r008F put: ('Apple008F' -> 0).
|
|
304 |
!
|
|
305 |
|
|
306 |
defineOpcodes09
|
|
307 |
Opcodes at: 16r0090 put: ('BitsRect' -> 'Variable').
|
|
308 |
Opcodes at: 16r0091 put: ('BitsRgn' -> 'Variable').
|
|
309 |
Opcodes at: 16r0092 put: ('Apple0092' -> '2 + data length').
|
|
310 |
Opcodes at: 16r0093 put: ('Apple0093' -> '2 + data length').
|
|
311 |
Opcodes at: 16r0094 put: ('Apple0094' -> '2 + data length').
|
|
312 |
Opcodes at: 16r0095 put: ('Apple0095' -> '2 + data length').
|
|
313 |
Opcodes at: 16r0096 put: ('Apple0096' -> '2 + data length').
|
|
314 |
Opcodes at: 16r0097 put: ('Apple0097' -> '2 + data length').
|
|
315 |
Opcodes at: 16r0098 put: ('PackBitsRect' -> 'Variable').
|
|
316 |
Opcodes at: 16r0099 put: ('PackBitsRgn' -> 'Variable').
|
|
317 |
Opcodes at: 16r009A put: ('DirectBitsRect' -> 'Variable').
|
|
318 |
Opcodes at: 16r009B put: ('DirectBitsRegn' -> 'Variable').
|
|
319 |
Opcodes at: 16r009C put: ('Apple009C' -> '2 + data length').
|
|
320 |
Opcodes at: 16r009D put: ('Apple009D' -> '2 + data length').
|
|
321 |
Opcodes at: 16r009E put: ('Apple009E' -> '2 + data length').
|
|
322 |
Opcodes at: 16r009F put: ('Apple009F' -> '2 + data length').
|
|
323 |
!
|
|
324 |
|
|
325 |
defineOpcodes10
|
|
326 |
Opcodes at: 16r00A0 put: ('ShortComment' -> 2).
|
|
327 |
Opcodes at: 16r00A1 put: ('LongComment' -> '4 + data').
|
|
328 |
Opcodes at: 16r00A2 put: ('Apple00A2' -> '2 + data length').
|
|
329 |
Opcodes at: 16r00A3 put: ('Apple00A3' -> '2 + data length').
|
|
330 |
Opcodes at: 16r00A4 put: ('Apple00A4' -> '2 + data length').
|
|
331 |
Opcodes at: 16r00A5 put: ('Apple00A5' -> '2 + data length').
|
|
332 |
Opcodes at: 16r00A6 put: ('Apple00A6' -> '2 + data length').
|
|
333 |
Opcodes at: 16r00A7 put: ('Apple00A7' -> '2 + data length').
|
|
334 |
Opcodes at: 16r00A8 put: ('Apple00A8' -> '2 + data length').
|
|
335 |
Opcodes at: 16r00A9 put: ('Apple00A9' -> '2 + data length').
|
|
336 |
Opcodes at: 16r00AA put: ('Apple00AA' -> '2 + data length').
|
|
337 |
Opcodes at: 16r00AB put: ('Apple00AB' -> '2 + data length').
|
|
338 |
Opcodes at: 16r00AC put: ('Apple00AC' -> '2 + data length').
|
|
339 |
Opcodes at: 16r00AD put: ('Apple00AD' -> '2 + data length').
|
|
340 |
Opcodes at: 16r00AE put: ('Apple00AE' -> '2 + data length').
|
|
341 |
Opcodes at: 16r00AF put: ('Apple00AF' -> '2 + data length').
|
|
342 |
!
|
|
343 |
|
|
344 |
defineOpcodes99
|
|
345 |
Opcodes at: 16r00FF put: ('OpEndPic' -> 0).
|
|
346 |
Opcodes at: 16r02FF put: ('Version' -> 2).
|
|
347 |
Opcodes at: 16r0C00 put: ('HeaderOp' -> 24).
|
|
348 |
Opcodes at: 16r8200 put: ('CompressedQuickTime' -> '4 + data length').
|
|
349 |
Opcodes at: 16r8201 put: ('UncompressedQuickTime' -> '4 + data length').
|
|
350 |
!
|
|
351 |
|
1804
|
352 |
initialize
|
|
353 |
"install myself in the Image classes fileFormat table
|
1806
|
354 |
for the `.pic' and '.pict' extensions."
|
|
355 |
|
|
356 |
MIMETypes defineImageType:nil suffix:'pict' reader:self.
|
|
357 |
MIMETypes defineImageType:nil suffix:'pic' reader:self.
|
|
358 |
|
|
359 |
"PictReader initialize."
|
|
360 |
!
|
|
361 |
|
|
362 |
initializeOpcodes
|
|
363 |
"PictImageStream initializeOpcodes."
|
1804
|
364 |
|
1806
|
365 |
Opcodes := IdentityDictionary new: 100.
|
|
366 |
self defineOpcodes00.
|
|
367 |
self defineOpcodes01.
|
|
368 |
self defineOpcodes02.
|
|
369 |
self defineOpcodes03.
|
|
370 |
self defineOpcodes04.
|
|
371 |
self defineOpcodes05.
|
|
372 |
self defineOpcodes06.
|
|
373 |
self defineOpcodes07.
|
|
374 |
self defineOpcodes08.
|
|
375 |
self defineOpcodes09.
|
|
376 |
self defineOpcodes10.
|
|
377 |
self defineOpcodes99.
|
|
378 |
^Opcodes
|
1804
|
379 |
! !
|
|
380 |
|
1807
|
381 |
!PICTReader class methodsFor:'opcodes'!
|
|
382 |
|
|
383 |
opcodeAt: opcode
|
|
384 |
"PictImageStream opcodeAt: 16r8201."
|
|
385 |
|
|
386 |
| key value string |
|
|
387 |
|
|
388 |
Opcodes isNil ifTrue:[
|
|
389 |
self initializeOpcodes
|
|
390 |
].
|
|
391 |
|
|
392 |
(Opcodes includesKey: opcode)
|
|
393 |
ifTrue: [^Opcodes at: opcode].
|
|
394 |
|
|
395 |
string := opcode printStringRadix: 16.
|
|
396 |
string := string leftPaddedTo:4 with:$0. "/ 4 - string size timesRepeat: [string := '0' , string]. "
|
|
397 |
|
|
398 |
key := 'Apple' , string.
|
|
399 |
(16r00B0 <= opcode and: [opcode <= 16r00CF])
|
|
400 |
ifTrue:
|
|
401 |
[value := 0.
|
|
402 |
^key -> value].
|
|
403 |
(16r00D0 <= opcode and: [opcode <= 16r00FE])
|
|
404 |
ifTrue:
|
|
405 |
[value := '4 + data length'.
|
|
406 |
^key -> value].
|
|
407 |
(16r0100 <= opcode and: [opcode <= 16r01FF])
|
|
408 |
ifTrue:
|
|
409 |
[value := 2.
|
|
410 |
^key -> value].
|
|
411 |
(16r0200 <= opcode and: [opcode <= 16r02FE])
|
|
412 |
ifTrue:
|
|
413 |
[value := 4.
|
|
414 |
^key -> value].
|
|
415 |
(16r0300 <= opcode and: [opcode <= 16r0BFF])
|
|
416 |
ifTrue:
|
|
417 |
[value := 22.
|
|
418 |
^key -> value].
|
|
419 |
(16r0C01 <= opcode and: [opcode <= 16r7EFF])
|
|
420 |
ifTrue:
|
|
421 |
[value := 24.
|
|
422 |
^key -> value].
|
|
423 |
(16r7F00 <= opcode and: [opcode <= 16r7FFF])
|
|
424 |
ifTrue:
|
|
425 |
[value := 254.
|
|
426 |
^key -> value].
|
|
427 |
(16r8000 <= opcode and: [opcode <= 16r80FF])
|
|
428 |
ifTrue:
|
|
429 |
[value := 0.
|
|
430 |
^key -> value].
|
|
431 |
(16r8100 <= opcode and: [opcode <= 16r81FF])
|
|
432 |
ifTrue:
|
|
433 |
[value := '4 + data length'.
|
|
434 |
^key -> value].
|
|
435 |
(16r8201 <= opcode and: [opcode <= 16rFFFF])
|
|
436 |
ifTrue:
|
|
437 |
[value := '4 + data length'.
|
|
438 |
^key -> value].
|
|
439 |
^nil
|
|
440 |
! !
|
|
441 |
|
1804
|
442 |
!PICTReader class methodsFor:'testing'!
|
|
443 |
|
|
444 |
isValidImageFile:aFileName
|
|
445 |
"return true, if aFileName contains a sunraster image"
|
|
446 |
|
|
447 |
|inStream nr|
|
|
448 |
|
|
449 |
inStream := self streamReadingFile:aFileName.
|
|
450 |
inStream isNil ifTrue:[^ false].
|
|
451 |
|
|
452 |
"try sun raster"
|
|
453 |
inStream binary.
|
|
454 |
((inStream nextWord == 16r59A6)
|
|
455 |
and:[inStream nextWord == 16r6A95]) ifTrue: [
|
|
456 |
inStream close.
|
|
457 |
^ true
|
|
458 |
].
|
|
459 |
|
|
460 |
inStream isPositionable ifFalse:[^ false].
|
|
461 |
|
|
462 |
"try sun bitmap image format"
|
|
463 |
inStream text.
|
|
464 |
inStream reset.
|
|
465 |
|
|
466 |
"must start with a comment"
|
|
467 |
inStream skipSeparators.
|
|
468 |
inStream next ~~ $/ ifTrue:[^ false].
|
|
469 |
inStream next ~~ $* ifTrue:[^ false].
|
|
470 |
|
|
471 |
(inStream skipThroughAll: 'idth') isNil ifTrue: [
|
|
472 |
inStream close.
|
|
473 |
^ false
|
|
474 |
].
|
|
475 |
inStream next; skipSeparators.
|
|
476 |
nr := Integer readFrom: inStream.
|
|
477 |
(nr isNil or:[nr <= 0]) ifTrue: [
|
|
478 |
inStream close.
|
|
479 |
^ false
|
|
480 |
].
|
|
481 |
|
|
482 |
(inStream skipThroughAll: 'eight') isNil ifTrue: [
|
|
483 |
inStream close.
|
|
484 |
^ false
|
|
485 |
].
|
|
486 |
inStream next; skipSeparators.
|
|
487 |
nr := Integer readFrom: inStream.
|
|
488 |
(nr isNil or:[nr <= 0]) ifTrue: [
|
|
489 |
inStream close.
|
|
490 |
^ false
|
|
491 |
].
|
|
492 |
|
|
493 |
inStream close.
|
|
494 |
^ true
|
|
495 |
! !
|
|
496 |
|
1806
|
497 |
!PICTReader methodsFor:'commands'!
|
|
498 |
|
|
499 |
xBitsRect
|
1807
|
500 |
self debug:[ Transcript show:'xBitsRect'; cr ].
|
1806
|
501 |
^self xPackBitsRect
|
|
502 |
!
|
|
503 |
|
|
504 |
xBitsRgn
|
1807
|
505 |
self debug:[ Transcript show:'xBitsRgn'; cr ].
|
1806
|
506 |
^self xPackBitsRgn
|
|
507 |
!
|
|
508 |
|
|
509 |
xDHDVText
|
|
510 |
| dh dv count string |
|
1807
|
511 |
self debug:[ Transcript show:'xDHDVText'; cr ].
|
|
512 |
|
1806
|
513 |
dh := self next.
|
|
514 |
dv := self next.
|
|
515 |
count := self next.
|
|
516 |
string := (self next: count) asString.
|
|
517 |
self
|
|
518 |
debug:
|
|
519 |
[Transcript space; show: dh printString.
|
|
520 |
Transcript space; show: dv printString.
|
|
521 |
Transcript space; show: count printString.
|
|
522 |
Transcript space; show: string printString].
|
|
523 |
^Array
|
|
524 |
with: dh
|
|
525 |
with: dv
|
|
526 |
with: count
|
|
527 |
with: string
|
|
528 |
!
|
|
529 |
|
|
530 |
xDHText
|
|
531 |
| dh count string |
|
1807
|
532 |
|
|
533 |
self debug:[ Transcript show:'xDHText'; cr ].
|
|
534 |
|
1806
|
535 |
dh := self next.
|
|
536 |
count := self next.
|
|
537 |
string := (self next: count) asString.
|
|
538 |
self
|
|
539 |
debug:
|
|
540 |
[Transcript space; show: dh printString.
|
|
541 |
Transcript space; show: count printString.
|
|
542 |
Transcript space; show: string printString].
|
|
543 |
^Array
|
|
544 |
with: dh
|
|
545 |
with: count
|
|
546 |
with: string
|
|
547 |
!
|
|
548 |
|
|
549 |
xDVText
|
|
550 |
| dv count string |
|
1807
|
551 |
|
|
552 |
self debug:[ Transcript show:'xDVText'; cr ].
|
|
553 |
|
1806
|
554 |
dv := self next.
|
|
555 |
count := self next.
|
|
556 |
string := (self next: count) asString.
|
|
557 |
self
|
|
558 |
debug:
|
|
559 |
[Transcript space; show: dv printString.
|
|
560 |
Transcript space; show: count printString.
|
|
561 |
Transcript space; show: string printString].
|
|
562 |
^Array
|
|
563 |
with: dv
|
|
564 |
with: count
|
|
565 |
with: string
|
|
566 |
!
|
|
567 |
|
|
568 |
xDirectBitsRect
|
|
569 |
| record |
|
1807
|
570 |
|
|
571 |
self debug:[ Transcript show:'xDirectBitsRect'; cr ].
|
|
572 |
|
1806
|
573 |
record := self readDirectPixMap: false.
|
|
574 |
self debug: [Transcript space; show: record printString].
|
|
575 |
imageSequence add: record.
|
|
576 |
^record
|
|
577 |
!
|
|
578 |
|
|
579 |
xDirectBitsRgn
|
|
580 |
^self readDirectPixMap: true
|
|
581 |
!
|
|
582 |
|
|
583 |
xFontName
|
|
584 |
| dataLength fontId nameLength fontName |
|
1807
|
585 |
|
|
586 |
self debug:[ Transcript show:'xFontName'; cr ].
|
|
587 |
|
1806
|
588 |
dataLength := self nextWord.
|
|
589 |
fontId := self nextWord.
|
|
590 |
nameLength := self next.
|
|
591 |
fontName := (self next: nameLength) asString.
|
|
592 |
self
|
|
593 |
debug:
|
|
594 |
[Transcript space; show: dataLength printString.
|
|
595 |
Transcript space; show: fontId printString.
|
|
596 |
Transcript space; show: nameLength printString.
|
|
597 |
Transcript space; show: fontName printString].
|
|
598 |
^Array
|
|
599 |
with: dataLength
|
|
600 |
with: fontId
|
|
601 |
with: nameLength
|
|
602 |
with: fontName
|
|
603 |
!
|
|
604 |
|
|
605 |
xLongComment
|
|
606 |
| kind size bytes aStream char |
|
1807
|
607 |
|
|
608 |
self debug:[ Transcript show:'xLongComment'; cr ].
|
|
609 |
|
1806
|
610 |
kind := self nextWord.
|
|
611 |
size := self nextWord.
|
|
612 |
bytes := self next: size.
|
|
613 |
aStream := WriteStream on: (String new: bytes size).
|
|
614 |
bytes
|
|
615 |
do:
|
|
616 |
[:byte |
|
|
617 |
char := Character value: byte.
|
|
618 |
((33 <= byte and: [byte <= 126])
|
|
619 |
or: [char = Character tab or: [char = Character space or: [char = Character cr]]])
|
|
620 |
ifTrue: [aStream nextPut: char]
|
|
621 |
ifFalse: [aStream nextPut: Character space]].
|
|
622 |
self
|
|
623 |
debug:
|
|
624 |
[Transcript space; show: kind printString.
|
|
625 |
Transcript space; show: size printString.
|
|
626 |
Transcript space; show: aStream contents printString].
|
|
627 |
^Array
|
|
628 |
with: kind
|
|
629 |
with: size
|
|
630 |
with: bytes
|
|
631 |
!
|
|
632 |
|
|
633 |
xLongText
|
|
634 |
| point count string |
|
1807
|
635 |
|
|
636 |
self debug:[ Transcript show:'xLongText'; cr ].
|
|
637 |
|
1806
|
638 |
point := self readPoint.
|
|
639 |
count := self next.
|
|
640 |
string := (self next: count) asString.
|
|
641 |
self
|
|
642 |
debug:
|
|
643 |
[Transcript space; show: point printString.
|
|
644 |
Transcript space; show: count printString.
|
|
645 |
Transcript space; show: string printString].
|
|
646 |
^Array
|
|
647 |
with: point
|
|
648 |
with: count
|
|
649 |
with: string
|
|
650 |
!
|
|
651 |
|
|
652 |
xPackBitsRect
|
|
653 |
| position word record |
|
1807
|
654 |
|
|
655 |
self debug:[ Transcript show:'xPackBitsRect'; cr ].
|
|
656 |
|
1806
|
657 |
position := self position.
|
|
658 |
word := self nextWord.
|
|
659 |
self position: position.
|
|
660 |
(word bitShift: -15)
|
|
661 |
= 1
|
|
662 |
ifTrue: [record := self readPixMap: false]
|
|
663 |
ifFalse: [record := self readBitMap: false].
|
|
664 |
self debug: [Transcript space; show: record printString].
|
|
665 |
imageSequence add: record.
|
|
666 |
^record
|
|
667 |
!
|
|
668 |
|
|
669 |
xPackBitsRgn
|
|
670 |
| position word record |
|
1807
|
671 |
|
|
672 |
self debug:[ Transcript show:'xPackBitsRgn'; cr ].
|
|
673 |
|
1806
|
674 |
position := self position.
|
|
675 |
word := self nextWord.
|
|
676 |
self position: position.
|
|
677 |
(word bitShift: -15)
|
|
678 |
= 1
|
|
679 |
ifTrue: [record := self readPixMap: true]
|
|
680 |
ifFalse: [record := self readBitMap: true].
|
|
681 |
self debug: [Transcript space; show: record printString].
|
|
682 |
imageSequence add: record.
|
|
683 |
^record
|
|
684 |
! !
|
|
685 |
|
1807
|
686 |
!PICTReader methodsFor:'debugging'!
|
|
687 |
|
|
688 |
debug: aBlock
|
|
689 |
aBlock value
|
|
690 |
! !
|
|
691 |
|
1806
|
692 |
!PICTReader methodsFor:'decoding'!
|
|
693 |
|
|
694 |
readBitData
|
|
695 |
| bitData |
|
|
696 |
bitData := ByteArray new: rowBytes * bounds height.
|
|
697 |
self progress: 0.
|
|
698 |
1 to: bounds height
|
|
699 |
do:
|
|
700 |
[:column |
|
|
701 |
| start stop replacement |
|
|
702 |
start := column - 1 * rowBytes + 1.
|
|
703 |
stop := column * rowBytes.
|
|
704 |
replacement := self readBitRowData.
|
|
705 |
bitData
|
|
706 |
replaceBytesFrom: start
|
|
707 |
to: stop
|
|
708 |
with: replacement
|
|
709 |
startingAt: 1.
|
|
710 |
self progress: column / bounds height].
|
|
711 |
^bitData
|
|
712 |
!
|
|
713 |
|
|
714 |
readBitMap: isMaskRgn
|
|
715 |
| bitData anImage pad anArray maskRgn |
|
|
716 |
rowBytes := self nextWord.
|
|
717 |
bounds := self readRect.
|
|
718 |
srcRect := self readRect.
|
|
719 |
dstRect := self readRect.
|
|
720 |
mode := self nextWord.
|
|
721 |
bitData := self readBitData.
|
|
722 |
isMaskRgn = true ifTrue: [maskRgn := self readRegion].
|
|
723 |
pad := rowBytes * 8 - bounds width.
|
|
724 |
pad >= 8
|
|
725 |
ifTrue: [pad >= 16
|
|
726 |
ifTrue: [pad := 32]
|
|
727 |
ifFalse: [pad := 16]]
|
|
728 |
ifFalse: [pad := 8].
|
|
729 |
|
|
730 |
anImage := Image
|
|
731 |
extent: bounds width @ bounds height
|
|
732 |
depth: 1
|
|
733 |
palette: MappedPalette monochromeDefault
|
|
734 |
bits: bitData
|
|
735 |
pad: pad.
|
|
736 |
|
|
737 |
" self debug: [anImage displayOn: ScheduledControllers activeController view graphicsContext]. "
|
1849
|
738 |
"/ OLD
|
|
739 |
"/ anArray := Array
|
|
740 |
"/ with: anImage
|
|
741 |
"/ with: srcRect
|
|
742 |
"/ with: dstRect
|
|
743 |
"/ with: mode.
|
|
744 |
"/ isMaskRgn = true ifTrue: [anArray := anArray , (Array with: maskRgn)].
|
|
745 |
"/ NEW:
|
|
746 |
anArray := PICTFrame new
|
|
747 |
image:anImage
|
|
748 |
sourceRectangle:srcRect
|
|
749 |
destinationRectangle:dstRect
|
|
750 |
mode:mode.
|
|
751 |
isMaskRgn = true ifTrue: [
|
|
752 |
anArray maskRegion:maskRgn
|
|
753 |
].
|
1806
|
754 |
^anArray
|
|
755 |
!
|
|
756 |
|
|
757 |
readBitRowData
|
|
758 |
| rawData byteCount |
|
|
759 |
rowBytes < 8
|
|
760 |
ifTrue: [rawData := self next: rowBytes]
|
|
761 |
ifFalse:
|
|
762 |
[rowBytes > 250
|
|
763 |
ifTrue: [byteCount := self nextWord]
|
|
764 |
ifFalse: [byteCount := self next].
|
|
765 |
rawData := self unPackBits: (self next: byteCount)].
|
|
766 |
^rawData
|
|
767 |
!
|
|
768 |
|
|
769 |
readColorTable
|
|
770 |
ctSeed := self nextLong.
|
|
771 |
ctFlags := self nextWord.
|
|
772 |
ctSize := self nextWord.
|
|
773 |
ctTable := Array new: ctSize + 1.
|
|
774 |
1 to: ctTable size
|
|
775 |
do:
|
|
776 |
[:i |
|
|
777 |
| value rgb |
|
|
778 |
value := self nextWord.
|
|
779 |
value yourself.
|
|
780 |
rgb := self nextWord bitShift: 32.
|
|
781 |
rgb := rgb + (self nextWord bitShift: 16).
|
|
782 |
rgb := rgb + self nextWord.
|
|
783 |
ctTable at: i put: rgb]
|
|
784 |
!
|
|
785 |
|
|
786 |
readDataLength2
|
|
787 |
| length bytes |
|
|
788 |
length := self nextWord.
|
|
789 |
bytes := self next: length.
|
|
790 |
" self debug: [Transcript space; show: bytes printString]. "
|
|
791 |
^Array with: length with: bytes
|
|
792 |
!
|
|
793 |
|
|
794 |
readDataLength4
|
|
795 |
| length bytes |
|
|
796 |
length := self nextLong.
|
|
797 |
bytes := self next: length.
|
|
798 |
" self debug: [Transcript space; show: bytes printString]. "
|
|
799 |
^Array with: length with: bytes
|
|
800 |
!
|
|
801 |
|
|
802 |
readDirectPixData
|
|
803 |
packType = 0 ifTrue: [^self errorSorryNotSupported].
|
|
804 |
packType = 1 ifTrue: [^self errorSorryNotSupported].
|
|
805 |
packType = 2 ifTrue: [^self errorSorryNotSupported].
|
|
806 |
packType = 3 ifTrue: [^self errorSorryNotSupported].
|
|
807 |
packType = 4 ifTrue: [^self readDirectPixData4].
|
|
808 |
^self errorUnexpectedPakingType
|
|
809 |
!
|
|
810 |
|
|
811 |
readDirectPixData4
|
|
812 |
| palette image row scalingValue color index r g b |
|
1849
|
813 |
"/ palette := FixedPalette
|
|
814 |
"/ redShift: 16
|
|
815 |
"/ redMask: 255
|
|
816 |
"/ greenShift: 8
|
|
817 |
"/ greenMask: 255
|
|
818 |
"/ blueShift: 0
|
|
819 |
"/ blueMask: 255.
|
1806
|
820 |
image := Image
|
|
821 |
extent: bounds width @ bounds height
|
|
822 |
depth: 24
|
|
823 |
palette: palette.
|
|
824 |
self progress: 0.
|
|
825 |
0 to: bounds height - 1
|
|
826 |
do:
|
|
827 |
[:y |
|
|
828 |
| x |
|
|
829 |
x := 0.
|
|
830 |
row := self readDirectPixRowData.
|
|
831 |
r := row size // 3 * 0 + 1.
|
|
832 |
g := row size // 3 * 1 + 1.
|
|
833 |
b := row size // 3 * 2 + 1.
|
|
834 |
row size // 3
|
|
835 |
timesRepeat:
|
1849
|
836 |
[
|
|
837 |
"/ ST/X
|
|
838 |
image pixelAtX:x y:y put:( ((((row at: r) bitShift:8)
|
|
839 |
bitOr:(row at: g)) bitShift:8)
|
|
840 |
bitOr:(row at: b)).
|
|
841 |
|
|
842 |
"/ VW
|
|
843 |
"/ scalingValue := ColorValue scalingValue.
|
|
844 |
"/ color := ColorValue
|
|
845 |
"/ scaledRed: (self
|
|
846 |
"/ convertValue: ((row at: r)
|
|
847 |
"/ bitAnd: 255)
|
|
848 |
"/ from: 255
|
|
849 |
"/ to: scalingValue)
|
|
850 |
"/ scaledGreen: (self
|
|
851 |
"/ convertValue: ((row at: g)
|
|
852 |
"/ bitAnd: 255)
|
|
853 |
"/ from: 255
|
|
854 |
"/ to: scalingValue)
|
|
855 |
"/ scaledBlue: (self
|
|
856 |
"/ convertValue: (row at: b)
|
|
857 |
"/ from: 255
|
|
858 |
"/ to: scalingValue).
|
|
859 |
"/ index := palette indexOfPaintNearest: color.
|
|
860 |
"/ image
|
|
861 |
"/ atX: x
|
|
862 |
"/ y: y
|
|
863 |
"/ put: index.
|
1806
|
864 |
r := r + 1.
|
|
865 |
g := g + 1.
|
|
866 |
b := b + 1.
|
|
867 |
x := x + 1].
|
|
868 |
self progress: y / (bounds height - 1)].
|
|
869 |
^image
|
|
870 |
!
|
|
871 |
|
|
872 |
readDirectPixMap: isMaskRgn
|
|
873 |
| anImage maskRgn anArray |
|
|
874 |
|
|
875 |
baseAddr := self nextLong.
|
1807
|
876 |
rowBytes := self nextWord bitAnd: 16r3FFF.
|
1806
|
877 |
bounds := self readRect.
|
|
878 |
pmVersion := self nextWord.
|
|
879 |
packType := self nextWord.
|
|
880 |
packSize := self nextLong.
|
|
881 |
hRes := self nextLong.
|
|
882 |
vRes := self nextLong.
|
|
883 |
pixelType := self nextWord.
|
|
884 |
pixelSize := self nextWord.
|
|
885 |
cmpCount := self nextWord.
|
|
886 |
cmpSize := self nextWord.
|
|
887 |
planeBytes := self nextLong.
|
|
888 |
pmTable := self nextLong.
|
|
889 |
pmReserved := self nextLong.
|
|
890 |
srcRect := self readRect.
|
|
891 |
dstRect := self readRect.
|
|
892 |
mode := self nextWord.
|
|
893 |
isMaskRgn = true ifTrue: [maskRgn := self readRegion].
|
|
894 |
anImage := self readDirectPixData.
|
|
895 |
" self debug: [anImage displayOn: ScheduledControllers activeController view graphicsContext]. "
|
1849
|
896 |
"/ OLD:
|
|
897 |
"/ anArray := Array
|
|
898 |
"/ with: anImage
|
|
899 |
"/ with: srcRect
|
|
900 |
"/ with: dstRect
|
|
901 |
"/ with: mode.
|
|
902 |
"/ isMaskRgn = true ifTrue: [
|
|
903 |
"/ anArray := anArray , (Array with: maskRgn)
|
|
904 |
"/ ].
|
|
905 |
|
|
906 |
"/ NEW:
|
|
907 |
anArray := PICTFrame new
|
|
908 |
image:anImage
|
|
909 |
sourceRectangle:srcRect
|
|
910 |
destinationRectangle:dstRect
|
|
911 |
mode:mode.
|
|
912 |
isMaskRgn = true ifTrue: [
|
|
913 |
anArray maskRegion:maskRgn
|
|
914 |
].
|
1806
|
915 |
^anArray
|
|
916 |
!
|
|
917 |
|
|
918 |
readDirectPixRowData
|
|
919 |
| rawData byteCount |
|
|
920 |
(packType = 1 or: [rowBytes < 8])
|
|
921 |
ifTrue: [rawData := self next: rowBytes]
|
|
922 |
ifFalse: [packType = 2
|
|
923 |
ifTrue: [rawData := self next: (rowBytes * (3 / 4)) asInteger]
|
|
924 |
ifFalse: [packType > 2
|
|
925 |
ifTrue:
|
|
926 |
[rowBytes > 250
|
|
927 |
ifTrue: [byteCount := self nextWord]
|
|
928 |
ifFalse: [byteCount := self next].
|
|
929 |
rawData := self unPackBits: (self next: byteCount)]]].
|
|
930 |
^rawData
|
|
931 |
!
|
|
932 |
|
|
933 |
readHeader
|
|
934 |
| position byte |
|
|
935 |
picSize := self nextWord.
|
|
936 |
picFrame := self readRect.
|
|
937 |
position := self position.
|
|
938 |
byte := self next.
|
1807
|
939 |
byte = 16r11
|
1806
|
940 |
ifTrue: [picVersion := self next]
|
|
941 |
ifFalse:
|
|
942 |
[byte := self next.
|
1807
|
943 |
byte = 16r11
|
1806
|
944 |
ifTrue:
|
|
945 |
[picVersion := self next.
|
|
946 |
self next]
|
|
947 |
ifFalse: [^self errorCanNotRead]].
|
|
948 |
self position: position
|
|
949 |
!
|
|
950 |
|
|
951 |
readPixData
|
|
952 |
| pixData |
|
|
953 |
pixData := ByteArray new: rowBytes * bounds height.
|
|
954 |
self progress: 0.
|
|
955 |
1 to: bounds height
|
|
956 |
do:
|
|
957 |
[:column |
|
|
958 |
| start stop replacement |
|
|
959 |
start := column - 1 * rowBytes + 1.
|
|
960 |
stop := column * rowBytes.
|
|
961 |
replacement := self readPixRowData.
|
|
962 |
pixData
|
|
963 |
replaceBytesFrom: start
|
|
964 |
to: stop
|
|
965 |
with: replacement
|
|
966 |
startingAt: 1.
|
|
967 |
self progress: column / bounds height].
|
|
968 |
^pixData
|
|
969 |
!
|
|
970 |
|
|
971 |
readPixMap: isMaskRgn
|
|
972 |
| pixData aPalette anImage pad maskRgn anArray |
|
1807
|
973 |
rowBytes := self nextWord bitAnd: 16r3FFF.
|
1806
|
974 |
bounds := self readRect.
|
|
975 |
pmVersion := self nextWord.
|
|
976 |
packType := self nextWord.
|
|
977 |
packSize := self nextLong.
|
|
978 |
hRes := self nextLong.
|
|
979 |
vRes := self nextLong.
|
|
980 |
pixelType := self nextWord.
|
|
981 |
pixelSize := self nextWord.
|
|
982 |
cmpCount := self nextWord.
|
|
983 |
cmpSize := self nextWord.
|
|
984 |
planeBytes := self nextLong.
|
|
985 |
pmTable := self nextLong.
|
|
986 |
pmReserved := self nextLong.
|
|
987 |
self readColorTable.
|
|
988 |
srcRect := self readRect.
|
|
989 |
dstRect := self readRect.
|
|
990 |
mode := self nextWord.
|
|
991 |
isMaskRgn = true ifTrue: [maskRgn := self readRegion].
|
|
992 |
pixData := self readPixData.
|
|
993 |
aPalette := MappedPalette withColors: (ctTable collect: [:rgb | self colorValueFrom: rgb]).
|
|
994 |
pad := rowBytes * 8 - (bounds width * pixelSize).
|
|
995 |
pad >= 8
|
|
996 |
ifTrue: [pad >= 16
|
|
997 |
ifTrue: [pad := 32]
|
|
998 |
ifFalse: [pad := 16]]
|
|
999 |
ifFalse: [pad := 8].
|
|
1000 |
anImage := Image
|
|
1001 |
extent: bounds width @ bounds height
|
|
1002 |
depth: pixelSize
|
|
1003 |
palette: aPalette
|
|
1004 |
bits: pixData
|
|
1005 |
pad: pad.
|
|
1006 |
" self debug: [anImage displayOn: ScheduledControllers activeController view graphicsContext]. "
|
1849
|
1007 |
"/ OLD:
|
|
1008 |
"/ anArray := Array
|
|
1009 |
"/ with: anImage
|
|
1010 |
"/ with: srcRect
|
|
1011 |
"/ with: dstRect
|
|
1012 |
"/ with: mode.
|
|
1013 |
"/ isMaskRgn = true ifTrue: [anArray := anArray , (Array with: maskRgn)].
|
|
1014 |
"/ NEW:
|
|
1015 |
anArray := PICTFrame new
|
|
1016 |
image:anImage
|
|
1017 |
sourceRectangle:srcRect
|
|
1018 |
destinationRectangle:dstRect
|
|
1019 |
mode:mode.
|
|
1020 |
isMaskRgn = true ifTrue: [
|
|
1021 |
anArray maskRegion:maskRgn
|
|
1022 |
].
|
1806
|
1023 |
^anArray
|
|
1024 |
!
|
|
1025 |
|
|
1026 |
readPixRowData
|
|
1027 |
packType = 0 ifTrue: [^self readBitRowData].
|
|
1028 |
packType = 1 ifTrue: [^self readBitRowData].
|
|
1029 |
^self errorCanNotRead
|
|
1030 |
!
|
|
1031 |
|
|
1032 |
readPoint
|
|
1033 |
| x y point |
|
|
1034 |
x := self nextWord.
|
|
1035 |
y := self nextWord.
|
|
1036 |
point := x @ y.
|
|
1037 |
^point
|
|
1038 |
!
|
|
1039 |
|
|
1040 |
readPolygon
|
|
1041 |
| length bytes |
|
|
1042 |
length := self nextWord.
|
|
1043 |
bytes := self next: length - 2.
|
1807
|
1044 |
" self
|
1806
|
1045 |
debug:
|
|
1046 |
[Transcript space; show: length printString.
|
1807
|
1047 |
Transcript space; show: bytes printString]. "
|
1806
|
1048 |
^Array with: length with: bytes
|
|
1049 |
!
|
|
1050 |
|
|
1051 |
readRect
|
|
1052 |
| top left bottom right rect |
|
|
1053 |
top := self nextWord.
|
|
1054 |
left := self nextWord.
|
|
1055 |
bottom := self nextWord.
|
|
1056 |
right := self nextWord.
|
|
1057 |
rect := left @ top corner: right @ bottom.
|
|
1058 |
^rect
|
|
1059 |
!
|
|
1060 |
|
|
1061 |
readRegion
|
|
1062 |
| length bytes |
|
|
1063 |
length := self nextWord.
|
|
1064 |
bytes := self next: length - 2.
|
1807
|
1065 |
" self debug:
|
|
1066 |
[Transcript space; show: length printString.
|
|
1067 |
Transcript space; show: bytes printString]. "
|
1806
|
1068 |
^Array with: length with: bytes
|
|
1069 |
! !
|
|
1070 |
|
|
1071 |
!PICTReader methodsFor:'encoding'!
|
|
1072 |
|
|
1073 |
bitData: bitData
|
|
1074 |
| imageRowBytes packStream |
|
|
1075 |
imageRowBytes := bounds width * pixelSize + 31 // 32 * 4.
|
|
1076 |
packStream := WriteStream on: (ByteArray new: bitData size).
|
|
1077 |
self progress: 0.
|
|
1078 |
1 to: bounds height
|
|
1079 |
do:
|
|
1080 |
[:h |
|
|
1081 |
| rowBits packedBits |
|
|
1082 |
rowBits := bitData copyFrom: h - 1 * imageRowBytes + 1 to: h - 1 * imageRowBytes + rowBytes.
|
|
1083 |
rowBytes < 8
|
|
1084 |
ifTrue: [packStream nextPutAll: rowBits]
|
|
1085 |
ifFalse:
|
|
1086 |
[packedBits := self packBits: rowBits.
|
|
1087 |
rowBytes > 250
|
|
1088 |
ifTrue:
|
|
1089 |
[packStream nextPut: ((packedBits size bitShift: -8)
|
|
1090 |
bitAnd: 255).
|
|
1091 |
packStream nextPut: (packedBits size bitAnd: 255)]
|
|
1092 |
ifFalse: [packStream nextPut: packedBits size].
|
|
1093 |
packStream nextPutAll: packedBits].
|
|
1094 |
self progress: h / bounds height].
|
|
1095 |
^packStream contents
|
|
1096 |
!
|
|
1097 |
|
|
1098 |
directPixData4: anImage
|
|
1099 |
| packStream palette r g b index color scalingValue stream |
|
|
1100 |
packStream := WriteStream on: (ByteArray new: anImage bits size).
|
|
1101 |
palette := anImage palette.
|
|
1102 |
self progress: 0.
|
|
1103 |
0 to: bounds height - 1
|
|
1104 |
do:
|
|
1105 |
[:y |
|
|
1106 |
r := WriteStream on: ByteArray new.
|
|
1107 |
g := WriteStream on: ByteArray new.
|
|
1108 |
b := WriteStream on: ByteArray new.
|
|
1109 |
0 to: bounds width - 1
|
|
1110 |
do:
|
|
1111 |
[:x |
|
|
1112 |
index := anImage atX: x y: y.
|
|
1113 |
(palette includesKey: index)
|
|
1114 |
ifTrue: [color := palette at: index]
|
|
1115 |
ifFalse: [color := palette at: (index bitAnd: palette maxIndex)].
|
|
1116 |
scalingValue := ColorValue scalingValue.
|
|
1117 |
r nextPut: (self
|
|
1118 |
convertValue: color scaledRed
|
|
1119 |
from: scalingValue
|
|
1120 |
to: 255).
|
|
1121 |
g nextPut: (self
|
|
1122 |
convertValue: color scaledGreen
|
|
1123 |
from: scalingValue
|
|
1124 |
to: 255).
|
|
1125 |
b nextPut: (self
|
|
1126 |
convertValue: color scaledBlue
|
|
1127 |
from: scalingValue
|
|
1128 |
to: 255)].
|
|
1129 |
stream := WriteStream on: ByteArray new.
|
|
1130 |
stream nextPutAll: r contents.
|
|
1131 |
stream nextPutAll: g contents.
|
|
1132 |
stream nextPutAll: b contents.
|
|
1133 |
packStream nextPutAll: (self directPixRowData: stream contents).
|
|
1134 |
self progress: y / (bounds height - 1)].
|
|
1135 |
^packStream contents
|
|
1136 |
!
|
|
1137 |
|
|
1138 |
directPixRowData: row
|
|
1139 |
| aStream rawData byteCount |
|
|
1140 |
aStream := WriteStream on: (ByteArray new: row size).
|
|
1141 |
rawData := self packBits: row.
|
|
1142 |
byteCount := rawData size.
|
|
1143 |
rowBytes > 250
|
|
1144 |
ifTrue:
|
|
1145 |
[aStream nextPut: ((byteCount bitShift: -8)
|
|
1146 |
bitAnd: 255).
|
|
1147 |
aStream nextPut: (byteCount bitAnd: 255)]
|
|
1148 |
ifFalse: [aStream nextPut: byteCount].
|
|
1149 |
aStream nextPutAll: rawData.
|
|
1150 |
^aStream contents
|
|
1151 |
!
|
|
1152 |
|
|
1153 |
nextPutImage24: image
|
|
1154 |
| anImage endOpcode |
|
|
1155 |
Cursor wait showWhile: [anImage := image "convertToPalette: (FixedPalette
|
|
1156 |
redShift: 16
|
|
1157 |
redMask: 255
|
|
1158 |
greenShift: 8
|
|
1159 |
greenMask: 255
|
|
1160 |
blueShift: 0
|
|
1161 |
blueMask: 255)
|
|
1162 |
renderedBy: ErrorDiffusion new"].
|
1807
|
1163 |
baseAddr := 16r000000FF.
|
1806
|
1164 |
rowBytes := anImage width * 32 + 7 // 8.
|
|
1165 |
bounds := anImage bounds.
|
|
1166 |
pmVersion := 0.
|
|
1167 |
packType := 4.
|
|
1168 |
packSize := 0.
|
1807
|
1169 |
hRes := 16r00480000.
|
|
1170 |
vRes := 16r00480000.
|
1806
|
1171 |
pixelType := 16.
|
|
1172 |
pixelSize := 32.
|
|
1173 |
cmpCount := 3.
|
|
1174 |
cmpSize := 8.
|
|
1175 |
planeBytes := 0.
|
|
1176 |
pmTable := 0.
|
|
1177 |
pmReserved := 0.
|
|
1178 |
srcRect := anImage bounds.
|
|
1179 |
dstRect := anImage bounds.
|
|
1180 |
mode := 64.
|
1807
|
1181 |
endOpcode := 16r00FF.
|
1806
|
1182 |
self writeImage24: anImage.
|
|
1183 |
self writeOpcode: endOpcode.
|
|
1184 |
^anImage
|
|
1185 |
!
|
|
1186 |
|
|
1187 |
sortPalette: image
|
|
1188 |
| max array color |
|
|
1189 |
max := 1 bitShift: pixelSize.
|
|
1190 |
array := Array new: image palette maxIndex + 1.
|
|
1191 |
1 to: array size
|
|
1192 |
do:
|
|
1193 |
[:i |
|
|
1194 |
color := image palette at: i - 1 ifAbsent: [ColorValue white].
|
|
1195 |
array at: i put: (self rgbIntegerFrom: color)].
|
|
1196 |
array size > max
|
|
1197 |
ifTrue: [array := array copyFrom: 1 to: max]
|
|
1198 |
ifFalse: [array size < max ifTrue: [array := array , (Array new: max - array size withAll: 0)]].
|
|
1199 |
array := array asSortedCollection reverse collect: [:rgb | self colorValueFrom: rgb].
|
|
1200 |
^image convertToPalette: (MappedPalette withColors: array)
|
|
1201 |
!
|
|
1202 |
|
|
1203 |
writeBits24: bits
|
|
1204 |
| currentOpecode |
|
1807
|
1205 |
currentOpecode := 16r009A.
|
1806
|
1206 |
self writeOpcode: currentOpecode.
|
|
1207 |
self nextLongPut: baseAddr.
|
|
1208 |
self nextWordPut: rowBytes + (1 bitShift: 15).
|
|
1209 |
self writeRect: bounds.
|
|
1210 |
self nextWordPut: pmVersion.
|
|
1211 |
self nextWordPut: packType.
|
|
1212 |
self nextLongPut: packSize.
|
|
1213 |
self nextLongPut: hRes.
|
|
1214 |
self nextLongPut: vRes.
|
|
1215 |
self nextWordPut: pixelType.
|
|
1216 |
self nextWordPut: pixelSize.
|
|
1217 |
self nextWordPut: cmpCount.
|
|
1218 |
self nextWordPut: cmpSize.
|
|
1219 |
self nextLongPut: planeBytes.
|
|
1220 |
self nextLongPut: pmTable.
|
|
1221 |
self nextLongPut: pmReserved.
|
|
1222 |
self writeRect: srcRect.
|
|
1223 |
self writeRect: dstRect.
|
|
1224 |
self nextWordPut: mode.
|
|
1225 |
self nextPutAll: bits
|
|
1226 |
!
|
|
1227 |
|
|
1228 |
writeBits: bits palette: palette
|
|
1229 |
rowBytes < 8
|
1807
|
1230 |
ifTrue: [currentOpcode := 16r90]
|
|
1231 |
ifFalse: [currentOpcode := 16r0098].
|
1806
|
1232 |
picVersion = 1
|
|
1233 |
ifTrue:
|
|
1234 |
[self writeOpcode: currentOpcode.
|
|
1235 |
self nextWordPut: rowBytes.
|
|
1236 |
self writeRect: bounds.
|
|
1237 |
self writeRect: srcRect.
|
|
1238 |
self writeRect: dstRect.
|
|
1239 |
self nextWordPut: mode.
|
|
1240 |
self nextPutAll: bits]
|
|
1241 |
ifFalse:
|
|
1242 |
[self writeOpcode: currentOpcode.
|
|
1243 |
self nextWordPut: rowBytes + (1 bitShift: 15).
|
|
1244 |
self writeRect: bounds.
|
|
1245 |
self nextWordPut: pmVersion.
|
|
1246 |
self nextWordPut: packType.
|
|
1247 |
self nextLongPut: packSize.
|
|
1248 |
self nextLongPut: hRes.
|
|
1249 |
self nextLongPut: vRes.
|
|
1250 |
self nextWordPut: pixelType.
|
|
1251 |
self nextWordPut: pixelSize.
|
|
1252 |
self nextWordPut: cmpCount.
|
|
1253 |
self nextWordPut: cmpSize.
|
|
1254 |
self nextLongPut: planeBytes.
|
|
1255 |
self nextLongPut: pmTable.
|
|
1256 |
self nextLongPut: pmReserved.
|
|
1257 |
self nextLongPut: ctSeed.
|
|
1258 |
self nextWordPut: ctFlags.
|
|
1259 |
self nextWordPut: ctSize.
|
|
1260 |
ctTable := Array new: palette maxIndex + 1.
|
|
1261 |
1 to: ctTable size
|
|
1262 |
do:
|
|
1263 |
[:i |
|
|
1264 |
| color value rgb |
|
|
1265 |
color := palette at: i - 1 ifAbsent: [ColorValue white].
|
|
1266 |
value := 0.
|
|
1267 |
rgb := self rgbIntegerFrom: color.
|
|
1268 |
ctTable at: i put: rgb.
|
|
1269 |
self nextWordPut: value.
|
|
1270 |
self nextWordPut: ((rgb bitShift: -32)
|
|
1271 |
bitAnd: 65535).
|
|
1272 |
self nextWordPut: ((rgb bitShift: -16)
|
|
1273 |
bitAnd: 65535).
|
|
1274 |
self nextWordPut: (rgb bitAnd: 65535)].
|
|
1275 |
self writeRect: srcRect.
|
|
1276 |
self writeRect: dstRect.
|
|
1277 |
self nextWordPut: mode.
|
|
1278 |
self nextPutAll: bits]
|
|
1279 |
!
|
|
1280 |
|
|
1281 |
writeClip: aRectangle
|
|
1282 |
picVersion = 1
|
1807
|
1283 |
ifTrue: [self writeOpcode: 16r01]
|
|
1284 |
ifFalse: [self writeOpcode: 16r0001].
|
1806
|
1285 |
self nextWordPut: 10.
|
|
1286 |
self writeRect: aRectangle
|
|
1287 |
!
|
|
1288 |
|
|
1289 |
writeHeader24: bits
|
|
1290 |
| pictCodeSize |
|
|
1291 |
pictCodeSize := 2.
|
|
1292 |
picSize := 40.
|
|
1293 |
picSize := picSize + pictCodeSize.
|
|
1294 |
picSize := picSize + pictCodeSize + 10.
|
|
1295 |
picSize := picSize + pictCodeSize + 68 + bits size.
|
|
1296 |
bits size odd ifTrue: [picSize := picSize + 1].
|
|
1297 |
picSize := picSize + pictCodeSize.
|
|
1298 |
self nextWordPut: picSize \\ 65535.
|
|
1299 |
self writeRect: picFrame.
|
|
1300 |
self nextWordPut: 17.
|
|
1301 |
self nextWordPut: 767.
|
|
1302 |
self nextWordPut: 3072.
|
|
1303 |
1 to: 2 do: [:i | self nextWordPut: 65535].
|
|
1304 |
1 to: 4 do: [:i | self nextWordPut: 0].
|
|
1305 |
self nextWordPut: picFrame width.
|
|
1306 |
1 to: 1 do: [:i | self nextWordPut: 0].
|
|
1307 |
self nextWordPut: picFrame height.
|
|
1308 |
1 to: 3 do: [:i | self nextWordPut: 0]
|
|
1309 |
!
|
|
1310 |
|
|
1311 |
writeHeader: bits palette: palette
|
|
1312 |
| pictCodeSize |
|
|
1313 |
picVersion = 1
|
|
1314 |
ifTrue:
|
|
1315 |
[pictCodeSize := 1.
|
|
1316 |
picSize := 12.
|
|
1317 |
picSize := picSize + pictCodeSize + 10.
|
|
1318 |
picSize := picSize + pictCodeSize + 10 + 8 + 8 + 2 + bits size.
|
|
1319 |
picSize := picSize + pictCodeSize]
|
|
1320 |
ifFalse:
|
|
1321 |
[pictCodeSize := 2.
|
|
1322 |
picSize := 40.
|
|
1323 |
picSize := picSize + pictCodeSize.
|
|
1324 |
picSize := picSize + pictCodeSize + 10.
|
|
1325 |
picSize := picSize + pictCodeSize + 46 + 8 + (palette maxIndex + 1 * 8) + 8 + 8 + 2 + bits size.
|
|
1326 |
bits size odd ifTrue: [picSize := picSize + 1].
|
|
1327 |
picSize := picSize + pictCodeSize].
|
|
1328 |
self nextWordPut: picSize \\ 65535.
|
|
1329 |
self writeRect: picFrame.
|
|
1330 |
picVersion = 1
|
|
1331 |
ifTrue:
|
|
1332 |
[self nextPut: 17.
|
|
1333 |
self nextPut: 1]
|
|
1334 |
ifFalse:
|
|
1335 |
[self nextWordPut: 17.
|
|
1336 |
self nextWordPut: 767.
|
|
1337 |
self nextWordPut: 3072.
|
|
1338 |
1 to: 2 do: [:i | self nextWordPut: 65535].
|
|
1339 |
1 to: 4 do: [:i | self nextWordPut: 0].
|
|
1340 |
self nextWordPut: picFrame width.
|
|
1341 |
1 to: 1 do: [:i | self nextWordPut: 0].
|
|
1342 |
self nextWordPut: picFrame height.
|
|
1343 |
1 to: 3 do: [:i | self nextWordPut: 0]]
|
|
1344 |
!
|
|
1345 |
|
|
1346 |
writeImage24: anImage
|
|
1347 |
| bits |
|
|
1348 |
bits := self directPixData4: anImage.
|
|
1349 |
self writeHeader24: ByteArray new.
|
|
1350 |
self writeClip: bounds.
|
|
1351 |
self writeBits24: bits.
|
|
1352 |
^anImage
|
|
1353 |
!
|
|
1354 |
|
|
1355 |
writeImage: anImage
|
|
1356 |
| image bits |
|
|
1357 |
image := self sortPalette: anImage.
|
|
1358 |
bits := self bitData: image bits.
|
|
1359 |
self writeHeader: bits palette: image palette.
|
|
1360 |
self writeClip: bounds.
|
|
1361 |
self writeBits: bits palette: image palette.
|
|
1362 |
^anImage
|
|
1363 |
!
|
|
1364 |
|
|
1365 |
writeOpcode: opcode
|
|
1366 |
picVersion = 1
|
|
1367 |
ifTrue: [self nextPut: opcode]
|
|
1368 |
ifFalse:
|
|
1369 |
[self position odd ifTrue: [self nextPut: 0].
|
|
1370 |
self nextWordPut: opcode]
|
|
1371 |
!
|
|
1372 |
|
|
1373 |
writeRect: aRectangle
|
|
1374 |
self nextWordPut: aRectangle top.
|
|
1375 |
self nextWordPut: aRectangle left.
|
|
1376 |
self nextWordPut: aRectangle bottom.
|
|
1377 |
self nextWordPut: aRectangle right
|
|
1378 |
! !
|
|
1379 |
|
|
1380 |
!PICTReader methodsFor:'interpreting'!
|
|
1381 |
|
|
1382 |
fixedOpcode: opcodeName additionalData: additionalData
|
1807
|
1383 |
| bytes |
|
|
1384 |
|
|
1385 |
" self debug: [Transcript space; show: opcodeName]. "
|
|
1386 |
bytes := self next: additionalData.
|
|
1387 |
" self debug: [Transcript space; show: bytes printString] "
|
1806
|
1388 |
!
|
|
1389 |
|
|
1390 |
interpretOpcode: association
|
|
1391 |
| opcodeName additionalData |
|
|
1392 |
opcodeName := association key.
|
|
1393 |
additionalData := association value.
|
1807
|
1394 |
|
|
1395 |
self debug:[ Transcript show: 'op:'; show:opcodeName; show:' ['; show:additionalData; show:']'; cr ].
|
|
1396 |
|
1806
|
1397 |
additionalData isString
|
|
1398 |
ifTrue: [self variableOpcode: opcodeName additionalData: additionalData]
|
|
1399 |
ifFalse: [self fixedOpcode: opcodeName additionalData: additionalData]
|
|
1400 |
!
|
|
1401 |
|
|
1402 |
nextOpcode
|
|
1403 |
| association |
|
1807
|
1404 |
" self debug: [Transcript cr.
|
|
1405 |
Transcript show: (self hexString4: self position).
|
|
1406 |
Transcript show: ':']. "
|
1806
|
1407 |
picVersion = 1
|
|
1408 |
ifTrue: [currentOpcode := self next]
|
|
1409 |
ifFalse:
|
|
1410 |
[self position odd ifTrue: [self next].
|
|
1411 |
currentOpcode := self nextWord].
|
|
1412 |
association := self class opcodeAt: currentOpcode.
|
|
1413 |
association isNil ifTrue: [^self errorUnexpectedOpcode].
|
|
1414 |
self interpretOpcode: association.
|
|
1415 |
^association
|
|
1416 |
!
|
|
1417 |
|
|
1418 |
variableOpcode: opcodeName additionalData: additionalData
|
|
1419 |
| aSymbol |
|
1807
|
1420 |
|
|
1421 |
" self debug: [Transcript space; show: opcodeName]. "
|
1806
|
1422 |
additionalData = 'Polygon size' ifTrue: [^self readPolygon].
|
|
1423 |
additionalData = 'Region size' ifTrue: [^self readRegion].
|
|
1424 |
additionalData = '2 + data length' ifTrue: [^self readDataLength2].
|
|
1425 |
additionalData = '4 + data length' ifTrue: [^self readDataLength4].
|
1807
|
1426 |
|
1806
|
1427 |
(opcodeName copyFrom: 1 to: ('Apple' size min: opcodeName size))
|
|
1428 |
= 'Apple' ifTrue: [^self errorUnexpectedOpcode].
|
|
1429 |
aSymbol := ((String with: $x with: opcodeName first asUppercase)
|
|
1430 |
, (opcodeName copyFrom: 2 to: opcodeName size)) asSymbol.
|
|
1431 |
(self respondsTo: aSymbol)
|
|
1432 |
ifTrue: [^self perform: aSymbol].
|
|
1433 |
^self errorUnexpectedOpcode
|
|
1434 |
! !
|
|
1435 |
|
|
1436 |
!PICTReader methodsFor:'printing'!
|
|
1437 |
|
|
1438 |
hexString2: aNumber
|
|
1439 |
| aString aStream |
|
|
1440 |
aString := aNumber printStringRadix: 16.
|
|
1441 |
aStream := WriteStream on: (String new: 12).
|
|
1442 |
aStream nextPutAll: '16r'.
|
|
1443 |
2 - aString size timesRepeat: [aStream nextPutAll: '0'].
|
|
1444 |
aStream nextPutAll: aString.
|
|
1445 |
^aStream contents
|
|
1446 |
!
|
|
1447 |
|
|
1448 |
hexString4: aNumber
|
|
1449 |
| aString aStream |
|
|
1450 |
aString := aNumber printStringRadix: 16.
|
|
1451 |
aStream := WriteStream on: (String new: 12).
|
|
1452 |
aStream nextPutAll: '16r'.
|
|
1453 |
4 - aString size timesRepeat: [aStream nextPutAll: '0'].
|
|
1454 |
aStream nextPutAll: aString.
|
|
1455 |
^aStream contents
|
|
1456 |
!
|
|
1457 |
|
|
1458 |
hexString8: aNumber
|
|
1459 |
| aString aStream |
|
|
1460 |
aString := aNumber printStringRadix: 16.
|
|
1461 |
aStream := WriteStream on: (String new: 12).
|
|
1462 |
aStream nextPutAll: '16r'.
|
|
1463 |
8 - aString size timesRepeat: [aStream nextPutAll: '0'].
|
|
1464 |
aStream nextPutAll: aString.
|
|
1465 |
^aStream contents
|
|
1466 |
! !
|
|
1467 |
|
|
1468 |
!PICTReader methodsFor:'private'!
|
|
1469 |
|
|
1470 |
colorValueFrom: rgbInteger
|
|
1471 |
| scalingValue |
|
1849
|
1472 |
|
|
1473 |
^ Color
|
|
1474 |
redShort:((rgbInteger bitShift: -32) bitAnd: 65535)
|
|
1475 |
greenShort:((rgbInteger bitShift: -16) bitAnd: 65535)
|
|
1476 |
blueShort:(rgbInteger bitAnd: 65535)
|
|
1477 |
|
|
1478 |
"/ scalingValue := ColorValue scalingValue.
|
|
1479 |
"/ ^ColorValue
|
|
1480 |
"/ scaledRed: (self
|
|
1481 |
"/ convertValue: ((rgbInteger bitShift: -32)
|
|
1482 |
"/ bitAnd: 65535)
|
|
1483 |
"/ from: 65535
|
|
1484 |
"/ to: scalingValue)
|
|
1485 |
"/ scaledGreen: (self
|
|
1486 |
"/ convertValue: ((rgbInteger bitShift: -16)
|
|
1487 |
"/ bitAnd: 65535)
|
|
1488 |
"/ from: 65535
|
|
1489 |
"/ to: scalingValue)
|
|
1490 |
"/ scaledBlue: (self
|
|
1491 |
"/ convertValue: (rgbInteger bitAnd: 65535)
|
|
1492 |
"/ from: 65535
|
|
1493 |
"/ to: scalingValue)
|
1806
|
1494 |
!
|
|
1495 |
|
|
1496 |
errorSorryNotSupported
|
|
1497 |
self error: 'sorry, not supported'.
|
|
1498 |
^nil
|
|
1499 |
!
|
|
1500 |
|
|
1501 |
errorUnexpectedOpcode
|
|
1502 |
| string |
|
|
1503 |
picVersion = 1
|
|
1504 |
ifTrue: [string := self hexString2: currentOpcode]
|
|
1505 |
ifFalse: [string := self hexString4: currentOpcode].
|
|
1506 |
string := (self hexString8: self position)
|
|
1507 |
, ': ' , string.
|
|
1508 |
self error: 'unexpected opcode: ' , string.
|
|
1509 |
^nil
|
|
1510 |
!
|
|
1511 |
|
|
1512 |
errorUnexpectedPakingType
|
|
1513 |
self error: 'unexpected packing type: ' , packType printString.
|
|
1514 |
^nil
|
|
1515 |
!
|
|
1516 |
|
|
1517 |
mergeImages
|
|
1518 |
| aRectangle aDepth aPalette anImage aPattern indexValue |
|
|
1519 |
aRectangle := nil.
|
|
1520 |
aDepth := nil.
|
|
1521 |
aPalette := nil.
|
|
1522 |
imageSequence
|
|
1523 |
do:
|
|
1524 |
[:array |
|
|
1525 |
aRectangle isNil
|
|
1526 |
ifTrue: [aRectangle := array at: 3]
|
|
1527 |
ifFalse: [aRectangle := aRectangle merge: (array at: 3)].
|
|
1528 |
aDepth isNil
|
|
1529 |
ifTrue:
|
|
1530 |
[aDepth := (array at: 1) depth.
|
|
1531 |
aPalette := (array at: 1) palette]
|
|
1532 |
ifFalse: [aDepth < (array at: 1) depth
|
|
1533 |
ifTrue:
|
|
1534 |
[aDepth := (array at: 1) depth.
|
|
1535 |
aPalette := (array at: 1) palette]]].
|
|
1536 |
anImage := Image
|
|
1537 |
extent: aRectangle extent
|
|
1538 |
depth: aDepth
|
|
1539 |
palette: aPalette.
|
|
1540 |
aPattern := Image
|
|
1541 |
extent: 16 @ 16
|
|
1542 |
depth: anImage depth
|
|
1543 |
palette: anImage palette.
|
|
1544 |
indexValue := aPattern palette indexOfPaintNearest: ColorValue white.
|
|
1545 |
0 to: aPattern width - 1 do: [:x | 0 to: aPattern height - 1 do: [:y | aPattern atPoint: x @ y put: indexValue]].
|
|
1546 |
anImage
|
|
1547 |
tile: aRectangle
|
|
1548 |
from: Point zero
|
|
1549 |
in: aPattern
|
|
1550 |
rule: RasterOp over.
|
|
1551 |
imageSequence
|
|
1552 |
do:
|
|
1553 |
[:array |
|
|
1554 |
| srcImage srcR dstR |
|
|
1555 |
srcImage := array at: 1.
|
|
1556 |
srcR := array at: 2.
|
|
1557 |
dstR := array at: 3.
|
|
1558 |
srcImage palette = aPalette ifFalse: [srcImage := srcImage convertToPalette: aPalette renderedBy: ErrorDiffusion new].
|
|
1559 |
dstR := dstR translatedBy: Point zero - aRectangle origin.
|
|
1560 |
anImage
|
|
1561 |
copy: dstR
|
|
1562 |
from: srcR origin
|
|
1563 |
in: srcImage
|
|
1564 |
rule: RasterOp over].
|
|
1565 |
^anImage
|
|
1566 |
!
|
|
1567 |
|
|
1568 |
packBits: bits
|
|
1569 |
| packStream prev writeBlock bitSize bitPos start code replicateSize literalSize |
|
|
1570 |
packStream := WriteStream on: (ByteArray new: bits size).
|
|
1571 |
prev := nil.
|
|
1572 |
writeBlock := [:asc | asc key < 0
|
|
1573 |
ifTrue:
|
|
1574 |
["replicate"
|
|
1575 |
packStream nextPut: asc key negated.
|
|
1576 |
packStream nextPut: asc value]
|
|
1577 |
ifFalse:
|
|
1578 |
["literal"
|
|
1579 |
| litStart litStop |
|
|
1580 |
litStart := asc value first.
|
|
1581 |
litStop := asc value last.
|
|
1582 |
asc key = (litStop - litStart) ifFalse: [self error: 'can''t happen'].
|
|
1583 |
[litStop - litStart + 1 > 128]
|
|
1584 |
whileTrue:
|
|
1585 |
[packStream nextPut: 127.
|
|
1586 |
litStart to: litStart + 127 do: [:litIndex | packStream nextPut: (bits at: litIndex)].
|
|
1587 |
litStart := litStart + 128].
|
|
1588 |
litStart <= litStop
|
|
1589 |
ifTrue:
|
|
1590 |
[packStream nextPut: litStop - litStart + 1 - 1.
|
|
1591 |
litStart to: litStop do: [:litIndex | packStream nextPut: (bits at: litIndex)]]]].
|
|
1592 |
bitSize := bits size.
|
|
1593 |
bitPos := 1.
|
|
1594 |
[bitPos <= bitSize]
|
|
1595 |
whileTrue:
|
|
1596 |
[start := bitPos.
|
|
1597 |
code := bits at: start.
|
|
1598 |
[(bitPos := bitPos + 1) <= bitSize and: [(bits at: bitPos)
|
|
1599 |
= code]]
|
|
1600 |
whileTrue: [].
|
|
1601 |
replicateSize := bitPos - start.
|
|
1602 |
replicateSize > 128
|
|
1603 |
ifTrue:
|
|
1604 |
[prev == nil
|
|
1605 |
ifFalse:
|
|
1606 |
[writeBlock value: prev.
|
|
1607 |
prev := nil].
|
|
1608 |
[replicateSize > 128]
|
|
1609 |
whileTrue:
|
|
1610 |
[writeBlock value: -129 -> code.
|
|
1611 |
start := start + 128.
|
|
1612 |
replicateSize := replicateSize - 128]].
|
|
1613 |
replicateSize = 2
|
|
1614 |
ifTrue:
|
|
1615 |
["treat as literal"
|
|
1616 |
literalSize := 2.
|
|
1617 |
prev ~~ nil ifTrue: [prev key >= 0
|
|
1618 |
ifTrue:
|
|
1619 |
["prev is literal"
|
|
1620 |
literalSize := literalSize + prev value size.
|
|
1621 |
start := prev value first]
|
|
1622 |
ifFalse:
|
|
1623 |
[writeBlock value: prev.
|
|
1624 |
prev := nil]].
|
|
1625 |
prev := literalSize - 1 -> (start to: start + literalSize - 1)]
|
|
1626 |
ifFalse: [replicateSize > 2
|
|
1627 |
ifTrue:
|
|
1628 |
[prev == nil
|
|
1629 |
ifFalse:
|
|
1630 |
[writeBlock value: prev.
|
|
1631 |
prev := nil].
|
|
1632 |
prev := (256 - (replicateSize - 1)) negated -> code]
|
|
1633 |
ifFalse: ["replicateSize < 2"
|
|
1634 |
bitPos := bitPos - 1]].
|
|
1635 |
(start := bitPos) <= bitSize
|
|
1636 |
ifTrue:
|
|
1637 |
[code := bits at: start.
|
|
1638 |
[(bitPos := bitPos + 1) <= bitSize and: [(bits at: bitPos)
|
|
1639 |
~= code]]
|
|
1640 |
whileTrue: [code := bits at: bitPos].
|
|
1641 |
bitPos <= bitSize ifTrue: [bitPos := bitPos - 1].
|
|
1642 |
literalSize := bitPos - start.
|
|
1643 |
literalSize > 0
|
|
1644 |
ifTrue:
|
|
1645 |
[prev ~~ nil ifTrue: [prev key >= 0
|
|
1646 |
ifTrue:
|
|
1647 |
["prev is literal"
|
|
1648 |
literalSize := literalSize + prev value size.
|
|
1649 |
start := prev value first]
|
|
1650 |
ifFalse:
|
|
1651 |
[writeBlock value: prev.
|
|
1652 |
prev := nil]].
|
|
1653 |
prev := literalSize - 1 -> (start to: start + literalSize - 1)]]].
|
|
1654 |
prev == nil
|
|
1655 |
ifFalse:
|
|
1656 |
[writeBlock value: prev.
|
|
1657 |
prev := nil].
|
|
1658 |
^packStream contents
|
|
1659 |
!
|
|
1660 |
|
1849
|
1661 |
progress:fraction
|
|
1662 |
self reportProgress:fraction
|
|
1663 |
!
|
|
1664 |
|
1806
|
1665 |
rgbIntegerFrom: aColorValue
|
|
1666 |
| scalingValue |
|
|
1667 |
scalingValue := ColorValue scalingValue.
|
|
1668 |
^((self
|
|
1669 |
convertValue: aColorValue scaledRed
|
|
1670 |
from: scalingValue
|
|
1671 |
to: 65535)
|
|
1672 |
bitShift: 32)
|
|
1673 |
+ ((self
|
|
1674 |
convertValue: aColorValue scaledGreen
|
|
1675 |
from: scalingValue
|
|
1676 |
to: 65535)
|
|
1677 |
bitShift: 16) + (self
|
|
1678 |
convertValue: aColorValue scaledBlue
|
|
1679 |
from: scalingValue
|
|
1680 |
to: 65535)
|
|
1681 |
!
|
|
1682 |
|
|
1683 |
unPackBits: bits
|
|
1684 |
| unpackStream bitSize bitPos code |
|
|
1685 |
unpackStream := WriteStream on: (ByteArray new: bits size).
|
|
1686 |
bitSize := bits size.
|
|
1687 |
bitPos := 0.
|
|
1688 |
[(bitPos := bitPos + 1) <= bitSize]
|
|
1689 |
whileTrue:
|
|
1690 |
[code := bits at: bitPos.
|
|
1691 |
code < 128
|
|
1692 |
ifTrue: [1 to: code + 1 do: [:i | unpackStream nextPut: (bits at: (bitPos := bitPos + 1))]]
|
|
1693 |
ifFalse: [code > 128
|
|
1694 |
ifTrue:
|
|
1695 |
[bitPos := bitPos + 1.
|
|
1696 |
1 to: 256 - code + 1 do: [:i | unpackStream nextPut: (bits at: bitPos)]]]].
|
|
1697 |
^unpackStream contents
|
|
1698 |
! !
|
|
1699 |
|
|
1700 |
!PICTReader methodsFor:'reading'!
|
1804
|
1701 |
|
|
1702 |
fromStream: aStream
|
|
1703 |
"read an image in my format from aStream.
|
|
1704 |
Dtermine if its a raster or icon file."
|
|
1705 |
|
1806
|
1706 |
|endOpcode|
|
1804
|
1707 |
|
1816
|
1708 |
"/ ^ self fileFormatError:'Sorry - PICT image implementation is incomplete'.
|
1807
|
1709 |
|
1804
|
1710 |
inStream := aStream.
|
|
1711 |
aStream binary.
|
|
1712 |
|
1806
|
1713 |
inStream skip:512. "apples file header"
|
1804
|
1714 |
|
1806
|
1715 |
currentOpcode := nil.
|
|
1716 |
imageSequence := OrderedCollection new.
|
|
1717 |
self readHeader.
|
1849
|
1718 |
self reportDimension.
|
1806
|
1719 |
endOpcode := 16r00FF.
|
1843
|
1720 |
[currentOpcode = endOpcode] whileFalse: [self nextOpcode].
|
|
1721 |
|
1806
|
1722 |
imageSequence isEmpty ifTrue: [^nil].
|
1807
|
1723 |
imageSequence size = 1 ifTrue: [
|
1849
|
1724 |
"/ OLD:
|
|
1725 |
"/ ^ imageSequence first first
|
|
1726 |
"/ NEW:
|
|
1727 |
^ imageSequence first image
|
1807
|
1728 |
].
|
1806
|
1729 |
^ self mergeImages
|
1804
|
1730 |
|
|
1731 |
"
|
1849
|
1732 |
PICTReader fromFile:'/unsaved2/stefan/nil/home/stefan/dos/winword/shared/ms.pct'
|
1804
|
1733 |
"
|
1806
|
1734 |
! !
|
1804
|
1735 |
|
1807
|
1736 |
!PICTReader methodsFor:'support-IO'!
|
|
1737 |
|
|
1738 |
next
|
|
1739 |
^ inStream nextByte
|
|
1740 |
!
|
|
1741 |
|
|
1742 |
next:numBytes
|
|
1743 |
^ inStream next:numBytes
|
|
1744 |
!
|
|
1745 |
|
|
1746 |
nextLong
|
|
1747 |
"/ ^ (inStream next bitShift: 24)
|
|
1748 |
"/ + (inStream next bitShift: 16) + (inStream next bitShift: 8) + inStream next
|
|
1749 |
^ inStream nextUnsignedLongMSB:true
|
|
1750 |
!
|
|
1751 |
|
|
1752 |
nextLongPut:a32BitW
|
|
1753 |
"/ outStream nextPut: ((a32BitW bitShift: -24)
|
|
1754 |
"/ bitAnd: 255).
|
|
1755 |
"/ outStream nextPut: ((a32BitW bitShift: -16)
|
|
1756 |
"/ bitAnd: 255).
|
|
1757 |
"/ outStream nextPut: ((a32BitW bitShift: -8)
|
|
1758 |
"/ bitAnd: 255).
|
|
1759 |
"/ outStream nextPut: (a32BitW bitAnd: 255).
|
|
1760 |
outStream nextPutLong:a32BitW MSB:true.
|
|
1761 |
^a32BitW
|
|
1762 |
!
|
|
1763 |
|
|
1764 |
nextPut:aByte
|
|
1765 |
outStream nextPut:aByte
|
|
1766 |
!
|
|
1767 |
|
|
1768 |
nextWord
|
|
1769 |
^ inStream nextUnsignedShortMSB:true
|
|
1770 |
!
|
|
1771 |
|
|
1772 |
nextWordPut:a16BitW
|
|
1773 |
"/ outStream nextPut: ((a16BitW bitShift: -8)
|
|
1774 |
"/ bitAnd: 255).
|
|
1775 |
"/ outStream nextPut: (a16BitW bitAnd: 255).
|
|
1776 |
outStream nextPutShort:a16BitW MSB:true.
|
|
1777 |
^a16BitW
|
|
1778 |
!
|
|
1779 |
|
|
1780 |
position
|
|
1781 |
^ inStream position
|
|
1782 |
!
|
|
1783 |
|
|
1784 |
position:arg
|
|
1785 |
inStream position:arg
|
|
1786 |
!
|
|
1787 |
|
|
1788 |
size
|
|
1789 |
self halt.
|
|
1790 |
^ outStream size
|
|
1791 |
!
|
|
1792 |
|
|
1793 |
skip: anInteger
|
|
1794 |
self halt.
|
|
1795 |
^ inStream skip: anInteger
|
|
1796 |
!
|
|
1797 |
|
|
1798 |
space
|
|
1799 |
^ outStream space
|
|
1800 |
!
|
|
1801 |
|
|
1802 |
tab
|
|
1803 |
^ outStream tab
|
|
1804 |
! !
|
|
1805 |
|
1806
|
1806 |
!PICTReader methodsFor:'writing'!
|
|
1807 |
|
|
1808 |
nextPutImage: anImage
|
|
1809 |
| endOpcode |
|
1807
|
1810 |
|
|
1811 |
^ self fileFormatError:'Sorry - PICT image implementation is incomplete'.
|
|
1812 |
|
1806
|
1813 |
"/ (anImage isKindOf: Image) not ifTrue: [^self errorCanNotWrite].
|
|
1814 |
"/ ((imageStream isKindOf: ExternalStream)
|
|
1815 |
"/ or: [(imageStream respondsTo: #stream)
|
|
1816 |
"/ and: [imageStream stream isKindOf: ExternalStream]])
|
|
1817 |
"/ ifTrue: [self nextPutAll: (ByteArray new: 512)].
|
|
1818 |
"/ picSize := 0.
|
|
1819 |
"/ picFrame := 0 @ 0 extent: anImage extent.
|
|
1820 |
"/ anImage bitsPerPixel = 1
|
|
1821 |
"/ ifTrue: [picVersion := 1]
|
|
1822 |
"/ ifFalse: [picVersion := 2].
|
|
1823 |
"/ anImage bitsPerPixel > 8 ifTrue: [^self nextPutImage24: anImage].
|
|
1824 |
"/ rowBytes := anImage width * anImage bitsPerPixel + 7 // 8.
|
|
1825 |
"/ bounds := anImage bounds.
|
|
1826 |
"/ pmVersion := 0.
|
|
1827 |
"/ packType := 0.
|
|
1828 |
"/ packSize := 0.
|
|
1829 |
"/ hRes := '16r00480000' asNumber.
|
|
1830 |
"/ vRes := '16r00480000' asNumber.
|
|
1831 |
"/ pixelType := 0.
|
|
1832 |
"/ pixelSize := anImage bitsPerPixel.
|
|
1833 |
"/ cmpCount := 1.
|
|
1834 |
"/ cmpSize := anImage bitsPerPixel.
|
|
1835 |
"/ planeBytes := 0.
|
|
1836 |
"/ pmTable := 0.
|
|
1837 |
"/ pmReserved := 0.
|
|
1838 |
"/ ctSeed := 0.
|
|
1839 |
"/ ctFlags := '16r8000' asNumber.
|
|
1840 |
"/ ctSize := anImage palette maxIndex.
|
|
1841 |
"/ ctTable := nil.
|
|
1842 |
"/ srcRect := anImage bounds.
|
|
1843 |
"/ dstRect := anImage bounds.
|
|
1844 |
"/ mode := 0.
|
|
1845 |
"/ endOpcode := '16r00FF' asNumber.
|
|
1846 |
"/ self writeImage: anImage.
|
|
1847 |
"/ self writeOpcode: endOpcode.
|
|
1848 |
"/ ^anImage
|
1804
|
1849 |
! !
|
|
1850 |
|
1849
|
1851 |
!PICTReader::PICTFrame methodsFor:'accessing'!
|
|
1852 |
|
|
1853 |
destinationRectangle
|
|
1854 |
^ destinationRectangle
|
|
1855 |
!
|
|
1856 |
|
|
1857 |
image
|
|
1858 |
^ image
|
|
1859 |
!
|
|
1860 |
|
|
1861 |
image:imageArg sourceRectangle:sourceRectangleArg destinationRectangle:destinationRectangleArg mode:modeArg
|
|
1862 |
"set instance variables (automatically generated)"
|
|
1863 |
|
|
1864 |
image := imageArg.
|
|
1865 |
sourceRectangle := sourceRectangleArg.
|
|
1866 |
destinationRectangle := destinationRectangleArg.
|
|
1867 |
mode := modeArg.
|
|
1868 |
!
|
|
1869 |
|
|
1870 |
maskRegion
|
|
1871 |
^ maskRegion
|
|
1872 |
!
|
|
1873 |
|
|
1874 |
maskRegion:something
|
|
1875 |
maskRegion := something.
|
|
1876 |
!
|
|
1877 |
|
|
1878 |
mode
|
|
1879 |
^ mode
|
|
1880 |
!
|
|
1881 |
|
|
1882 |
sourceRectangle
|
|
1883 |
^ sourceRectangle
|
|
1884 |
! !
|
|
1885 |
|
1804
|
1886 |
!PICTReader class methodsFor:'documentation'!
|
|
1887 |
|
|
1888 |
version
|
1850
|
1889 |
^ '$Header: /cvs/stx/stx/libview2/PICTReader.st,v 1.8 2003-11-19 19:19:27 cg Exp $'
|
1804
|
1890 |
! !
|
|
1891 |
|
|
1892 |
PICTReader initialize!
|