author | Claus Gittinger <cg@exept.de> |
Fri, 26 Feb 1999 13:52:40 +0100 | |
changeset 1113 | ac90f3c50701 |
parent 1073 | 1e1450185eb8 |
child 1167 | 78084516ae7c |
permissions | -rw-r--r-- |
0 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
28 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
ImageReader subclass:#WindowsIconReader |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
14 |
instanceVariableNames:'' |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
15 |
classVariableNames:'' |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
16 |
poolDictionaries:'' |
259 | 17 |
category:'Graphics-Images-Support' |
0 | 18 |
! |
19 |
||
21 | 20 |
!WindowsIconReader class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
28 | 25 |
All Rights Reserved |
0 | 26 |
|
21 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
0 | 35 |
|
21 | 36 |
documentation |
37 |
" |
|
32 | 38 |
this class provides methods for loading Windows and OS2 icon files. |
713 | 39 |
Image writing is only supported for BMP format with depth 1,4,8 and 24 bit images. |
211 | 40 |
|
41 |
The reader tries to figure out which version of BMP/ICO is used. |
|
42 |
It seems to be able to load most formats, but who knows ... |
|
43 |
||
44 |
[See also:] |
|
234 | 45 |
Image Form Icon |
211 | 46 |
BlitImageReader FaceReader GIFReader JPEGReader PBMReader PCXReader |
47 |
ST80FormReader SunRasterReader TargaReader TIFFReader |
|
48 |
XBMReader XPMReader XWDReader |
|
21 | 49 |
" |
50 |
! ! |
|
0 | 51 |
|
28 | 52 |
!WindowsIconReader class methodsFor:'initialization'! |
53 |
||
54 |
initialize |
|
211 | 55 |
"tell Image-class, that a new fileReader is present |
398 | 56 |
for the '.bmp' and '.ico' extensions." |
211 | 57 |
|
647 | 58 |
MIMETypes defineImageType:'image/x-MS-bitmap' suffix:'bmp' reader:self. |
59 |
MIMETypes defineImageType:nil suffix:'ico' reader:self. |
|
211 | 60 |
|
398 | 61 |
"Modified: 1.2.1997 / 15:03:59 / cg" |
28 | 62 |
! ! |
63 |
||
102 | 64 |
!WindowsIconReader class methodsFor:'testing'! |
65 |
||
713 | 66 |
canRepresent:anImage |
67 |
"return true, if anImage can be represented in my file format. |
|
68 |
BMP supports depth 1,4,8 and 24." |
|
69 |
||
70 |
^ (#(1 4 8 24) includes:anImage depth) |
|
71 |
||
72 |
"Created: 17.10.1997 / 20:18:23 / cg" |
|
73 |
! |
|
74 |
||
102 | 75 |
isValidImageFile:aFileName |
76 |
"return true, if aFileName contains a valid windows bitmap-file image" |
|
77 |
||
78 |
|inStream header ok| |
|
79 |
||
80 |
inStream := self streamReadingFile:aFileName. |
|
81 |
inStream isNil ifTrue:[^ false]. |
|
82 |
||
83 |
inStream binary. |
|
104 | 84 |
ok := false. |
692
e6af4c70e066
size is going to be eliminated from the stream
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
85 |
inStream fileSize > 16 ifTrue:[ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
86 |
header := ByteArray uninitializedNew:4. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
87 |
inStream nextBytes:4 into:header. |
102 | 88 |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
89 |
(header startsWith:#(66 77)) ifTrue:[ "BM" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
90 |
ok := true. |
104 | 91 |
"/ 'WINREADER: Win3.x or OS/2 vsn 2 BM format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
92 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
93 |
(header startsWith:#(66 65)) ifTrue:[ "BA" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
94 |
ok := true. |
104 | 95 |
"/ 'WINREADER: OS/2 vsn 2 BA format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
96 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
97 |
(header startsWith:#(73 67)) ifTrue:[ "IC" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
98 |
ok := true. |
104 | 99 |
"/ 'WINREADER: OS/2 IC format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
100 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
101 |
(header startsWith:#(80 84)) ifTrue:[ "PT" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
102 |
ok := true. |
104 | 103 |
"/ 'WINREADER: OS/2 PT format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
104 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
105 |
(header startsWith:#(0 0 1 0)) ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
106 |
ok := true. |
104 | 107 |
"/ 'WINREADER: Win3.x ICO format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
108 |
]. |
102 | 109 |
]. |
104 | 110 |
inStream close. |
111 |
^ ok |
|
102 | 112 |
|
113 |
" |
|
114 |
WindowsIconReader isValidImageFile:'/phys/clam2/LocalLibrary/Images/OS2_icons/dos.ico' |
|
115 |
" |
|
116 |
||
117 |
"Created: 17.9.1995 / 17:14:20 / claus" |
|
118 |
! ! |
|
119 |
||
103 | 120 |
!WindowsIconReader methodsFor:'private'! |
121 |
||
122 |
loadBMPWidth:w height:h depth:d compression:c from:aStream into:data |
|
211 | 123 |
"helper: load a BMP image" |
124 |
||
713 | 125 |
|buff idx fileBytesPerRow imgBytesPerRow| |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
126 |
|
103 | 127 |
d == 8 ifTrue:[ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
128 |
(self class loadBMP8Width:w height:h compression:c from:aStream into:data) ifFalse:[ |
819 | 129 |
self fileFormatError:'read/decompression failed'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
130 |
^ false |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
131 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
132 |
^ true |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
133 |
]. |
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
134 |
d == 4 ifTrue:[ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
135 |
(self class loadBMP4to8Width:w height:h compression:c from:aStream into:data) ifFalse:[ |
819 | 136 |
self fileFormatError:'read/decompression failed'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
137 |
^ false |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
138 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
139 |
^ true |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
140 |
]. |
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
141 |
d == 2 ifTrue:[ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
142 |
(self class loadBMP2to8Width:w height:h from:aStream into:data) ifFalse:[ |
819 | 143 |
self fileFormatError:'read failed'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
144 |
^ false |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
145 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
146 |
^ true |
103 | 147 |
]. |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
148 |
d == 1 ifTrue:[ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
149 |
(self class loadBMP1to8Width:w height:h from:aStream into:data) ifFalse:[ |
819 | 150 |
self fileFormatError:'read failed'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
151 |
^ false |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
152 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
153 |
^ true |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
154 |
]. |
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
155 |
d == 24 ifTrue:[ |
713 | 156 |
imgBytesPerRow := w * 3. |
157 |
fileBytesPerRow := imgBytesPerRow. |
|
158 |
(fileBytesPerRow bitAnd:3) ~~ 0 ifTrue:[ |
|
159 |
fileBytesPerRow := (fileBytesPerRow bitAnd:(3 bitInvert)) + 4. |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
160 |
]. |
713 | 161 |
"/ |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
162 |
"/ stupid - last row comes first |
713 | 163 |
"/ |
164 |
idx := imgBytesPerRow * (height - 1) + 1. |
|
165 |
buff := ByteArray uninitializedNew:fileBytesPerRow. |
|
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
166 |
|
713 | 167 |
1 to:height do:[:row | |
168 |
(aStream nextBytes:fileBytesPerRow into:buff) ~~ fileBytesPerRow ifTrue:[ |
|
819 | 169 |
self fileFormatError:'read failed'. |
713 | 170 |
^ false |
171 |
]. |
|
172 |
data replaceFrom:idx to:idx+imgBytesPerRow-1 with:buff. |
|
173 |
idx := idx - imgBytesPerRow. |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
174 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
175 |
^ true |
160
ee4d64b12c94
handle depth 24 rgb BMP files
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
176 |
]. |
819 | 177 |
self fileFormatError:('unsupported depth:' , d printString). |
178 |
^ false |
|
103 | 179 |
|
819 | 180 |
"Created: / 17.9.1995 / 18:48:11 / claus" |
181 |
"Modified: / 3.2.1998 / 20:21:16 / cg" |
|
103 | 182 |
! ! |
183 |
||
53 | 184 |
!WindowsIconReader methodsFor:'reading from file'! |
0 | 185 |
|
211 | 186 |
fromOS2File:aFilename |
187 |
"read an image from an OS/2 BMP file" |
|
188 |
||
41 | 189 |
|reader stream| |
190 |
||
191 |
stream := self streamReadingFile:aFilename. |
|
192 |
stream isNil ifTrue:[^ nil]. |
|
83 | 193 |
reader := (self new) fromOS2Stream:stream. |
41 | 194 |
stream close. |
195 |
reader notNil ifTrue:[^ reader image]. |
|
196 |
^ nil |
|
211 | 197 |
|
198 |
"Modified: 23.4.1996 / 13:09:28 / cg" |
|
21 | 199 |
! |
0 | 200 |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
201 |
fromOS2Stream:aStream |
211 | 202 |
"read an image from an OS/2 BMP stream" |
203 |
||
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
204 |
| header inDepth |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
205 |
rawMap rMap gMap bMap srcIndex dstIndex inBytesPerRow |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
206 |
data4 mask tmp bytesPerRow nColors nByte| |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
207 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
208 |
inStream := aStream. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
209 |
aStream binary. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
210 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
211 |
"read the header" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
212 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
213 |
header := ByteArray uninitializedNew:8r110. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
214 |
aStream nextBytes:16 into:header. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
215 |
|
445 | 216 |
(header startsWith:#(73 67)) ifTrue:[ "IC" |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
217 |
"IC format" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
218 |
aStream nextBytes:10 into:header startingAt:17. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
219 |
width := header at:7. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
220 |
height := header at:9. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
221 |
inDepth := 2 "header at:11". "where is it" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
222 |
] ifFalse:[ |
445 | 223 |
(header startsWith:#(67 73)) ifTrue:[ "CI" |
819 | 224 |
^ self fileFormatError:'unsupported format: CI'. |
445 | 225 |
] ifFalse:[ |
226 |
aStream nextBytes:(8r110-16) into:header startingAt:17. |
|
227 |
width := header at:8r101. |
|
228 |
height := header at:8r103. |
|
229 |
inDepth := header at:8r107. |
|
230 |
] |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
231 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
232 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
233 |
"read the colormap" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
234 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
235 |
nColors := 1 bitShift:inDepth. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
236 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
237 |
rawMap := ByteArray uninitializedNew:(nColors*3). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
238 |
aStream nextBytes:(nColors*3) into:rawMap. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
239 |
rMap := Array new:nColors. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
240 |
gMap := Array new:nColors. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
241 |
bMap := Array new:nColors. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
242 |
srcIndex := 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
243 |
1 to:nColors do:[:i | |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
244 |
bMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
245 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
246 |
gMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
247 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
248 |
rMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
249 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
250 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
251 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
252 |
"read mask" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
253 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
254 |
nByte := width * height + 7 // 8. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
255 |
mask := ByteArray uninitializedNew:nByte. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
256 |
aStream nextBytes:nByte into:mask. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
257 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
258 |
"what is this" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
259 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
260 |
aStream nextBytes:nByte into:mask. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
261 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
262 |
"/ "read the data bits" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
263 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
264 |
"/ bytesPerRow := width * inDepth + 7 // 8. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
265 |
"/ data4 := ByteArray uninitializedNew:(height * bytesPerRow). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
266 |
"/ inDepth == 8 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
267 |
"/ ]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
268 |
"/ aStream nextBytes:(height * bytesPerRow) into:data4. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
269 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
270 |
"/ "stupid: last row first" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
271 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
272 |
"/ tmp := ByteArray new:(height * bytesPerRow). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
273 |
"/ srcIndex := 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
274 |
"/ dstIndex := (height - 1) * bytesPerRow + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
275 |
"/ 1 to:height do:[:row | |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
276 |
"/ tmp replaceFrom:dstIndex to:(dstIndex + bytesPerRow - 1) |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
277 |
"/ with:data4 startingAt:srcIndex. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
278 |
"/ srcIndex := srcIndex + bytesPerRow. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
279 |
"/ dstIndex := dstIndex - bytesPerRow. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
280 |
"/ ]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
281 |
"/ data4 := tmp. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
282 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
283 |
"/ "expand into bytes" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
284 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
285 |
"/ data := ByteArray new:(width * height). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
286 |
"/ data4 expandPixels:inDepth width:width height:height |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
287 |
"/ into:data mapping:nil. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
288 |
"/ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
289 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
290 |
bytesPerRow := width * inDepth + 7 // 8. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
291 |
"/ bmp data is always 32bit aligned; if required, |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
292 |
inBytesPerRow := ((bytesPerRow + 3) // 4) * 4. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
293 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
294 |
data := ByteArray uninitializedNew:(height * width "bytesPerRow"). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
295 |
(self loadBMPWidth:width height:height depth:inDepth compression:0 from:aStream into:data) ifFalse:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
296 |
^ nil |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
297 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
298 |
photometric := #palette. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
299 |
samplesPerPixel := 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
300 |
bitsPerSample := #(8). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
301 |
colorMap := Colormap redVector:rMap greenVector:gMap blueVector:bMap. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
302 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
303 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
304 |
|i f| |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
305 |
i := Image fromFile:'/LocalLibrary/Images/OS2/dos3.ico'. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
306 |
f := i asFormOn:Display. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
307 |
v displayOpaqueForm:(f magnifyBy:2@2) x:5 y:5 |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
308 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
309 |
|
819 | 310 |
"Modified: / 17.9.1995 / 18:49:24 / claus" |
311 |
"Modified: / 3.2.1998 / 20:17:13 / cg" |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
312 |
! |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
313 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
314 |
fromStream:aStream |
211 | 315 |
"figure out which format the stream contains |
316 |
(there are various different bmp/ico formats around) |
|
317 |
and read the image." |
|
318 |
||
319 |
|fileSize header| |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
320 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
321 |
inStream := aStream. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
322 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
323 |
aStream binary. |
692
e6af4c70e066
size is going to be eliminated from the stream
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
324 |
fileSize := aStream fileSize. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
325 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
326 |
fileSize < 16 ifTrue:[ |
819 | 327 |
^ self fileFormatError:'short file'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
328 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
329 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
330 |
header := ByteArray uninitializedNew:4. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
331 |
aStream nextBytes:4 into:header. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
332 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
333 |
(header startsWith:#(66 77)) ifTrue:[ "BM" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
334 |
aStream position:1. |
387 | 335 |
"/ 'WinIconReader [info]: Win3.x or OS/2 vsn 2 BM format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
336 |
^ self fromWindowsBMPStream:aStream |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
337 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
338 |
(header startsWith:#(66 65)) ifTrue:[ "BA" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
339 |
aStream position:1. |
387 | 340 |
"/ 'WinIconReader [info]: OS/2 vsn 2 BA format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
341 |
^ self fromOS2Stream:aStream |
445 | 342 |
]. |
343 |
(header startsWith:#(67 73)) ifTrue:[ "CI" |
|
344 |
'WinIconReader [warning]: OS/2 CI format not supported:' infoPrintNL. |
|
345 |
^ nil. |
|
346 |
aStream position:1. |
|
347 |
"/ 'WinIconReader [info]: OS/2 vsn 2 BA format' infoPrintNL. |
|
348 |
^ self fromOS2Stream:aStream |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
349 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
350 |
(header startsWith:#(73 67)) ifTrue:[ "IC" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
351 |
aStream position:1. |
387 | 352 |
"/ 'WinIconReader [info]: OS/2 IC format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
353 |
^ self fromOS2Stream:aStream |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
354 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
355 |
(header startsWith:#(80 84)) ifTrue:[ "PT" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
356 |
aStream position:1. |
387 | 357 |
"/ 'WinIconReader [info]: OS/2 PT format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
358 |
^ self fromOS2Stream:aStream |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
359 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
360 |
(header startsWith:#(16r53 16r5A)) ifTrue:[ "SZ" |
445 | 361 |
'WinIconReader [warning]: OS/2 SZ format not supported:' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
362 |
^ nil. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
363 |
aStream position:1. |
445 | 364 |
'WinIconReader [info]: OS/2 SZ format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
365 |
^ self fromOS2Stream:aStream |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
366 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
367 |
(header startsWith:#(0 0 1 0)) ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
368 |
aStream position:1. |
387 | 369 |
"/ 'WinIconReader [info]: Win3.x ICO format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
370 |
^ self fromWindowsICOStream:aStream |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
371 |
]. |
819 | 372 |
^ self fileFormatError:('format not supported:' |
373 |
, ((header at:1) printStringRadix:16) |
|
374 |
, ' ' |
|
375 |
, ((header at:2) printStringRadix:16)). |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
376 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
377 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
378 |
Image fromFile:'/phys/clam//LocalLibrary/Images/OS2_icons/dos.ico' |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
379 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
380 |
|
819 | 381 |
"Modified: / 17.9.1995 / 18:59:07 / claus" |
382 |
"Modified: / 3.2.1998 / 20:18:14 / cg" |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
383 |
! |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
384 |
|
21 | 385 |
fromWindowsBMPFile: aFilename |
211 | 386 |
"read an image from a windows BMP file" |
387 |
||
41 | 388 |
|reader stream| |
389 |
||
390 |
stream := self class streamReadingFile:aFilename. |
|
391 |
stream isNil ifTrue:[^ nil]. |
|
83 | 392 |
reader := (self new) fromWindowsBMPStream:stream. |
41 | 393 |
stream close. |
394 |
reader notNil ifTrue:[^ reader image]. |
|
395 |
^ nil |
|
211 | 396 |
|
397 |
"Modified: 23.4.1996 / 13:09:53 / cg" |
|
21 | 398 |
! |
399 |
||
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
400 |
fromWindowsBMPStream:aStream |
211 | 401 |
"read an image from a windows BMP stream" |
402 |
||
518 | 403 |
| fileSize header iSize inDepth inPlanes compression |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
404 |
imgSize resH resV numColor numImportantColor |
1073
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
405 |
dataStart t |
678 | 406 |
rawMap rMap gMap bMap srcIndex |
407 |
bytesPerRow fourBytesPerColorInfo| |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
408 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
409 |
inStream := aStream. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
410 |
aStream binary. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
411 |
|
692
e6af4c70e066
size is going to be eliminated from the stream
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
412 |
fileSize := aStream fileSize. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
413 |
"read the header" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
414 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
415 |
header := ByteArray uninitializedNew:16r54. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
416 |
aStream nextBytes:18 into:header. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
417 |
|
518 | 418 |
iSize := header at:(16r0E + 1). |
419 |
(iSize == 40) ifTrue:[ "header-size" |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
420 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
421 |
its an Windows3.x BMP file |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
422 |
or OS/2 vsn 2 BMP file |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
423 |
" |
387 | 424 |
"/ 'WinIconReader [info]: Win3.x or OS/2 vsn 2 format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
425 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
426 |
aStream nextBytes:(40-4) into:header startingAt:19. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
427 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
428 |
width := header wordAt:(16r12 + 1) MSB:false. "(header at:19) + ((header at:20) * 256). " |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
429 |
height := header wordAt:(16r16 + 1) MSB:false. "(header at:23) + ((header at:24) * 256). " |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
430 |
inPlanes := header wordAt:(16r1A + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
431 |
inDepth := header wordAt:(16r1C + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
432 |
compression := header wordAt:(16r1E + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
433 |
imgSize := header doubleWordAt:(16r22 + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
434 |
resH := header doubleWordAt:(16r26 + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
435 |
resV := header doubleWordAt:(16r2A + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
436 |
numColor := header doubleWordAt:(16r2E + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
437 |
numImportantColor := header doubleWordAt:(16r32 + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
438 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
439 |
numColor == 0 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
440 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
441 |
some bmp-writers seem to leave this as zero (which is wrong) |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
442 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
443 |
inDepth <= 8 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
444 |
numColor := 1 bitShift:inDepth. |
952 | 445 |
"/ 'WinIconReader [warning]: missing nColor in header - assume ' infoPrint. numColor infoPrintNL |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
446 |
] |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
447 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
448 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
449 |
numColor ~~ 0 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
450 |
rawMap := ByteArray uninitializedNew:(numColor * 4). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
451 |
aStream nextBytes:(numColor * 4) into:rawMap. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
452 |
fourBytesPerColorInfo := true. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
453 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
454 |
dataStart := header wordAt:(16r0A + 1) MSB:false |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
455 |
] ifFalse:[ |
518 | 456 |
(iSize == 12) ifTrue:[ "core-info header size" |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
457 |
" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
458 |
its an OS/2 (vsn1.2) BMP file |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
459 |
" |
387 | 460 |
"/ 'WinIconReader [info]: OS/2 vsn 1.2 format' infoPrintNL. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
461 |
aStream nextBytes:(12-4) into:header startingAt:19. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
462 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
463 |
width := header wordAt:(16r12 + 1) MSB:false. "(header at:19) + ((header at:20) * 256). " |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
464 |
height := header wordAt:(16r14 + 1) MSB:false. "(header at:21) + ((header at:22) * 256). " |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
465 |
inPlanes := header wordAt:(16r16 + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
466 |
inDepth := header wordAt:(16r18 + 1) MSB:false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
467 |
numColor := 1 bitShift:inDepth. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
468 |
rawMap := ByteArray uninitializedNew:(numColor * 3). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
469 |
aStream nextBytes:(numColor * 3) into:rawMap. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
470 |
fourBytesPerColorInfo := false. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
471 |
compression := 0. |
565 | 472 |
"/ dataStart := header wordAt:(16r0A + 1) MSB:false. |
473 |
dataStart := nil. |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
474 |
] ifFalse:[ |
819 | 475 |
^ self fileFormatError:'unknown format'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
476 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
477 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
478 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
479 |
numColor ~~ 0 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
480 |
"read the colormap" |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
481 |
|
565 | 482 |
rMap := ByteArray new:numColor. |
483 |
gMap := ByteArray new:numColor. |
|
484 |
bMap := ByteArray new:numColor. |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
485 |
srcIndex := 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
486 |
1 to:numColor do:[:i | |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
487 |
bMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
488 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
489 |
gMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
490 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
491 |
rMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
492 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
493 |
fourBytesPerColorInfo ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
494 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
495 |
] |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
496 |
]. |
898
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
497 |
numColor > (1 bitShift:inDepth) ifTrue:[ |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
498 |
'funny number of colors in image' infoPrintCR. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
499 |
numColor := 1 bitShift:inDepth. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
500 |
rMap := rMap copyTo:numColor. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
501 |
gMap := gMap copyTo:numColor. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
502 |
bMap := bMap copyTo:numColor. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
503 |
]. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
504 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
505 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
506 |
"/ check for valid compression |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
507 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
508 |
compression ~~ 0 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
509 |
"/ some compression |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
510 |
compression == 1 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
511 |
"/ RLE8 - must be depth-8 |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
512 |
inDepth ~~ 8 ifTrue:[ |
819 | 513 |
^ self fileFormatError:'RLE8 compression only supported with depth8 images'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
514 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
515 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
516 |
compression == 2 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
517 |
"/ RLE4 - must be depth-4 |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
518 |
inDepth ~~ 4 ifTrue:[ |
819 | 519 |
^ self fileFormatError:'RLE4 compression only supported with depth4 images'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
520 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
521 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
522 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
523 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
524 |
inPlanes ~~ 1 ifTrue:[ |
819 | 525 |
^ self fileFormatError:'only 1 plane images supported'. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
526 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
527 |
|
565 | 528 |
dataStart notNil ifTrue:[ |
529 |
aStream position:(dataStart + 1). |
|
530 |
]. |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
531 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
532 |
inDepth == 24 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
533 |
bytesPerRow := width * 3 |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
534 |
] ifFalse:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
535 |
bytesPerRow := width |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
536 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
537 |
data := ByteArray uninitializedNew:(height * bytesPerRow). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
538 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
539 |
"/ read & possibly decompress |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
540 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
541 |
(self loadBMPWidth:width height:height depth:inDepth compression:compression from:aStream into:data) ifFalse:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
542 |
^ nil |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
543 |
]. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
544 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
545 |
inDepth == 24 ifTrue:[ |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
546 |
photometric := #rgb. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
547 |
samplesPerPixel := 3. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
548 |
bitsPerSample := #(8 8 8). |
1073
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
549 |
"/ stupid must swap red & blue bytes |
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
550 |
|
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
551 |
1 to:data size by:3 do:[:i | |
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
552 |
t := data at:i. |
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
553 |
data at:i put:(data at:i+2). |
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
554 |
data at:i+2 put:t |
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
555 |
]. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
556 |
^ self |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
557 |
]. |
898
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
558 |
inDepth == 1 ifTrue:[ |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
559 |
photometric := #blackIs0. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
560 |
samplesPerPixel := 1. |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
561 |
bitsPerSample := #(1). |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
562 |
^ self |
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
563 |
]. |
899 | 564 |
(inDepth ~~ 8) ifTrue:[ |
565 |
"/ self halt:'unsupported depth'. |
|
898
cdf6cc132b53
care for funny number of colors (nColor > (1<<depth))
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
566 |
]. |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
567 |
|
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
568 |
photometric := #palette. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
569 |
samplesPerPixel := 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
570 |
bitsPerSample := #(8). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
571 |
colorMap := Colormap redVector:rMap greenVector:gMap blueVector:bMap. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
572 |
|
819 | 573 |
"Modified: / 17.9.1995 / 18:48:46 / claus" |
1073
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
574 |
"Modified: / 16.9.1998 / 01:09:08 / cg" |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
575 |
! |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
576 |
|
211 | 577 |
fromWindowsICOFile:aFilename |
578 |
"read an image from a windows ICO file" |
|
579 |
||
41 | 580 |
|reader stream| |
581 |
||
582 |
stream := self class streamReadingFile:aFilename. |
|
583 |
stream isNil ifTrue:[^ nil]. |
|
83 | 584 |
reader := (self new) fromWindowsICOStream:stream. |
41 | 585 |
stream close. |
586 |
reader notNil ifTrue:[^ reader image]. |
|
587 |
^ nil |
|
21 | 588 |
|
589 |
" |
|
590 |
Image fromFile:'/phys/clam2//LocalLibrary/Images/WIN_icons/ibm.ico'. |
|
591 |
" |
|
211 | 592 |
|
593 |
"Modified: 23.4.1996 / 13:10:11 / cg" |
|
21 | 594 |
! |
595 |
||
41 | 596 |
fromWindowsICOStream:aStream |
211 | 597 |
"read an image from a windows ICO stream" |
598 |
||
21 | 599 |
| header inDepth |
600 |
rawMap rMap gMap bMap srcIndex dstIndex |
|
601 |
data4 mask tmp bytesPerRow nColor| |
|
0 | 602 |
|
41 | 603 |
inStream := aStream. |
604 |
aStream binary. |
|
0 | 605 |
|
606 |
"read the header" |
|
607 |
||
21 | 608 |
header := ByteArray uninitializedNew:(6 + 16 + 40). |
41 | 609 |
aStream nextBytes:(6 + 16 + 40) into:header. |
21 | 610 |
width := header at:(6+1). |
611 |
height := header at:(7+1). |
|
612 |
nColor := header at:(8+1). |
|
430 | 613 |
"/ reserved := header at:(9+1). |
614 |
"/ nPlanes := header wordAt:(10+1). |
|
615 |
"/ nBitsPerPel := header wordAt:(12+1). |
|
616 |
"/ nBytesInResource := header doubleWordAt:(14+1). |
|
617 |
"/ ordinal := header wordAt:(18+1). |
|
618 |
"21, 22 ?" |
|
21 | 619 |
"23, ... , 62 ?" |
620 |
||
0 | 621 |
inDepth := header at:16r25. |
622 |
||
623 |
"read the colormap" |
|
624 |
||
21 | 625 |
rawMap := ByteArray uninitializedNew:(16*4). |
41 | 626 |
aStream nextBytes:(16*4) into:rawMap. |
565 | 627 |
rMap := ByteArray new:16. |
628 |
gMap := ByteArray new:16. |
|
629 |
bMap := ByteArray new:16. |
|
0 | 630 |
srcIndex := 1. |
631 |
1 to:16 do:[:i | |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
632 |
bMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
633 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
634 |
gMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
635 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
636 |
rMap at:i put:(rawMap at:srcIndex). |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
637 |
srcIndex := srcIndex + 1. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
638 |
srcIndex := srcIndex + 1. |
0 | 639 |
]. |
640 |
||
641 |
"read the data bits" |
|
642 |
||
565 | 643 |
inDepth == 0 ifTrue:[ |
644 |
inDepth := 4. |
|
645 |
]. |
|
3 | 646 |
bytesPerRow := width * inDepth + 7 // 8. |
647 |
data4 := ByteArray uninitializedNew:(height * bytesPerRow). |
|
41 | 648 |
aStream nextBytes:(height * bytesPerRow) into:data4. |
0 | 649 |
|
650 |
"read mask" |
|
651 |
||
652 |
" |
|
653 |
mask := ByteArray new:(width * height / 8). |
|
41 | 654 |
aStream nextBytes:(width * height / 8) into:mask. |
0 | 655 |
" |
656 |
||
657 |
"stupid: last row first" |
|
658 |
||
3 | 659 |
tmp := ByteArray uninitializedNew:(height * bytesPerRow). |
0 | 660 |
srcIndex := 1. |
661 |
dstIndex := (height - 1) * bytesPerRow + 1. |
|
662 |
1 to:height do:[:row | |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
663 |
tmp replaceFrom:dstIndex to:(dstIndex + bytesPerRow - 1) |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
664 |
with:data4 startingAt:srcIndex. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
665 |
srcIndex := srcIndex + bytesPerRow. |
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
666 |
dstIndex := dstIndex - bytesPerRow. |
0 | 667 |
]. |
668 |
data4 := tmp. |
|
669 |
||
670 |
||
671 |
photometric := #palette. |
|
672 |
samplesPerPixel := 1. |
|
298
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
673 |
|
36 | 674 |
colorMap := Colormap redVector:rMap greenVector:gMap blueVector:bMap. |
0 | 675 |
|
298
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
676 |
false ifTrue:[ |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
677 |
"expand into bytes" |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
678 |
|
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
679 |
data := ByteArray new:(width * height). |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
680 |
data4 expandPixels:inDepth width:width height:height |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
681 |
into:data mapping:nil. |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
682 |
bitsPerSample := #(8). |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
683 |
] ifFalse:[ |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
684 |
data := data4. |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
685 |
bitsPerSample := #(4). |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
686 |
]. |
cd59c474524a
return .ico files as Depth4Images (not Depth8)
Claus Gittinger <cg@exept.de>
parents:
259
diff
changeset
|
687 |
|
0 | 688 |
" |
21 | 689 |
WindowsIconReader new fromWindowsICOFile:'/phys/clam2//LocalLibrary/Images/WIN_icons/ibm.ico'. |
0 | 690 |
" |
211 | 691 |
|
565 | 692 |
"Modified: 24.4.1997 / 22:03:48 / cg" |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
693 |
! ! |
21 | 694 |
|
713 | 695 |
!WindowsIconReader methodsFor:'writing to file'! |
696 |
||
697 |
save:image onFile:aFileName |
|
698 |
"save image as BMP file on aFileName. |
|
699 |
Only depth 1,4,8 and 24 images can be represented in this format." |
|
700 |
||
701 |
self saveBMP:image onFile:aFileName. |
|
702 |
||
703 |
"Modified: 17.10.1997 / 20:16:53 / cg" |
|
704 |
! |
|
705 |
||
706 |
saveBMP:image onFile:fileName |
|
707 |
"save image as BMP file on aFileName. |
|
708 |
Only depth 1,4,8 and 24 images can be represented in this format." |
|
709 |
||
710 |
|depth bhSize biSize biClrUsed biSizeImage bfOffBits rowBytes imgBytesPerRow data srcIndex row| |
|
711 |
||
712 |
depth := image depth. |
|
713 |
width := image width. |
|
714 |
height := image height. |
|
715 |
||
716 |
(#(1 4 8 24) includes:depth) ifFalse:[ |
|
717 |
^ Image cannotRepresentImageSignal |
|
718 |
raiseWith:image |
|
719 |
errorString:('BMP format only supports depths 1,4,8 and 24'). |
|
720 |
]. |
|
721 |
image mask notNil ifTrue:[ |
|
722 |
Image informationLostQuerySignal |
|
723 |
raiseWith:image |
|
724 |
errorString:('BMP format does not support an imageMask'). |
|
725 |
]. |
|
726 |
||
727 |
bhSize := 14. "# bytes in file header" |
|
728 |
biSize := 40. "info header size in bytes" |
|
729 |
biClrUsed := (depth >= 24) ifTrue:[0] ifFalse:[1 << depth]. "No. color table entries" |
|
730 |
bfOffBits := biSize + bhSize + (4*biClrUsed). |
|
731 |
"/ bmp aligns rows on a longword boundary |
|
732 |
rowBytes := ((depth min:24) * width + 31 // 32) * 4. |
|
733 |
biSizeImage := height * rowBytes. |
|
734 |
||
735 |
outStream := fileName asFilename writeStream. |
|
736 |
outStream binary. |
|
737 |
byteOrder := #lsb. |
|
738 |
||
739 |
"Write the file header" |
|
740 |
self writeShort:19778. "bfType = BM" |
|
741 |
self writeLong:(bfOffBits + biSizeImage). "Entire file size in bytes" |
|
742 |
self writeLong:0. "bfReserved" |
|
743 |
self writeLong:bfOffBits. "Offset of bitmap data from start of hdr (and file)" |
|
744 |
||
745 |
"Write the bitmap info header" |
|
746 |
outStream position: bhSize+1. |
|
747 |
self writeLong:biSize. "info header size in bytes" |
|
748 |
self writeLong:width. "biWidth" |
|
749 |
self writeLong:height. "biHeight" |
|
750 |
self writeShort:1. "biPlanes" |
|
751 |
self writeShort:(depth min:24). "biBitCount" |
|
752 |
self writeLong:0. "biCompression" |
|
753 |
self writeLong:biSizeImage. "size of image section in bytes" |
|
754 |
self writeLong:2800. "biXPelsPerMeter" |
|
755 |
self writeLong:2800. "biYPelsPerMeter" |
|
756 |
self writeLong:biClrUsed. |
|
757 |
self writeLong:0. "biClrImportant" |
|
758 |
1 to:biClrUsed do:[:i | "Color map" |
|
759 |
|clr r g b| |
|
760 |
||
761 |
clr := image colorFromValue:i-1. |
|
762 |
clr isNil ifTrue:[ |
|
763 |
r := g := b := 0. |
|
764 |
] ifFalse:[ |
|
765 |
r := clr redByte. |
|
766 |
g := clr greenByte. |
|
767 |
b := clr blueByte. |
|
768 |
]. |
|
769 |
||
770 |
"/ put B,G,R |
|
771 |
outStream nextPut:b. |
|
772 |
outStream nextPut:g. |
|
773 |
outStream nextPut:r. |
|
774 |
outStream nextPut:0. |
|
775 |
]. |
|
776 |
||
777 |
imgBytesPerRow := image bytesPerRow. |
|
778 |
data := image data. |
|
779 |
||
780 |
||
781 |
"/ sorry, must extract rows individually |
|
782 |
"/ (even if alignment is correct), |
|
783 |
"/ since BMP saves rows bottom-to-top |
|
784 |
||
785 |
row := ByteArray new:rowBytes. |
|
786 |
||
787 |
srcIndex := 1 + (height * imgBytesPerRow). |
|
788 |
1 to:height do:[:i | |
|
789 |
srcIndex := srcIndex - imgBytesPerRow. |
|
790 |
row replaceFrom:1 to:imgBytesPerRow with:data startingAt:srcIndex. |
|
791 |
outStream nextPutAll:row. |
|
792 |
]. |
|
793 |
||
794 |
outStream close. |
|
795 |
||
796 |
" |
|
797 |
|i| |
|
798 |
||
799 |
i := Image fromFile:'bitmaps/SBrowser.xbm'. |
|
800 |
WindowsIconReader save:i onFile:'test.bmp'. |
|
801 |
" |
|
802 |
" |
|
803 |
|i| |
|
804 |
||
805 |
i := Image fromFile:'bitmaps/gifImages/garfield.gif'. |
|
806 |
WindowsIconReader save:i onFile:'test.bmp'. |
|
807 |
" |
|
808 |
||
809 |
"Modified: 21.10.1997 / 05:02:02 / cg" |
|
810 |
! ! |
|
811 |
||
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
812 |
!WindowsIconReader class methodsFor:'documentation'! |
0 | 813 |
|
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
814 |
version |
1073
1e1450185eb8
fixed r-g-b order (red & blue are swapped in file)
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
815 |
^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.42 1998-09-18 14:00:55 cg Exp $' |
0 | 816 |
! ! |
172
ee7d84977c86
use inforPrint instead of errorPrint (these are not fatal errors)
Claus Gittinger <cg@exept.de>
parents:
161
diff
changeset
|
817 |
WindowsIconReader initialize! |