author | ab |
Tue, 27 Nov 2012 18:44:36 +0100 | |
changeset 3036 | 158bdd183939 |
parent 1846 | d29322944b05 |
child 3855 | 1db7742d33ad |
permissions | -rw-r--r-- |
514 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
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 |
" |
|
12 |
||
13 |
||
1745
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
647
diff
changeset
|
14 |
"{ Package: 'stx:libview2' }" |
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
647
diff
changeset
|
15 |
|
510 | 16 |
ImageReader subclass:#FLIReader |
620 | 17 |
instanceVariableNames:'nframes frameBuffer frameBufferSize imageBuffer redPalette |
510 | 18 |
greenPalette bluePalette flags frameDelay' |
19 |
classVariableNames:'FLI_FILE_MAGIC FLC_FILE_MAGIC FLI_FRAME_MAGIC FILE_HEAD_SIZE |
|
20 |
FRAME_HEAD_SIZE CHUNK_HEAD_SIZE FLI_256_COLOR FLI_DELTA FLI_COLOR |
|
21 |
FLI_LC FLI_BLACK FLI_BRUN FLI_COPY FLI_MINI MAXCOLORS' |
|
22 |
poolDictionaries:'' |
|
1745
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
647
diff
changeset
|
23 |
category:'Graphics-Images-Readers' |
510 | 24 |
! |
25 |
||
26 |
!FLIReader class methodsFor:'documentation'! |
|
27 |
||
514 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
||
41 |
! |
|
42 |
||
510 | 43 |
documentation |
44 |
" |
|
45 |
Read frames from a FLI/FLC file. |
|
46 |
||
47 |
this is a very first attempt in reading FLI files; |
|
615 | 48 |
(a first experiment in reading that fileFormat) |
49 |
||
50 |
Its very experimental, preliminary and will certainly change. |
|
51 |
(will introduce a new class hierarchy based upon some MovieReader ...). |
|
510 | 52 |
|
53 |
When used like an imageReader, #fromFile: will return |
|
54 |
the very first frame. |
|
55 |
||
511 | 56 |
Warning: right now, the complete movie is read and huge |
57 |
amounts of memoru are allocated. The interface will be changed |
|
58 |
to allow stream operation ... |
|
59 |
||
510 | 60 |
[author:] |
61 |
Claus Gittinger |
|
62 |
||
63 |
[see also:] |
|
64 |
ImageReader |
|
65 |
" |
|
66 |
! |
|
67 |
||
68 |
examples |
|
69 |
" |
|
70 |
|reader film view tNext| |
|
71 |
||
72 |
reader := FLIReader readFile:'/usr/local/FLI/jeffmild.fli'. |
|
73 |
reader isNil ifTrue:[^ nil]. |
|
74 |
film := reader images. |
|
75 |
view := StandardSystemView extent:(film first extent). |
|
76 |
view openAndWait. |
|
77 |
||
78 |
tNext := Time millisecondClockValue + (reader frameDelay). |
|
79 |
film do:[:frame | |
|
80 |
frame displayOn:view x:0 y:0. |
|
81 |
(Delay untilMilliseconds:tNext) wait. |
|
82 |
tNext := tNext + (reader frameDelay). |
|
83 |
]. |
|
552 | 84 |
|
85 |
|reader film view tNext| |
|
86 |
||
87 |
FLIReader fromFile:('/cdrom/video/fli/dh_hai.fli'). |
|
88 |
reader := FLIReader readFile:'/cdrom/video/fli/dh_hai.fli'. |
|
89 |
reader isNil ifTrue:[^ nil]. |
|
90 |
film := reader images. |
|
91 |
view := StandardSystemView extent:(film first extent). |
|
92 |
view openAndWait. |
|
93 |
||
94 |
tNext := Time millisecondClockValue + (reader frameDelay). |
|
95 |
film do:[:frame | |
|
96 |
frame displayOn:view x:0 y:0. |
|
97 |
(Delay untilMilliseconds:tNext) wait. |
|
98 |
tNext := tNext + (reader frameDelay). |
|
99 |
]. |
|
100 |
||
101 |
||
102 |
|reader film view tNext| |
|
103 |
||
104 |
reader := FLIReader readFile:'/cdrom/video/fli/wedding.fli'. |
|
105 |
reader isNil ifTrue:[^ nil]. |
|
106 |
film := reader images. |
|
107 |
view := StandardSystemView extent:(film first extent). |
|
108 |
view openAndWait. |
|
109 |
||
110 |
tNext := Time millisecondClockValue + (reader frameDelay). |
|
111 |
film do:[:frame | |
|
112 |
frame displayOn:view x:0 y:0. |
|
113 |
(Delay untilMilliseconds:tNext) wait. |
|
114 |
tNext := tNext + (reader frameDelay). |
|
115 |
]. |
|
510 | 116 |
" |
117 |
! ! |
|
118 |
||
119 |
!FLIReader class methodsFor:'class initialization'! |
|
120 |
||
121 |
initialize |
|
557 | 122 |
"install myself in the Image classes fileFormat table |
123 |
for the `.fli' and '.flc' extensions." |
|
124 |
||
647 | 125 |
MIMETypes defineImageType:'video/x-fli' suffix:'fli' reader:self. |
126 |
MIMETypes defineImageType:nil suffix:'flc' reader:self. |
|
557 | 127 |
|
510 | 128 |
FLI_FILE_MAGIC := 16rAF11. |
129 |
FLC_FILE_MAGIC := 16rAF12. |
|
130 |
||
131 |
FLI_FRAME_MAGIC := 16rF1FA. |
|
132 |
||
133 |
FILE_HEAD_SIZE := 128. |
|
134 |
FRAME_HEAD_SIZE := 16. |
|
135 |
CHUNK_HEAD_SIZE := 6. |
|
136 |
||
137 |
FLI_256_COLOR := 4. |
|
138 |
FLI_DELTA := 7. |
|
139 |
FLI_COLOR := 11. |
|
140 |
FLI_LC := 12. |
|
141 |
FLI_BLACK := 13. |
|
142 |
FLI_BRUN := 15. |
|
143 |
FLI_COPY := 16. |
|
144 |
FLI_MINI := 18. |
|
145 |
||
146 |
MAXCOLORS := 256. |
|
147 |
||
148 |
" |
|
149 |
FLIReader initialize |
|
150 |
" |
|
151 |
||
557 | 152 |
"Modified: 21.4.1997 / 21:16:48 / cg" |
510 | 153 |
! ! |
154 |
||
155 |
!FLIReader class methodsFor:'testing'! |
|
156 |
||
157 |
isValidImageFile:aFileName |
|
158 |
"return true, if aFileName contains an FLI/FLC-movie" |
|
159 |
||
160 |
|header n inStream len type| |
|
161 |
||
162 |
inStream := self streamReadingFile:aFileName. |
|
163 |
inStream isNil ifTrue:[^ false]. |
|
164 |
||
165 |
header := ByteArray new:FILE_HEAD_SIZE. |
|
166 |
n := inStream nextBytes:FILE_HEAD_SIZE into:header. |
|
167 |
inStream close. |
|
168 |
n ~~ FILE_HEAD_SIZE ifTrue:[^ false]. |
|
169 |
||
170 |
len := header doubleWordAt:(1+0). |
|
171 |
type := header wordAt:(1+4). |
|
172 |
||
173 |
type ~~ FLI_FILE_MAGIC ifTrue:[ |
|
174 |
type ~~ FLC_FILE_MAGIC ifTrue:[ |
|
175 |
^ false |
|
176 |
] |
|
177 |
]. |
|
178 |
^ true |
|
179 |
||
180 |
" |
|
181 |
FLIReader isValidImageFile:'bitmaps/magtape.xpm' |
|
182 |
FLIReader isValidImageFile:'/usr/local/FLI/jeffmild.fli' |
|
183 |
" |
|
184 |
||
185 |
"Modified: 4.4.1997 / 22:30:19 / cg" |
|
186 |
! ! |
|
187 |
||
188 |
!FLIReader methodsFor:'accessing'! |
|
189 |
||
190 |
frameDelay |
|
191 |
"return the value of the instance variable 'frameDelay' (automatically generated)" |
|
192 |
||
193 |
^ frameDelay |
|
194 |
||
195 |
"Created: 4.4.1997 / 21:59:02 / cg" |
|
196 |
! |
|
197 |
||
198 |
images |
|
199 |
"return a collection of all images as represented by myself" |
|
200 |
||
621 | 201 |
|image depth| |
510 | 202 |
|
203 |
depth := self bitsPerPixel. |
|
204 |
||
621 | 205 |
1 to:imageSequence size do:[:i | |
206 |
|frame| |
|
207 |
||
208 |
frame := imageSequence at:i. |
|
209 |
||
210 |
frame isImage ifFalse:[ |
|
211 |
image := (Image implementorForDepth:depth) new. |
|
212 |
image |
|
213 |
width:width |
|
214 |
height:height |
|
215 |
photometric:photometric |
|
216 |
samplesPerPixel:samplesPerPixel |
|
217 |
bitsPerSample:bitsPerSample |
|
218 |
colorMap:colorMap |
|
219 |
bits:frame |
|
220 |
mask:mask. |
|
221 |
imageSequence at:i put:image. |
|
222 |
] |
|
510 | 223 |
]. |
621 | 224 |
^ imageSequence |
510 | 225 |
|
226 |
"Created: 4.4.1997 / 21:44:44 / cg" |
|
621 | 227 |
"Modified: 24.6.1997 / 15:57:22 / cg" |
510 | 228 |
! ! |
229 |
||
1805 | 230 |
!FLIReader methodsFor:'private-reading'! |
231 |
||
232 |
getFrame |
|
233 |
"get a single frame" |
|
234 |
||
235 |
|header n len type dataLen nchunks| |
|
236 |
||
237 |
header := ByteArray new:FRAME_HEAD_SIZE. |
|
238 |
n := inStream nextBytes:FRAME_HEAD_SIZE into:header. |
|
239 |
n ~~ FRAME_HEAD_SIZE ifTrue:[^ false]. |
|
240 |
||
241 |
len := header doubleWordAt:(1+0). |
|
242 |
type := header wordAt:(1+4). |
|
243 |
||
244 |
type ~~ FLI_FRAME_MAGIC ifTrue:[^ false]. |
|
245 |
||
246 |
dataLen := len - FRAME_HEAD_SIZE. |
|
247 |
dataLen > frameBufferSize ifTrue:[ |
|
248 |
frameBuffer := ByteArray uninitializedNew:dataLen. |
|
249 |
frameBufferSize := dataLen. |
|
250 |
]. |
|
251 |
||
252 |
n := inStream nextBytes:dataLen into:frameBuffer. |
|
253 |
n ~~ dataLen ifTrue:[^ false]. |
|
254 |
||
255 |
nchunks := header wordAt:(1+6). |
|
256 |
nchunks == 0 ifTrue:[ |
|
257 |
"/ mhmh - a timing frame; should add a dummy frame |
|
258 |
^ self. |
|
259 |
]. |
|
260 |
^ self processChunks:nchunks size:dataLen. |
|
261 |
||
262 |
" |
|
263 |
FLIReader fromFile:'bitmaps/magtape.xpm' |
|
264 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
265 |
" |
|
266 |
||
267 |
"Created: 3.4.1997 / 22:15:19 / cg" |
|
268 |
"Modified: 4.4.1997 / 22:18:21 / cg" |
|
269 |
! |
|
270 |
||
271 |
getHeader |
|
272 |
"read the header; return true, if its valid" |
|
273 |
||
274 |
|header n len type speed| |
|
275 |
||
276 |
header := ByteArray new:FILE_HEAD_SIZE. |
|
277 |
n := inStream nextBytes:FILE_HEAD_SIZE into:header. |
|
278 |
n ~~ FILE_HEAD_SIZE ifTrue:[^ false]. |
|
279 |
||
280 |
len := header doubleWordAt:(1+0). |
|
281 |
type := header wordAt:(1+4). |
|
282 |
||
283 |
type ~~ FLI_FILE_MAGIC ifTrue:[ |
|
284 |
type ~~ FLC_FILE_MAGIC ifTrue:[ |
|
285 |
^ false |
|
286 |
] |
|
287 |
]. |
|
288 |
||
289 |
nframes := header wordAt:(1+6). |
|
290 |
width := header wordAt:(1+8). |
|
291 |
height := header wordAt:(1+10). |
|
292 |
||
1846 | 293 |
self reportDimension. |
294 |
||
1805 | 295 |
flags := header wordAt:(1+14). |
296 |
speed := header wordAt:(1+16). |
|
297 |
speed <= 0 ifTrue:[ |
|
298 |
speed := 1 |
|
299 |
]. |
|
300 |
"/ FLI uses 1/70th of a second; |
|
301 |
"/ FLC measures the frameDelay in milliseconds |
|
302 |
type == FLI_FILE_MAGIC ifTrue:[ |
|
303 |
frameDelay := 1000 * speed // 70 |
|
304 |
] ifFalse:[ |
|
305 |
frameDelay := speed |
|
306 |
]. |
|
307 |
||
308 |
frameBufferSize := width * height. |
|
309 |
frameBuffer := ByteArray uninitializedNew:frameBufferSize. |
|
310 |
||
311 |
redPalette := ByteArray new:256. |
|
312 |
greenPalette := ByteArray new:256. |
|
313 |
bluePalette := ByteArray new:256. |
|
314 |
||
315 |
imageSequence := OrderedCollection new:nframes. |
|
316 |
||
317 |
^ true |
|
318 |
||
319 |
" |
|
320 |
FLIReader fromFile:'bitmaps/magtape.xpm' |
|
321 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
322 |
" |
|
323 |
||
324 |
"Created: 3.4.1997 / 22:09:12 / cg" |
|
325 |
"Modified: 24.6.1997 / 15:31:39 / cg" |
|
326 |
! ! |
|
327 |
||
510 | 328 |
!FLIReader methodsFor:'processing chunks'! |
329 |
||
330 |
brunChunkAt:chunkOffs |
|
331 |
|offs lineIdx nextLineIdx packets sz| |
|
332 |
||
512 | 333 |
"/ 'brunChunkAt' infoPrintCR. |
510 | 334 |
|
335 |
imageBuffer := ByteArray uninitializedNew:(width*height). |
|
336 |
||
337 |
offs := chunkOffs. |
|
338 |
lineIdx := 1. |
|
339 |
1 to:height do:[:y | |
|
340 |
nextLineIdx := lineIdx + width. |
|
341 |
||
342 |
packets := frameBuffer byteAt:offs. offs := offs + 1. |
|
343 |
||
344 |
1 to:packets do:[:p | |
|
345 |
sz := frameBuffer signedByteAt:offs. offs := offs + 1. |
|
346 |
sz > 0 ifTrue:[ |
|
347 |
data := frameBuffer at:offs. offs := offs + 1. |
|
348 |
imageBuffer from:lineIdx to:(lineIdx+sz-1) put:data. |
|
349 |
] ifFalse:[ |
|
350 |
sz == 0 ifTrue:[ |
|
351 |
self halt:'error in brun chunk'. |
|
352 |
^ self. |
|
353 |
]. |
|
354 |
sz := sz negated. |
|
355 |
imageBuffer replaceFrom:lineIdx to:(lineIdx+sz-1) |
|
356 |
with:frameBuffer startingAt:offs. |
|
357 |
offs := offs + sz. |
|
358 |
]. |
|
359 |
lineIdx := lineIdx + sz. |
|
360 |
]. |
|
361 |
lineIdx := nextLineIdx |
|
362 |
]. |
|
363 |
||
620 | 364 |
imageSequence add:imageBuffer. |
510 | 365 |
|
366 |
" |
|
367 |
FLIReader imagesFromFile:'/usr/local/FLI/jeffmild.fli' |
|
368 |
" |
|
369 |
||
620 | 370 |
"Modified: 24.6.1997 / 15:31:22 / cg" |
510 | 371 |
! |
372 |
||
373 |
color256ChunkAt:chunkOffs |
|
512 | 374 |
"/ 'color256Chunk' infoPrintCR. |
510 | 375 |
self colorChunkAt:chunkOffs shift:0 |
376 |
||
512 | 377 |
"Modified: 4.4.1997 / 22:45:42 / cg" |
510 | 378 |
! |
379 |
||
380 |
color64ChunkAt:chunkOffs |
|
512 | 381 |
"/ 'color64Chunk' infoPrintCR. |
510 | 382 |
self colorChunkAt:chunkOffs shift:2 |
383 |
||
512 | 384 |
"Modified: 4.4.1997 / 22:45:45 / cg" |
510 | 385 |
! |
386 |
||
387 |
colorChunkAt:chunkOffs shift:colorShift |
|
388 |
|b0 b1 packets offs ic skip change red green blue| |
|
389 |
||
512 | 390 |
"/ ' colorChunk' infoPrintCR. |
510 | 391 |
|
392 |
offs := chunkOffs. |
|
393 |
packets := frameBuffer wordAt:offs. offs := offs + 2. |
|
394 |
||
395 |
ic := 0. |
|
396 |
1 to:packets do:[:i | |
|
397 |
skip := frameBuffer byteAt:offs. offs := offs + 1. |
|
398 |
ic := ic + skip. |
|
399 |
ic := ic \\ MAXCOLORS. |
|
400 |
change := frameBuffer byteAt:offs. offs := offs + 1. |
|
401 |
change == 0 ifTrue:[change := 256]. |
|
402 |
||
403 |
1 to:change do:[:n | |
|
404 |
red := frameBuffer at:offs. offs := offs + 1. |
|
405 |
green := frameBuffer at:offs. offs := offs + 1. |
|
406 |
blue := frameBuffer at:offs. offs := offs + 1. |
|
407 |
red := red bitShift:colorShift. |
|
408 |
green := green bitShift:colorShift. |
|
409 |
blue := blue bitShift:colorShift. |
|
410 |
"/ red print. ' ' print. green print. ' ' print. blue printCR. |
|
411 |
||
412 |
redPalette at:(ic + 1) put:red. |
|
413 |
greenPalette at:(ic + 1) put:green. |
|
414 |
bluePalette at:(ic + 1) put:blue. |
|
415 |
ic := ic + 1. |
|
416 |
] |
|
417 |
]. |
|
418 |
||
419 |
" |
|
420 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
421 |
" |
|
422 |
||
512 | 423 |
"Modified: 4.4.1997 / 22:45:49 / cg" |
510 | 424 |
! |
425 |
||
426 |
deltaChunkAt:chunkOffs |
|
512 | 427 |
"/ 'deltaChunkAt' infoPrintCR. |
510 | 428 |
|
557 | 429 |
Image badImageFormatQuerySignal raiseErrorString:'FLIReader [error]: delta chunks not yet implemented' |
430 |
||
431 |
"Modified: 21.4.1997 / 21:15:05 / cg" |
|
510 | 432 |
! |
433 |
||
434 |
lcChunkAt:chunkOffs |
|
435 |
|jnext lines lineCnt offs lineIdx packets idx skip sz| |
|
436 |
||
512 | 437 |
"/ 'lcChunkAt' infoPrintCR. |
510 | 438 |
|
439 |
imageBuffer := imageBuffer copyFrom:1 to:(width*height). |
|
440 |
||
441 |
offs := chunkOffs. |
|
442 |
||
443 |
jnext := frameBuffer wordAt:offs. offs := offs + 2. |
|
444 |
lines := frameBuffer wordAt:offs. offs := offs + 2. |
|
445 |
lineCnt := 0. |
|
446 |
lineIdx := 1. |
|
447 |
||
448 |
0 to:height-1 do:[:row | |
|
449 |
lineCnt >= lines ifTrue:[ |
|
620 | 450 |
imageSequence add:imageBuffer. |
510 | 451 |
^ self |
452 |
]. |
|
453 |
||
454 |
row < jnext ifFalse:[ |
|
455 |
packets := frameBuffer byteAt:offs. offs := offs + 1. |
|
456 |
lineCnt := lineCnt + 1. |
|
457 |
idx := lineIdx. |
|
458 |
1 to:packets do:[:p | |
|
459 |
skip := frameBuffer byteAt:offs. offs := offs + 1. |
|
460 |
idx := idx + skip. |
|
461 |
sz := frameBuffer signedByteAt:offs. offs := offs + 1. |
|
462 |
sz > 0 ifTrue:[ |
|
463 |
imageBuffer replaceFrom:idx to:(idx+sz-1) |
|
464 |
with:frameBuffer startingAt:offs. |
|
465 |
offs := offs + sz. |
|
466 |
] ifFalse:[ |
|
467 |
sz < 0 ifTrue:[ |
|
468 |
sz := sz negated. |
|
469 |
data := frameBuffer at:offs. offs := offs + 1. |
|
470 |
imageBuffer from:idx to:(idx+sz-1) put:data. |
|
471 |
] |
|
472 |
]. |
|
473 |
idx := idx + sz. |
|
474 |
]. |
|
475 |
]. |
|
476 |
lineIdx := lineIdx + width |
|
477 |
]. |
|
620 | 478 |
imageSequence add:imageBuffer. |
510 | 479 |
|
620 | 480 |
"Modified: 24.6.1997 / 15:31:25 / cg" |
510 | 481 |
! |
482 |
||
483 |
processChunks:nchunks size:dataLen |
|
484 |
"process chunks in a frame" |
|
485 |
||
486 |
|len type offs chunkOffs| |
|
487 |
||
488 |
offs := 1+0. |
|
489 |
1 to:nchunks do:[:chunkIndex | |
|
490 |
len := frameBuffer doubleWordAt:(offs+0). |
|
491 |
type := frameBuffer wordAt:(offs+4). |
|
492 |
chunkOffs := offs + CHUNK_HEAD_SIZE. |
|
493 |
||
494 |
type == FLI_COLOR ifTrue:[ |
|
495 |
self color64ChunkAt:chunkOffs. |
|
496 |
] ifFalse:[ |
|
497 |
type == FLI_256_COLOR ifTrue:[ |
|
498 |
self color256ChunkAt:chunkOffs. |
|
499 |
] ifFalse:[ |
|
500 |
type == FLI_DELTA ifTrue:[ |
|
501 |
self deltaChunkAt:chunkOffs. |
|
502 |
] ifFalse:[ |
|
503 |
type == FLI_LC ifTrue:[ |
|
504 |
self lcChunkAt:chunkOffs. |
|
505 |
] ifFalse:[ |
|
506 |
type == FLI_BRUN ifTrue:[ |
|
507 |
self brunChunkAt:chunkOffs. |
|
508 |
] ifFalse:[ |
|
509 |
'FLI [info]: unknown chunk type: ' infoPrint. |
|
510 |
type hexPrintString infoPrintCR. |
|
511 |
^ false. |
|
512 |
] |
|
513 |
] |
|
514 |
] |
|
515 |
]. |
|
516 |
]. |
|
517 |
offs := offs + len |
|
518 |
]. |
|
519 |
||
520 |
" |
|
521 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
522 |
" |
|
523 |
||
524 |
"Created: 3.4.1997 / 22:28:11 / cg" |
|
525 |
"Modified: 3.4.1997 / 22:52:38 / cg" |
|
526 |
! ! |
|
527 |
||
1805 | 528 |
!FLIReader methodsFor:'reading'! |
510 | 529 |
|
530 |
fromStream:aStream |
|
512 | 531 |
"read a FLI-movie from aStream." |
510 | 532 |
|
533 |
inStream := aStream. |
|
534 |
||
535 |
(self getHeader) ifFalse:[^ nil]. |
|
536 |
||
557 | 537 |
Image badImageFormatQuerySignal handle:[:ex | |
538 |
ex errorString infoPrintCR. |
|
539 |
^ nil |
|
540 |
] do:[ |
|
541 |
1 to:nframes do:[:frameIndex | |
|
542 |
self getFrame |
|
543 |
] |
|
510 | 544 |
]. |
545 |
||
1759
f52382e5a9b8
slowly getting rid of the Colormap class
Claus Gittinger <cg@exept.de>
parents:
1745
diff
changeset
|
546 |
colorMap := MappedPalette |
510 | 547 |
redVector:redPalette |
548 |
greenVector:greenPalette |
|
549 |
blueVector:bluePalette. |
|
550 |
||
551 |
photometric := #palette. |
|
552 |
samplesPerPixel := 1. |
|
553 |
bitsPerSample := #(8). |
|
554 |
||
555 |
" |
|
556 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
621 | 557 |
Image fromFile:'/usr/local/FLI/jeffmild.fli' |
510 | 558 |
" |
559 |
||
621 | 560 |
"Modified: 24.6.1997 / 15:58:18 / cg" |
510 | 561 |
! ! |
562 |
||
563 |
!FLIReader class methodsFor:'documentation'! |
|
564 |
||
565 |
version |
|
1846 | 566 |
^ '$Header: /cvs/stx/stx/libview2/FLIReader.st,v 1.14 2003-11-19 15:28:19 cg Exp $' |
510 | 567 |
! ! |
1745
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
647
diff
changeset
|
568 |
|
510 | 569 |
FLIReader initialize! |