author | Claus Gittinger <cg@exept.de> |
Tue, 16 Jan 2018 22:14:21 +0100 | |
changeset 4048 | eceffed47e1c |
parent 4016 | 47c4ea8134ec |
permissions | -rw-r--r-- |
37 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
" |
|
1577 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
3998 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
37 | 16 |
ImageReader subclass:#TargaReader |
3998 | 17 |
instanceVariableNames:'orientation bytesPerRow bytesPerPixel imageType' |
4016 | 18 |
classVariableNames:'Verbose' |
210 | 19 |
poolDictionaries:'' |
1745
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
1738
diff
changeset
|
20 |
category:'Graphics-Images-Readers' |
37 | 21 |
! |
22 |
||
23 |
!TargaReader class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
this class provides methods for loading targa-file (tga) images. |
|
556 | 42 |
|
3998 | 43 |
The Targa-File format is an image file format used by a wide variety of both |
44 |
scanners and imaging software, and exists in many incarnations. |
|
45 |
For details, please refer to the 'Truevision Technical Guide': |
|
46 |
||
37 | 47 |
Limitations: |
556 | 48 |
not fully tested (I only had a few targa files to check things) |
3998 | 49 |
only supports 8, 24 and 32 bits/pixel formats; |
210 | 50 |
Image saving not supported |
37 | 51 |
|
3998 | 52 |
I had two tga files to test this code with; |
53 |
therefore it may pr may not work with other targa files |
|
54 |
(it certainly does not work with 1/16 bit images). |
|
299 | 55 |
|
37 | 56 |
Suggestions: adapt & use the pbmplus library here. |
210 | 57 |
|
58 |
[See also:] |
|
234 | 59 |
Image Form Icon |
210 | 60 |
BlitImageReader FaceReader GIFReader JPEGReader PBMReader PCXReader |
61 |
ST80FormReader SunRasterReader TIFFReader WindowsIconReader |
|
62 |
XBMReader XPMReader XWDReader |
|
4001 | 63 |
|
64 |
http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf |
|
4002 | 65 |
|
66 |
[examples:] |
|
67 |
Smalltalk loadPackage:'stx:goodies/communication'. |
|
68 |
Smalltalk loadPackage:'exept:libcrypt/ssl'. |
|
69 |
||
70 |
|file| |
|
71 |
file := (HTTPInterface getStreamFor:'https://samples.libav.org/image-samples/TGA/rgb32rle.tga') stream contents. |
|
72 |
(TargaReader fromStream:file readStream) inspect. |
|
73 |
||
74 |
|file| |
|
75 |
file := (HTTPInterface getStreamFor:'https://samples.libav.org/image-samples/TGA/rgb16rle.tga') stream contents. |
|
76 |
TargaReader fromStream:file readStream. |
|
37 | 77 |
" |
1738 | 78 |
! |
79 |
||
80 |
format |
|
81 |
" |
|
82 |
Shorts etc. are lsb. |
|
83 |
||
84 |
offset: |
|
85 |
||
86 |
1 lenID byte |
|
87 |
2 hasColorMap byte |
|
88 |
3 imageType byte |
|
89 |
1 MapRGB |
|
90 |
2 RawRGB |
|
91 |
3 RawMono |
|
92 |
9 MapEnCode |
|
93 |
10 RawEnCode |
|
94 |
4, 5 cmapOffset short |
|
95 |
6, 7 cmapLength short |
|
96 |
8 cmapEntrySize short |
|
97 |
9,10 xOrg short |
|
98 |
11,12 yOrg short |
|
99 |
||
100 |
13,14 width |
|
101 |
15,16 height |
|
102 |
17 depth |
|
103 |
18 flags |
|
104 |
0000 xxxx attribute-bits-per-pixel |
|
105 |
0000 0001 greysc |
|
106 |
0000 0010 colour |
|
107 |
0000 0011 mapped |
|
108 |
0000 0100 rleEncoded |
|
109 |
0000 1000 interlaced |
|
110 |
00xx 0000 origin (0 -> lower-left / 1 -> l-r / 2 -> u-l / 3 -> u-r) |
|
111 |
xx00 0000 interleave (0 -> none / 1 -> odd/even / 2 ->4-fould / 3 reserved) |
|
112 |
||
113 |
19.. len lenID-bytes |
|
114 |
.. colorMap cmapLength*3 bytes iff hasColorMap ~~ 0 |
|
115 |
" |
|
37 | 116 |
! ! |
117 |
||
118 |
!TargaReader class methodsFor:'initialization'! |
|
119 |
||
120 |
initialize |
|
210 | 121 |
"tell Image-class, that a new fileReader is present |
398 | 122 |
for the '.tga' extension." |
210 | 123 |
|
647 | 124 |
MIMETypes defineImageType:'image/x-targa' suffix:'tga' reader:self. |
37 | 125 |
|
630 | 126 |
"Modified: 27.6.1997 / 18:39:43 / cg" |
37 | 127 |
! ! |
128 |
||
129 |
!TargaReader class methodsFor:'testing'! |
|
130 |
||
131 |
isValidImageFile:aFileName |
|
132 |
"return true, if aFileName contains a targa-file image" |
|
133 |
||
1577 | 134 |
|aStream w h depth flags imageType ok| |
135 |
||
136 |
ok := true. |
|
37 | 137 |
|
43 | 138 |
aStream := self streamReadingFile:aFileName. |
139 |
aStream isNil ifTrue:[^ false]. |
|
140 |
aStream binary. |
|
1577 | 141 |
|
142 |
aStream next. "lenID" |
|
143 |
aStream next. "hasColorMap" |
|
144 |
imageType := aStream next. |
|
145 |
aStream skip:2. "cmapOffset" |
|
146 |
aStream skip:2. "cmapLength" |
|
147 |
aStream next. "cmapEntrySize" |
|
148 |
aStream skip:2. "xOrg" |
|
149 |
aStream skip:2. "yOrg" |
|
37 | 150 |
|
43 | 151 |
w := aStream nextShortMSB:false. |
152 |
h := aStream nextShortMSB:false. |
|
37 | 153 |
|
43 | 154 |
depth := aStream next. |
155 |
flags := aStream next. |
|
37 | 156 |
|
1577 | 157 |
"/ MapRGB == 1 |
158 |
"/ RawRGB == 2 |
|
159 |
"/ RawMono == 3 |
|
160 |
"/ MapEnCode == 9 |
|
161 |
"/ RawEnCode == 10 |
|
162 |
||
163 |
(#(1 2 3 9 10) includes:imageType) ifFalse:[ |
|
164 |
"/ 'TargaReader [warning]: unsupported imageType: ' errorPrint. imageType errorPrintCR. |
|
165 |
ok := false |
|
166 |
] ifTrue:[ |
|
167 |
(#(8 "16" 24 32) includes:depth) ifFalse:[ |
|
168 |
ok := false |
|
169 |
]. |
|
37 | 170 |
]. |
43 | 171 |
aStream close. |
1577 | 172 |
^ ok |
37 | 173 |
|
174 |
" |
|
175 |
TargaReader isValidImageFile:'bitmaps/test.tga' |
|
176 |
TargaReader isValidImageFile:'bitmaps/garfield.gif' |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
177 |
" |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
178 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
179 |
"Modified: 21.4.1997 / 20:46:52 / cg" |
37 | 180 |
! ! |
181 |
||
1848 | 182 |
!TargaReader methodsFor:'private-reading'! |
37 | 183 |
|
1738 | 184 |
handleImageOrientation |
185 |
|rowIdx startIdx endIdx t| |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
186 |
|
1738 | 187 |
orientation == #topLeft ifTrue:[ |
188 |
^ self. |
|
37 | 189 |
]. |
190 |
||
1738 | 191 |
orientation == #topRight ifTrue:[ |
192 |
"/ flip horizontal |
|
193 |
rowIdx := 1. |
|
194 |
1 to:height do:[:row | |
|
195 |
startIdx := rowIdx. |
|
196 |
endIdx := rowIdx + bytesPerRow - bytesPerPixel. |
|
197 |
1 to:width//2 do:[:x | |
|
198 |
0 to:bytesPerPixel-1 do:[:c | |
|
199 |
t := data at:startIdx+c. |
|
200 |
data at:startIdx+c put:(data at:endIdx+c). |
|
201 |
data at:endIdx+c put:t. |
|
202 |
]. |
|
203 |
startIdx := startIdx + bytesPerPixel. |
|
204 |
endIdx := endIdx - bytesPerPixel. |
|
1065
32a68620ddab
care for EOF while reading colorMap.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
205 |
]. |
1738 | 206 |
rowIdx := rowIdx + width. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
207 |
]. |
1738 | 208 |
^ self. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
209 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
210 |
|
1738 | 211 |
orientation == #bottomLeft ifTrue:[ |
212 |
"/ flip vertical |
|
213 |
startIdx := 1. |
|
214 |
endIdx := 1 + ((height - 1) * bytesPerRow). |
|
215 |
t := ByteArray new:bytesPerRow. |
|
216 |
1 to:height//2 do:[:row | |
|
217 |
t replaceFrom:1 to:bytesPerRow with:data startingAt:startIdx. |
|
218 |
data replaceFrom:startIdx to:startIdx+bytesPerRow-1 with:data startingAt:endIdx. |
|
219 |
data replaceFrom:endIdx to:endIdx+bytesPerRow-1 with:t startingAt:1. |
|
220 |
startIdx := startIdx + bytesPerRow. |
|
221 |
endIdx := endIdx - bytesPerRow |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
222 |
]. |
1738 | 223 |
^ self. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
224 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
225 |
|
1738 | 226 |
'TargaReader [warning]: unsupported orientation: ' errorPrint. orientation errorPrintCR. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
227 |
! |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
228 |
|
4002 | 229 |
read16 |
4016 | 230 |
"read a 16 bit/pixel targa-image. |
231 |
Notice, that the channels are in bgr order; not rgb" |
|
4002 | 232 |
|
233 |
|totalBytes remainingBytes dstIndex b1 b2| |
|
234 |
||
235 |
totalBytes := width * height * 2. |
|
236 |
data := ByteArray new:totalBytes. |
|
237 |
||
238 |
dstIndex := 1. |
|
239 |
remainingBytes := totalBytes. |
|
240 |
[remainingBytes > 0] whileTrue:[ |
|
4016 | 241 |
b2 := inStream nextByte. |
4002 | 242 |
b1 := inStream nextByte. |
243 |
data at:dstIndex put:b1. |
|
244 |
data at:dstIndex+1 put:b2. |
|
4016 | 245 |
|
4002 | 246 |
dstIndex := dstIndex + 2. |
247 |
remainingBytes := remainingBytes - 2. |
|
248 |
]. |
|
249 |
||
250 |
"Created: / 29-08-2017 / 23:38:30 / cg" |
|
4016 | 251 |
"Modified: / 17-09-2017 / 13:35:21 / cg" |
4002 | 252 |
! |
253 |
||
254 |
read16RLE |
|
4016 | 255 |
"read a 16 bit/pixel rle encoded targa-image. |
256 |
Notice, that the channels are in bgr order; not rgb" |
|
4002 | 257 |
|
258 |
|total count dstIndex code n b1 b2| |
|
259 |
||
260 |
data := ByteArray new:((total := width * height * 2)). |
|
261 |
count := 0. |
|
262 |
dstIndex := 1. |
|
263 |
[count < total] whileTrue:[ |
|
264 |
code := inStream nextByte. |
|
265 |
n := (code bitAnd:16r7F) + 1. |
|
266 |
(code bitAnd:16r80) ~~ 0 ifTrue:[ |
|
4016 | 267 |
b2 := inStream nextByte. |
4002 | 268 |
b1 := inStream nextByte. |
269 |
n timesRepeat:[ |
|
270 |
data at:dstIndex put:b1. |
|
271 |
data at:dstIndex+1 put:b2. |
|
272 |
dstIndex := dstIndex + 2 |
|
273 |
]. |
|
274 |
] ifFalse:[ |
|
275 |
n timesRepeat:[ |
|
4016 | 276 |
b2 := inStream nextByte. |
4002 | 277 |
b1 := inStream nextByte. |
278 |
data at:dstIndex put:b1. |
|
279 |
data at:dstIndex+1 put:b2. |
|
280 |
dstIndex := dstIndex + 2 |
|
281 |
] |
|
282 |
]. |
|
283 |
count := count + (n * 2). |
|
284 |
]. |
|
285 |
||
286 |
"Created: / 29-08-2017 / 23:39:19 / cg" |
|
4016 | 287 |
"Modified (comment): / 17-09-2017 / 13:35:59 / cg" |
4002 | 288 |
! |
289 |
||
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
290 |
read24 |
4016 | 291 |
"read a 24 bit/pixel targa-image. |
292 |
Notice, that the channels are in bgr order; not rgb" |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
293 |
|
1738 | 294 |
|totalBytes| |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
295 |
|
1738 | 296 |
totalBytes := width * height * 3. |
297 |
data := ByteArray new:totalBytes. |
|
298 |
inStream nextBytes:totalBytes into:data. |
|
299 | 299 |
|
37 | 300 |
" |
4016 | 301 |
mhmh - pixel-byte order is blue-green-red; swap blue & red bytes |
37 | 302 |
" |
1738 | 303 |
self class swap:totalBytes bytesFromRGB_to_BGR_in:data. |
37 | 304 |
|
3998 | 305 |
"Modified: / 29-08-2017 / 23:06:02 / cg" |
4016 | 306 |
"Modified (comment): / 17-09-2017 / 13:37:53 / cg" |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
307 |
! |
37 | 308 |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
309 |
read24RLE |
4016 | 310 |
"read an 8 bit/pixel rle encoded targa-image. |
311 |
Notice, that the channels are in bgr order; not rgb" |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
312 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
313 |
|total count dstIndex code n r g b| |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
314 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
315 |
data := ByteArray new:((total := width * height * 3)). |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
316 |
count := 0. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
317 |
dstIndex := 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
318 |
[count < total] whileTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
319 |
code := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
320 |
n := (code bitAnd:16r7F) + 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
321 |
(code bitAnd:16r80) ~~ 0 ifTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
322 |
b := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
323 |
g := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
324 |
r := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
325 |
n timesRepeat:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
326 |
data at:dstIndex put:r. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
327 |
data at:dstIndex+1 put:g. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
328 |
data at:dstIndex+2 put:b. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
329 |
dstIndex := dstIndex + 3 |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
330 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
331 |
] ifFalse:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
332 |
n timesRepeat:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
333 |
b := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
334 |
g := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
335 |
r := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
336 |
data at:dstIndex put:r. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
337 |
data at:dstIndex+1 put:g. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
338 |
data at:dstIndex+2 put:b. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
339 |
dstIndex := dstIndex + 3 |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
340 |
] |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
341 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
342 |
count := count + (n * 3). |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
343 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
344 |
|
3998 | 345 |
"Created: / 21-04-1997 / 20:43:23 / cg" |
346 |
"Modified: / 29-08-2017 / 23:06:35 / cg" |
|
4016 | 347 |
"Modified (comment): / 17-09-2017 / 13:37:58 / cg" |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
348 |
! |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
349 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
350 |
read32 |
4016 | 351 |
"read a 32 bit/pixel targa-image. |
352 |
Notice, that the channels are in bgra order; not rgba" |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
353 |
|
1738 | 354 |
|totalBytes remainingBytes dstIndex a r g b| |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
355 |
|
3998 | 356 |
totalBytes := width * height * 4. |
1738 | 357 |
data := ByteArray new:totalBytes. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
358 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
359 |
dstIndex := 1. |
1738 | 360 |
remainingBytes := totalBytes. |
361 |
[remainingBytes > 0] whileTrue:[ |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
362 |
b := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
363 |
g := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
364 |
r := inStream nextByte. |
3998 | 365 |
a := inStream nextByte. |
1738 | 366 |
data at:dstIndex put:r. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
367 |
data at:dstIndex+1 put:g. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
368 |
data at:dstIndex+2 put:b. |
3998 | 369 |
data at:dstIndex+3 put:a. |
370 |
dstIndex := dstIndex + 4. |
|
371 |
remainingBytes := remainingBytes - 4. |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
372 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
373 |
|
1738 | 374 |
" |
375 |
TargaReader fromFile:'/phys/exept//unsaved1/pd_stuff/graphic/3d_engines/crystal_space/CS/plugins/video/canvas/sdl/img/move.tga' |
|
376 |
TargaReader fromFile:'/phys/exept/unsaved2/smalltalk/Squeak/croquet/Croquet/Content/Cisco/2520/Textures/2520caseback.tga' |
|
377 |
TargaReader fromFile:'/phys/exept/unsaved2/smalltalk/Squeak/croquet/Croquet/Content/Cisco/2520/Textures/2520dimm1front.tga' |
|
378 |
" |
|
3998 | 379 |
|
380 |
"Modified: / 29-08-2017 / 23:09:42 / cg" |
|
4016 | 381 |
"Modified (comment): / 17-09-2017 / 13:37:26 / cg" |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
382 |
! |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
383 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
384 |
read32RLE |
4016 | 385 |
"read a 32 bit/pixel rle encoded targa-image; skip alpha channel (for now). |
386 |
Notice, that the channels are in bgra order; not rgba" |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
387 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
388 |
|total count dstIndex code n a r g b| |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
389 |
|
3998 | 390 |
data := ByteArray new:((total := width * height * 4)). |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
391 |
count := 0. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
392 |
dstIndex := 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
393 |
[count < total] whileTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
394 |
code := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
395 |
n := (code bitAnd:16r7F) + 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
396 |
(code bitAnd:16r80) ~~ 0 ifTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
397 |
b := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
398 |
g := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
399 |
r := inStream nextByte. |
3998 | 400 |
a := inStream nextByte. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
401 |
n timesRepeat:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
402 |
data at:dstIndex put:r. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
403 |
data at:dstIndex+1 put:g. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
404 |
data at:dstIndex+2 put:b. |
3998 | 405 |
data at:dstIndex+3 put:a. |
406 |
dstIndex := dstIndex + 4 |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
407 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
408 |
] ifFalse:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
409 |
n timesRepeat:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
410 |
b := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
411 |
g := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
412 |
r := inStream nextByte. |
3998 | 413 |
a := inStream nextByte. |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
414 |
data at:dstIndex put:r. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
415 |
data at:dstIndex+1 put:g. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
416 |
data at:dstIndex+2 put:b. |
3998 | 417 |
data at:dstIndex+3 put:a. |
418 |
dstIndex := dstIndex + 4 |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
419 |
] |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
420 |
]. |
4002 | 421 |
count := count + (n * 4). |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
422 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
423 |
|
3998 | 424 |
"Created: / 21-04-1997 / 20:43:54 / cg" |
4002 | 425 |
"Modified: / 29-08-2017 / 23:35:48 / cg" |
4016 | 426 |
"Modified (comment): / 17-09-2017 / 13:37:37 / cg" |
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
427 |
! |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
428 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
429 |
read8 |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
430 |
"read an 8 bit/pixel targa-image" |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
431 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
432 |
data := ByteArray new:(width * height). |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
433 |
inStream nextBytes:(data size) into:data. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
434 |
|
3998 | 435 |
"Created: / 21-04-1997 / 20:12:35 / cg" |
436 |
"Modified: / 29-08-2017 / 23:10:32 / cg" |
|
555
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
437 |
! |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
438 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
439 |
read8RLE |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
440 |
"read an 8 bit/pixel rle encoded targa-image" |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
441 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
442 |
|total count dstIndex code n byte| |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
443 |
|
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
444 |
data := ByteArray new:((total := width * height)). |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
445 |
count := 0. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
446 |
dstIndex := 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
447 |
[count < total] whileTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
448 |
code := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
449 |
n := (code bitAnd:16r7F) + 1. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
450 |
(code bitAnd:16r80) ~~ 0 ifTrue:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
451 |
byte := inStream nextByte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
452 |
data from:dstIndex to:dstIndex+n-1 put:byte. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
453 |
] ifFalse:[ |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
454 |
inStream nextBytes:n into:data startingAt:dstIndex. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
455 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
456 |
count := count + n. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
457 |
dstIndex := dstIndex + n. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
458 |
]. |
f51ec2cc4482
support RLE, 8 and 32 bit images
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
459 |
|
3998 | 460 |
"Created: / 21-04-1997 / 20:19:46 / cg" |
461 |
"Modified: / 29-08-2017 / 23:10:46 / cg" |
|
1738 | 462 |
! |
463 |
||
464 |
readColorMap:cmapLength |
|
465 |
colorMap := Array new:cmapLength. |
|
466 |
1 to:cmapLength do:[:index | |
|
467 |
|r g b| |
|
468 |
||
469 |
b := inStream nextByte. |
|
470 |
g := inStream nextByte. |
|
471 |
r := inStream nextByte. |
|
472 |
(r isNil or:[g isNil or:[b isNil]]) ifTrue:[ |
|
473 |
^ self fileFormatError:('short file - probably not targa format'). |
|
474 |
]. |
|
475 |
colorMap at:index put:(Color redByte:r greenByte:g blueByte:b). |
|
476 |
]. |
|
477 |
^ colorMap |
|
37 | 478 |
! ! |
479 |
||
1848 | 480 |
!TargaReader methodsFor:'reading'! |
481 |
||
482 |
readImage |
|
483 |
"read a targa-image from aFileName. return the receiver (with all |
|
484 |
relevant instance variables set for the image) or nil on error" |
|
485 |
||
3998 | 486 |
|depth flags lenID hasColorMap |
1848 | 487 |
cmapOffset cmapLength cmapEntrySize xOrg yOrg rle| |
488 |
||
489 |
inStream binary. |
|
490 |
||
491 |
lenID := inStream next. |
|
492 |
hasColorMap := inStream next. |
|
493 |
imageType := inStream next. |
|
494 |
cmapOffset := inStream nextShortMSB:false. |
|
495 |
cmapLength := inStream nextShortMSB:false. |
|
496 |
cmapEntrySize := inStream next. |
|
497 |
xOrg := inStream nextShortMSB:false. |
|
498 |
yOrg := inStream nextShortMSB:false. |
|
499 |
||
500 |
width := inStream nextShortMSB:false. |
|
501 |
height := inStream nextShortMSB:false. |
|
502 |
depth := inStream next. |
|
4002 | 503 |
(#(8 15 16 24 32) includes:depth) ifFalse:[ |
3998 | 504 |
^ self fileFormatError:'unsupported depth: %1' with:depth printString. |
1848 | 505 |
]. |
506 |
depth == 32 ifTrue:[ |
|
4016 | 507 |
Logger warning: 'TargaReader [info]: alpha channel ignored'. |
1848 | 508 |
] ifFalse:[ |
4016 | 509 |
Verbose == true ifTrue:[ Logger info:'TargaReader [info]: depth: %1' with:depth ]. |
1848 | 510 |
]. |
511 |
||
512 |
"/ MapRGB == 1 |
|
513 |
"/ RawRGB == 2 |
|
514 |
"/ RawMono == 3 |
|
515 |
"/ MapEnCode == 9 |
|
516 |
"/ RawEnCode == 10 |
|
517 |
||
3998 | 518 |
(#(1 2 3 9 10) includes:imageType) ifFalse:[ |
1848 | 519 |
"/ 'TargaReader [warning]: unsupported imageType: ' errorPrint. imageType errorPrintCR. |
3998 | 520 |
^ self fileFormatError:'unsupported imageType: %1' with:imageType printString. |
1848 | 521 |
]. |
4016 | 522 |
Verbose == true ifTrue:[ Logger info:'TargaReader [info]: imageType: %1' with:imageType]. |
1848 | 523 |
|
524 |
self reportDimension. |
|
525 |
||
526 |
"/ flags: |
|
527 |
"/ 0000 xxxx attribute-bits-per-pixel |
|
528 |
"/ 0000 0001 greysc |
|
529 |
"/ 0000 0010 colour |
|
530 |
"/ 0000 0011 mapped |
|
531 |
"/ 0000 0100 rleEncoded |
|
532 |
"/ 0000 1000 interlaced |
|
533 |
"/ 00xx 0000 origin (0 -> lower-left / 1 -> l-r / 2 -> u-l / 3 -> u-r) |
|
534 |
"/ xx00 0000 interleave (0 -> none / 1 -> odd/even / 2 ->4-fould / 3 reserved) |
|
535 |
"/ |
|
536 |
flags := inStream next. |
|
537 |
||
538 |
(flags bitAnd:2r11000000) ~~ 0 ifTrue:[ |
|
3998 | 539 |
^ self fileFormatError:'unsupported interlace: %1' with:flags printString. |
1848 | 540 |
]. |
541 |
||
542 |
rle := flags bitTest:2r000001000. |
|
543 |
flags := flags bitAnd:2r111110111. |
|
544 |
||
545 |
(flags bitAnd:2r00001111) ~~ 0 ifTrue:[ |
|
3998 | 546 |
^ self fileFormatError:'unsupported flags: %1' with:flags printString. |
1848 | 547 |
]. |
548 |
||
549 |
(flags bitAnd:2r00110000) == 16r20 ifTrue:[ |
|
550 |
orientation := #topLeft |
|
551 |
] ifFalse:[ |
|
552 |
(flags bitAnd:2r00110000) == 16r30 ifTrue:[ |
|
553 |
orientation := #topRight |
|
554 |
] ifFalse:[ |
|
555 |
(flags bitAnd:2r00110000) == 16r10 ifTrue:[ |
|
556 |
orientation := #bottomRight |
|
557 |
] ifFalse:[ |
|
558 |
(flags bitAnd:2r00110000) == 0 ifTrue:[ |
|
559 |
orientation := #bottomLeft |
|
560 |
] |
|
561 |
] |
|
562 |
] |
|
563 |
]. |
|
564 |
||
565 |
lenID ~~ 0 ifTrue:[ |
|
566 |
inStream skip:lenID |
|
567 |
]. |
|
568 |
||
569 |
hasColorMap ~~ 0 ifTrue:[ |
|
570 |
"/ read the colorMap |
|
571 |
colorMap := self readColorMap:cmapLength. |
|
572 |
'TargaReader [info]: has colorMap' infoPrintCR. |
|
573 |
]. |
|
574 |
||
575 |
depth == 32 ifTrue:[ |
|
576 |
imageType == 2 ifTrue:[ |
|
3998 | 577 |
"/ rle ifTrue:[self halt:'oops - should not happen']. |
1848 | 578 |
self read32. |
579 |
] ifFalse:[ |
|
3998 | 580 |
"/ rle ifFalse:[self halt:'oops - should not happen']. |
1848 | 581 |
self read32RLE. |
582 |
]. |
|
3998 | 583 |
|
584 |
photometric := #rgba. |
|
585 |
samplesPerPixel := 4. |
|
586 |
bitsPerSample := #(8 8 8 8). |
|
587 |
||
588 |
bytesPerRow := width*4. |
|
589 |
bytesPerPixel := 4. |
|
590 |
]. |
|
591 |
||
592 |
depth == 24 ifTrue:[ |
|
593 |
imageType == 2 ifTrue:[ |
|
594 |
"/ rle ifTrue:[self halt:'oops - should not happen']. |
|
595 |
self read24. |
|
596 |
] ifFalse:[ |
|
597 |
"/ rle ifFalse:[self halt:'oops - should not happen']. |
|
598 |
self read24RLE. |
|
599 |
]. |
|
600 |
||
601 |
photometric := #rgb. |
|
602 |
samplesPerPixel := 3. |
|
603 |
bitsPerSample := #(8 8 8). |
|
604 |
||
1848 | 605 |
bytesPerRow := width*3. |
606 |
bytesPerPixel := 3. |
|
607 |
]. |
|
3998 | 608 |
|
4002 | 609 |
((depth == 15) or:[depth == 16]) ifTrue:[ |
610 |
imageType == 2 ifTrue:[ |
|
611 |
"/ rle ifTrue:[self halt:'oops - should not happen']. |
|
612 |
self read16. |
|
613 |
] ifFalse:[ |
|
614 |
"/ rle ifFalse:[self halt:'oops - should not happen']. |
|
615 |
self read16RLE. |
|
616 |
]. |
|
617 |
||
618 |
photometric := #rgb. |
|
619 |
samplesPerPixel := 3. |
|
620 |
bitsPerSample := #(5 5 5). |
|
621 |
||
622 |
bytesPerRow := width*2. |
|
623 |
bytesPerPixel := 2. |
|
624 |
]. |
|
625 |
||
1848 | 626 |
depth == 8 ifTrue:[ |
3998 | 627 |
(imageType == 1 or:[imageType == 3]) ifTrue:[ |
628 |
"/ rle ifTrue:[self halt:'oops - should not happen']. |
|
1848 | 629 |
self read8. |
630 |
] ifFalse:[ |
|
3998 | 631 |
"/ rle ifFalse:[self halt:'oops - should not happen']. |
1848 | 632 |
self read8RLE |
633 |
]. |
|
3998 | 634 |
|
635 |
(imageType == 3 or:[colorMap isNil]) ifTrue:[ |
|
636 |
photometric := #blackIs0. |
|
637 |
] ifFalse:[ |
|
638 |
photometric := #palette. |
|
639 |
]. |
|
640 |
samplesPerPixel := 1. |
|
641 |
bitsPerSample := #(8). |
|
642 |
||
1848 | 643 |
bytesPerRow := width. |
644 |
bytesPerPixel := 1. |
|
645 |
]. |
|
646 |
||
647 |
self handleImageOrientation. |
|
648 |
||
649 |
" |
|
650 |
TargaReader fromFile:'bitmaps/test.tga' |
|
651 |
" |
|
652 |
||
3998 | 653 |
"Modified: / 13-10-1998 / 19:50:48 / ps" |
4016 | 654 |
"Modified: / 18-09-2017 / 08:56:24 / cg" |
1848 | 655 |
! ! |
656 |
||
210 | 657 |
!TargaReader class methodsFor:'documentation'! |
658 |
||
659 |
version |
|
3998 | 660 |
^ '$Header$' |
4001 | 661 |
! |
662 |
||
663 |
version_CVS |
|
664 |
^ '$Header$' |
|
210 | 665 |
! ! |
1738 | 666 |
|
3998 | 667 |
|
37 | 668 |
TargaReader initialize! |