Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5521 | leency | 1 | |
2 | |||
3 | |||
4 | idea behind it is simple: don't bother storing the parts of a |
||
5 | frame that are the same as the last frame. Not only does this |
||
6 | save space, but it's very quick. It's faster to leave a pixel |
||
7 | alone than to set it. |
||
8 | |||
9 | |||
10 | frames. The first frame is compressed using a bytewise run-length |
||
11 | compression scheme. Subsequent frames are stored as the |
||
12 | difference from the previous frame. (Occasionally the first |
||
13 | frame and/or subsequent frames are uncompressed.) There is one |
||
14 | extra frame at the end of a FLI which contains the difference |
||
15 | between the last frame and the first frame. |
||
16 | |||
17 | |||
18 | |||
19 | |||
20 | offset |
||
21 | |||
22 | |||
23 | |||
24 | 4 2 magic Set to hex AF11. Please use another |
||
25 | value here if you change format (even to |
||
26 | a different resolution) so Autodesk |
||
27 | Animator won't crash trying to read it. |
||
28 | 6 2 frames Number of frames in FLI. FLI files have |
||
29 | a maxium length of 4000 frames. |
||
30 | 8 2 width Screen width (320). |
||
31 | 10 2 height Screen height (200). |
||
32 | 12 2 depth Depth of a pixel (8). |
||
33 | 14 4 flags Must be 0. |
||
34 | 18 2 speed Number of video ticks between frames. |
||
35 | 20 4 next Set to 0. |
||
36 | 24 4 frit Set to 0. |
||
37 | 28 100 expand All zeroes -- for future enhancement. |
||
38 | |||
39 | |||
40 | |||
41 | |||
42 | offset |
||
43 | 0 4 size Bytes in this frame. Autodesk Animator |
||
44 | |||
45 | 4 2 magic Always hexadecimal F1FA |
||
46 | 6 2 chunks Number of 'chunks' in frame. |
||
47 | 8 8 expand Space for future enhancements. All |
||
48 | zeros. |
||
49 | |||
50 | |||
51 | frame. First comes a color chunk if the color map has changed |
||
52 | from the last frame. Then comes a pixel chunk if the pixels have |
||
53 | changed. If the frame is absolutely identical to the last frame |
||
54 | there will be no chunks at all. |
||
55 | |||
56 | |||
57 | chunk header is: |
||
58 | |||
59 | |||
60 | offset |
||
61 | 0 4 size Bytes in this chunk. |
||
62 | |||
63 | |||
64 | |||
65 | file. |
||
66 | |||
67 | |||
68 | 11 FLI_COLOR Compressed color map |
||
69 | 12 FLI_LC Line compressed -- the most common type |
||
70 | of compression for any but the first |
||
71 | frame. Describes the pixel difference |
||
72 | from the previous frame. |
||
73 | 13 FLI_BLACK Set whole screen to color 0 (only occurs |
||
74 | on the first frame). |
||
75 | 15 FLI_BRUN Bytewise run-length compression -- first |
||
76 | frame only |
||
77 | 16 FLI_COPY Indicates uncompressed 64000 bytes soon |
||
78 | to follow. For those times when |
||
79 | compression just doesn't work! |
||
80 | |||
81 | |||
82 | compressed data ends up being an odd length a single pad byte is |
||
83 | inserted so that the FLI_COPY's always start at an even address |
||
84 | for faster DMA. |
||
85 | |||
86 | |||
87 | The first word is the number of packets in this chunk. This |
||
88 | is followed directly by the packets. The first byte of a packet |
||
89 | says how many colors to skip. The next byte says how many colors |
||
90 | to change. If this byte is zero it is interpreted to mean 256. |
||
91 | Next follows 3 bytes for each color to change (one each for red, |
||
92 | green and blue). |
||
93 | |||
94 | |||
95 | This is the most common, and alas, most complex chunk. The |
||
96 | first word (16 bits) is the number of lines starting from the top |
||
97 | of the screen that are the same as the previous frame. (For |
||
98 | example, if there is motion only on the bottom line of screen |
||
99 | you'd have a 199 here.) The next word is the number of lines |
||
100 | that do change. Next there is the data for the changing lines |
||
101 | themselves. Each line is compressed individually; among other |
||
102 | things this makes it much easier to play back the FLI at a |
||
103 | reduced size. |
||
104 | |||
105 | |||
106 | in this line. If the line is unchanged from the last frame this |
||
107 | is zero. The format of an individual packet is: |
||
108 | |||
109 | |||
110 | size_count |
||
111 | data |
||
112 | |||
113 | |||
114 | are to be skipped it must be broken into 2 packets. The size |
||
115 | count is also a byte. If it is positive, that many bytes of data |
||
116 | follow and are to be copied to the screen. If it's negative a |
||
117 | single byte follows, and is repeated -size_count times. |
||
118 | |||
119 | |||
120 | comes out to be 60000 bytes or more Autodesk Animator decides |
||
121 | compression isn't worthwhile and saves the frame as FLI_COPY. |
||
122 | |||
123 | |||
124 | These are very simple. There is no data associated with |
||
125 | them at all. In fact they are only generated for the first frame |
||
126 | in Autodesk Animator after the user selects NEW under the FLIC |
||
127 | menu. |
||
128 | |||
129 | |||
130 | These are much like FLI_LC chunks without the skips. They |
||
131 | start immediately with the data for the first line, and go line- |
||
132 | by-line from there. The first byte contains the number of |
||
133 | packets in that line. The format for a packet is: |
||
134 | |||
135 | |||
136 | data |
||
137 | |||
138 | |||
139 | which is repeated size_count times. If size_count is negative |
||
140 | there are -size_count bytes of data which are copied to the |
||
141 | screen. In Autodesk Animator if the "compressed" data shows signs |
||
142 | of exceeding 60000 bytes the frame is stored as FLI_COPY instead. |
||
143 | |||
144 | |||
145 | These are 64000 bytes of data for direct reading onto the |
||
146 | screen. |
||
147 | |||
148 | |||
149 | And here's the PRO extensions: |
||
150 | ----------------------------------------------------------------------- |
||
151 | |||
152 | |||
153 | |||
154 | |||
155 | that are not described in the Turbo C FLI library documentation. |
||
156 | |||
157 | |||
158 | ---------- ----------- |
||
159 | FLI_DELTA 7 (decimal) |
||
160 | |||
161 | |||
162 | is the data for the changing lines themselves, always starting with the |
||
163 | first line. Each line is compressed individually. |
||
164 | |||
165 | |||
166 | the line. If the number of packets is a negative skip -packets lines. |
||
167 | If the number of packets is positive, decode the packets. The format of |
||
168 | an individual packet is: |
||
169 | |||
170 | |||
171 | size_count |
||
172 | data |
||
173 | |||
174 | |||
175 | skipped, it must be broken into 2 packets. The size_count is also a byte. |
||
176 | If it is positive, that many WORDS of data follow and are to be copied to |
||
177 | the screen. If it is negative, a single WORDS value follows, and is to be |
||
178 | repeated -size_count times. |
||
179 | |||
180 | |||
181 | ---------- ----------- |
||
182 | FLI_256_COLOR 4 (decimal) |
||
183 | |||
184 | |||
185 | directly by the packets. The first byte of a packet is how many colors |
||
186 | to skip. The next byte is how many colors to change. If this number is |
||
187 | 0, (zero), it means 256. Next follow 3 bytes for each color to change. |
||
188 | (One each for red, green and blue). |
||
189 | |||
190 | |||
191 | FLI_COLOR chunk (type 11 decimal) is that the values in the type 4 chunk |
||
192 | range from 0 to 255, and the values in a type 11 chunk range from 0 to 63. |
||
193 | |||
194 | |||
195 | WORDS refer to two-bytes (16 bits) of consecutive data. (Big Endian) |
||
196 | |||
197 | |||
198 | |||
199 | |||
200 | |||
201 | |||
202 | ---------- ----------- |
||
203 | FLI_MINI 18 (decimal) 12 (Hex) |
||
204 | |||
205 | |||
206 | frame in FLI_BRUN format, used as an button for selecting flc's from |
||
207 | within Animator Pro. Simply do nothing with this chunk. |
||
208 | |||
209 | |||
210 | |||
211 | |||
212 | is the first frame in the .flc file. Actually it isn't a frame at all |
||
213 | but to have several chunks within it that specify file location info |
||
214 | specific to Animator Pro. IE: filepath, font to use, and .COL file info. |
||
215 | This FRAME may be skipped while loading. That's right! Ignore it! The |
||
216 | frame header is the same length as all other frames. So you may read the |
||
217 | frame header, then skip past the rest of the frame. |
||
218 | |||
219 | |||
220 | |||
221 | FLI signature bytes are AF12 instead of AF11 used in the older FLI files. |
||
222 | Also, you cannot ignore the screen width and height they may not be |
||
223 | 320 x 200. |
||
224 | |||
225 | |||
226 | |||
227 | |||
228 | |||
229 | |||
230 | |||
231 | second instead of 70th's. |
||
232 | |||
233 | |||
234 | please let me know. |
||
235 | |||
236 | |||
237 | (corrected by P. Oliver 30 May 1997 using information supplied by Reeves Hall) |
||
238 | |||
239 | |||
240 | Delphi : MikeHaaland |
||
241 | Internet : mike@htsmm1.las-vegas.nv.us |
||
242 | Usenet : ...!htsmm1.las-vegas.nv.us!mike |
||
243 |