author | Claus Gittinger <cg@exept.de> |
Mon, 01 Sep 2003 16:47:57 +0200 | |
changeset 1805 | 93f557cbe600 |
parent 1759 | f52382e5a9b8 |
child 1846 | d29322944b05 |
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 |
||
293 |
dimensionCallBack notNil ifTrue:[ |
|
294 |
dimensionCallBack value |
|
295 |
]. |
|
296 |
flags := header wordAt:(1+14). |
|
297 |
speed := header wordAt:(1+16). |
|
298 |
speed <= 0 ifTrue:[ |
|
299 |
speed := 1 |
|
300 |
]. |
|
301 |
"/ FLI uses 1/70th of a second; |
|
302 |
"/ FLC measures the frameDelay in milliseconds |
|
303 |
type == FLI_FILE_MAGIC ifTrue:[ |
|
304 |
frameDelay := 1000 * speed // 70 |
|
305 |
] ifFalse:[ |
|
306 |
frameDelay := speed |
|
307 |
]. |
|
308 |
||
309 |
frameBufferSize := width * height. |
|
310 |
frameBuffer := ByteArray uninitializedNew:frameBufferSize. |
|
311 |
||
312 |
redPalette := ByteArray new:256. |
|
313 |
greenPalette := ByteArray new:256. |
|
314 |
bluePalette := ByteArray new:256. |
|
315 |
||
316 |
imageSequence := OrderedCollection new:nframes. |
|
317 |
||
318 |
^ true |
|
319 |
||
320 |
" |
|
321 |
FLIReader fromFile:'bitmaps/magtape.xpm' |
|
322 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
323 |
" |
|
324 |
||
325 |
"Created: 3.4.1997 / 22:09:12 / cg" |
|
326 |
"Modified: 24.6.1997 / 15:31:39 / cg" |
|
327 |
! ! |
|
328 |
||
510 | 329 |
!FLIReader methodsFor:'processing chunks'! |
330 |
||
331 |
brunChunkAt:chunkOffs |
|
332 |
|offs lineIdx nextLineIdx packets sz| |
|
333 |
||
512 | 334 |
"/ 'brunChunkAt' infoPrintCR. |
510 | 335 |
|
336 |
imageBuffer := ByteArray uninitializedNew:(width*height). |
|
337 |
||
338 |
offs := chunkOffs. |
|
339 |
lineIdx := 1. |
|
340 |
1 to:height do:[:y | |
|
341 |
nextLineIdx := lineIdx + width. |
|
342 |
||
343 |
packets := frameBuffer byteAt:offs. offs := offs + 1. |
|
344 |
||
345 |
1 to:packets do:[:p | |
|
346 |
sz := frameBuffer signedByteAt:offs. offs := offs + 1. |
|
347 |
sz > 0 ifTrue:[ |
|
348 |
data := frameBuffer at:offs. offs := offs + 1. |
|
349 |
imageBuffer from:lineIdx to:(lineIdx+sz-1) put:data. |
|
350 |
] ifFalse:[ |
|
351 |
sz == 0 ifTrue:[ |
|
352 |
self halt:'error in brun chunk'. |
|
353 |
^ self. |
|
354 |
]. |
|
355 |
sz := sz negated. |
|
356 |
imageBuffer replaceFrom:lineIdx to:(lineIdx+sz-1) |
|
357 |
with:frameBuffer startingAt:offs. |
|
358 |
offs := offs + sz. |
|
359 |
]. |
|
360 |
lineIdx := lineIdx + sz. |
|
361 |
]. |
|
362 |
lineIdx := nextLineIdx |
|
363 |
]. |
|
364 |
||
620 | 365 |
imageSequence add:imageBuffer. |
510 | 366 |
|
367 |
" |
|
368 |
FLIReader imagesFromFile:'/usr/local/FLI/jeffmild.fli' |
|
369 |
" |
|
370 |
||
620 | 371 |
"Modified: 24.6.1997 / 15:31:22 / cg" |
510 | 372 |
! |
373 |
||
374 |
color256ChunkAt:chunkOffs |
|
512 | 375 |
"/ 'color256Chunk' infoPrintCR. |
510 | 376 |
self colorChunkAt:chunkOffs shift:0 |
377 |
||
512 | 378 |
"Modified: 4.4.1997 / 22:45:42 / cg" |
510 | 379 |
! |
380 |
||
381 |
color64ChunkAt:chunkOffs |
|
512 | 382 |
"/ 'color64Chunk' infoPrintCR. |
510 | 383 |
self colorChunkAt:chunkOffs shift:2 |
384 |
||
512 | 385 |
"Modified: 4.4.1997 / 22:45:45 / cg" |
510 | 386 |
! |
387 |
||
388 |
colorChunkAt:chunkOffs shift:colorShift |
|
389 |
|b0 b1 packets offs ic skip change red green blue| |
|
390 |
||
512 | 391 |
"/ ' colorChunk' infoPrintCR. |
510 | 392 |
|
393 |
offs := chunkOffs. |
|
394 |
packets := frameBuffer wordAt:offs. offs := offs + 2. |
|
395 |
||
396 |
ic := 0. |
|
397 |
1 to:packets do:[:i | |
|
398 |
skip := frameBuffer byteAt:offs. offs := offs + 1. |
|
399 |
ic := ic + skip. |
|
400 |
ic := ic \\ MAXCOLORS. |
|
401 |
change := frameBuffer byteAt:offs. offs := offs + 1. |
|
402 |
change == 0 ifTrue:[change := 256]. |
|
403 |
||
404 |
1 to:change do:[:n | |
|
405 |
red := frameBuffer at:offs. offs := offs + 1. |
|
406 |
green := frameBuffer at:offs. offs := offs + 1. |
|
407 |
blue := frameBuffer at:offs. offs := offs + 1. |
|
408 |
red := red bitShift:colorShift. |
|
409 |
green := green bitShift:colorShift. |
|
410 |
blue := blue bitShift:colorShift. |
|
411 |
"/ red print. ' ' print. green print. ' ' print. blue printCR. |
|
412 |
||
413 |
redPalette at:(ic + 1) put:red. |
|
414 |
greenPalette at:(ic + 1) put:green. |
|
415 |
bluePalette at:(ic + 1) put:blue. |
|
416 |
ic := ic + 1. |
|
417 |
] |
|
418 |
]. |
|
419 |
||
420 |
" |
|
421 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
422 |
" |
|
423 |
||
512 | 424 |
"Modified: 4.4.1997 / 22:45:49 / cg" |
510 | 425 |
! |
426 |
||
427 |
deltaChunkAt:chunkOffs |
|
512 | 428 |
"/ 'deltaChunkAt' infoPrintCR. |
510 | 429 |
|
557 | 430 |
Image badImageFormatQuerySignal raiseErrorString:'FLIReader [error]: delta chunks not yet implemented' |
431 |
||
432 |
"Modified: 21.4.1997 / 21:15:05 / cg" |
|
510 | 433 |
! |
434 |
||
435 |
lcChunkAt:chunkOffs |
|
436 |
|jnext lines lineCnt offs lineIdx packets idx skip sz| |
|
437 |
||
512 | 438 |
"/ 'lcChunkAt' infoPrintCR. |
510 | 439 |
|
440 |
imageBuffer := imageBuffer copyFrom:1 to:(width*height). |
|
441 |
||
442 |
offs := chunkOffs. |
|
443 |
||
444 |
jnext := frameBuffer wordAt:offs. offs := offs + 2. |
|
445 |
lines := frameBuffer wordAt:offs. offs := offs + 2. |
|
446 |
lineCnt := 0. |
|
447 |
lineIdx := 1. |
|
448 |
||
449 |
0 to:height-1 do:[:row | |
|
450 |
lineCnt >= lines ifTrue:[ |
|
620 | 451 |
imageSequence add:imageBuffer. |
510 | 452 |
^ self |
453 |
]. |
|
454 |
||
455 |
row < jnext ifFalse:[ |
|
456 |
packets := frameBuffer byteAt:offs. offs := offs + 1. |
|
457 |
lineCnt := lineCnt + 1. |
|
458 |
idx := lineIdx. |
|
459 |
1 to:packets do:[:p | |
|
460 |
skip := frameBuffer byteAt:offs. offs := offs + 1. |
|
461 |
idx := idx + skip. |
|
462 |
sz := frameBuffer signedByteAt:offs. offs := offs + 1. |
|
463 |
sz > 0 ifTrue:[ |
|
464 |
imageBuffer replaceFrom:idx to:(idx+sz-1) |
|
465 |
with:frameBuffer startingAt:offs. |
|
466 |
offs := offs + sz. |
|
467 |
] ifFalse:[ |
|
468 |
sz < 0 ifTrue:[ |
|
469 |
sz := sz negated. |
|
470 |
data := frameBuffer at:offs. offs := offs + 1. |
|
471 |
imageBuffer from:idx to:(idx+sz-1) put:data. |
|
472 |
] |
|
473 |
]. |
|
474 |
idx := idx + sz. |
|
475 |
]. |
|
476 |
]. |
|
477 |
lineIdx := lineIdx + width |
|
478 |
]. |
|
620 | 479 |
imageSequence add:imageBuffer. |
510 | 480 |
|
620 | 481 |
"Modified: 24.6.1997 / 15:31:25 / cg" |
510 | 482 |
! |
483 |
||
484 |
processChunks:nchunks size:dataLen |
|
485 |
"process chunks in a frame" |
|
486 |
||
487 |
|len type offs chunkOffs| |
|
488 |
||
489 |
offs := 1+0. |
|
490 |
1 to:nchunks do:[:chunkIndex | |
|
491 |
len := frameBuffer doubleWordAt:(offs+0). |
|
492 |
type := frameBuffer wordAt:(offs+4). |
|
493 |
chunkOffs := offs + CHUNK_HEAD_SIZE. |
|
494 |
||
495 |
type == FLI_COLOR ifTrue:[ |
|
496 |
self color64ChunkAt:chunkOffs. |
|
497 |
] ifFalse:[ |
|
498 |
type == FLI_256_COLOR ifTrue:[ |
|
499 |
self color256ChunkAt:chunkOffs. |
|
500 |
] ifFalse:[ |
|
501 |
type == FLI_DELTA ifTrue:[ |
|
502 |
self deltaChunkAt:chunkOffs. |
|
503 |
] ifFalse:[ |
|
504 |
type == FLI_LC ifTrue:[ |
|
505 |
self lcChunkAt:chunkOffs. |
|
506 |
] ifFalse:[ |
|
507 |
type == FLI_BRUN ifTrue:[ |
|
508 |
self brunChunkAt:chunkOffs. |
|
509 |
] ifFalse:[ |
|
510 |
'FLI [info]: unknown chunk type: ' infoPrint. |
|
511 |
type hexPrintString infoPrintCR. |
|
512 |
^ false. |
|
513 |
] |
|
514 |
] |
|
515 |
] |
|
516 |
]. |
|
517 |
]. |
|
518 |
offs := offs + len |
|
519 |
]. |
|
520 |
||
521 |
" |
|
522 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
523 |
" |
|
524 |
||
525 |
"Created: 3.4.1997 / 22:28:11 / cg" |
|
526 |
"Modified: 3.4.1997 / 22:52:38 / cg" |
|
527 |
! ! |
|
528 |
||
1805 | 529 |
!FLIReader methodsFor:'reading'! |
510 | 530 |
|
531 |
fromStream:aStream |
|
512 | 532 |
"read a FLI-movie from aStream." |
510 | 533 |
|
534 |
inStream := aStream. |
|
535 |
||
536 |
(self getHeader) ifFalse:[^ nil]. |
|
537 |
||
557 | 538 |
Image badImageFormatQuerySignal handle:[:ex | |
539 |
ex errorString infoPrintCR. |
|
540 |
^ nil |
|
541 |
] do:[ |
|
542 |
1 to:nframes do:[:frameIndex | |
|
543 |
self getFrame |
|
544 |
] |
|
510 | 545 |
]. |
546 |
||
1759
f52382e5a9b8
slowly getting rid of the Colormap class
Claus Gittinger <cg@exept.de>
parents:
1745
diff
changeset
|
547 |
colorMap := MappedPalette |
510 | 548 |
redVector:redPalette |
549 |
greenVector:greenPalette |
|
550 |
blueVector:bluePalette. |
|
551 |
||
552 |
photometric := #palette. |
|
553 |
samplesPerPixel := 1. |
|
554 |
bitsPerSample := #(8). |
|
555 |
||
556 |
" |
|
557 |
FLIReader fromFile:'/usr/local/FLI/jeffmild.fli' |
|
621 | 558 |
Image fromFile:'/usr/local/FLI/jeffmild.fli' |
510 | 559 |
" |
560 |
||
621 | 561 |
"Modified: 24.6.1997 / 15:58:18 / cg" |
510 | 562 |
! ! |
563 |
||
564 |
!FLIReader class methodsFor:'documentation'! |
|
565 |
||
566 |
version |
|
1805 | 567 |
^ '$Header: /cvs/stx/stx/libview2/FLIReader.st,v 1.13 2003-09-01 14:47:45 cg Exp $' |
510 | 568 |
! ! |
1745
4fa0fad2a463
code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents:
647
diff
changeset
|
569 |
|
510 | 570 |
FLIReader initialize! |