(swf file format spec v10)swf文件格式中英文说明书v10,文件结构摘要,笔记7

SWF Structure Summary
This chapter provides a summary of the elements that comprise a SWF file.

swf文件结构摘要
这个章节提供的是组成SWF文件的元素摘要。

The SWF header
All SWF files begin with the following header. The types are defined in Chapter 1, “Basic Data Types” on page 11,
SWF文件头
所有SWF文件都是下面的头开始。这些类型的定义在第一章,“基本数据类型”在第11章

“F” indicates uncompressed 表示未压缩
“C” indicates compressed (SWF 6 and later only) 表示压缩(SWF6或更高)
Signature UI8 Signature byte always “W” 标识字节是“W”
Signature UI8 Signature byte always “S” 标识字节是“S”
Version UI8 Single byte file version (for example, 0x06 for SWF 6) 代表文件版本(例如,0x06表示SWF6)
FileLength UI32 Length of entire file in bytes 文件长度
FrameSize RECT Frame size in twips 帧大小,单位是twip
FrameRate UI16 Frame delay in 8.8 fixed number of frames per second 帧每秒的固定格式是:8.8
FrameCount UI16 Total number of frames in file 文件中帧的总数

The header begins with a three-byte signature of either 0x46, 0x57, 0x53 (“FWS”); or 0x43,
0x57, 0x53 (“CWS”). An FWS signature indicates an uncompressed SWF file; CWS
indicates that the entire file after the first 8 bytes (that is, after the FileLength field) was
compressed by using the ZLIB open standard. The data format that the ZLIB library uses is described by Request for Comments (RFCs) documents 1950 to 1952. CWS file compression is permitted in SWF 6 or later only.
文件头是以三个标识字节开始,他们不是0x46,0x57,0x53(FWS);就是0x43,0x57,0x53(CWS)。FWS标识表示未压缩SWF文件;CWS表示整个文件的前8个字节后(即文件长度字段之后)的内容,都是开放标准ZLIB压缩过的。ZLIB库数据格式,是在1950到1952年通过RFCs文档所描述,CWS文件压缩仅SWF6或更高才允许。

A one-byte version number follows the signature. The version number is not an ASCII character, but an 8-bit number. For example, for SWF 4, the version byte is 0x04, not the ASCII character “4” (0x34).
在标识符后的第一个字节是版本号,版本号不是一个ascii字符,而是一个8bit数字,例如,swf4里,版本字节0x04,而不是ascii字符“4”。

The FileLength field is the total length of the SWF file, including the header. If this is an uncompressed SWF file (FWS signature), the FileLength field should exactly match the file size. If this is a compressed SWF file (CWS signature), the FileLength field indicates the total length of the file after decompression, and thus generally does not match the file size. Having the uncompressed size available can make the decompression process more efficient.
文件长度字段是SWF文件的总长度。包括文件头在内。如果是一个未压缩的SWF文件(FWS标识),文件长度字段表示文件的精确大小。如果是压缩的SWF文件(CWS标识),文件长度字段表示解压后的文件长度,因此一般文件大小不匹配。让未压缩(解压后)大小可见使解压过程更有效。

The FrameSize field defines the width and height of the on-screen display. This field is stored as a RECT structure, meaning that its size may vary according to the number of bits needed to encode the coordinates. The FrameSize RECT always has Xmin and Ymin value of 0; the Xmax and Ymax members define the width and height (see “Using bit values” on page 16).
The FrameRate is the desired playback rate in frames per second. This rate is not guaranteed if, for example, Flash Player is running on a slow or busy CPU.
The FrameCount is the total number of frames in this SWF file.
帧大小字段定义屏幕的宽和高。这个字段存储的是一个RECT结构,指他的大小可以根据需要的位数编码坐标。帧大小RECT总是Xmin和Ymin值为0;Xmax和Ymax成员定义宽和高(“位值的使用”,见第16页)。
帧速率代表每秒播放的帧数,这个速率不保证,比如Flash Player运行在一个非常忙的机器上。
帧数是指SWF文件中帧的总数。

你可能感兴趣的:(数据结构,F#,Flash)