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