(swf file format spec v10)swf文件格式中英文说明书v10,基本数据类型部分,笔记2 ...

What’s new in SWF 10
Flash Player 10 introduces the following features and capabilities:
■ Expands the SWF format’s text capability with the capability to render bidirectional text
(right-to-left) and complex scripts for languages such as Arabic, Hebrew, and Thai. To
facilitate this rendering, SWF 10 introduces the DefineFont4 tag.
■ Adds another tag for defining a JPEG called DefineBitsJPEG4. This allows embedding
JPEG images that have an alpha channel for opacity and also a smoothing filter.
■ Expands the Player’s speech coding functionality by adding support for the free and open
source Speex voice codec as well as adding support for higher frequencies in the existing
Nellymoser codec. For more information, see “Speex compression” on page 220.

SWF10中新特性是什么
Flash Player 10中引入了以下特点和功能:
■扩展了SWF格式的双向文字的文本能力(从右到左)和支持如阿拉伯语,希伯来语和泰语的复杂脚本。为了使这个功能变得容易,引入了DefineFont4标签。
■增加了用于定义JPEG的另一个标签,叫作DefineBitsJPEG4。它允许嵌入JPEG图像支持不透明的alpha通道和一些强大的滤镜。
■扩展了玩家的语音编码功能,可加入自由和开源的语音编解码器以及增加了对更高频率的Nellymoser编解码器的支持。有关详细信息,请参阅“Speex压缩”。


Basic Data Types
This section describes the basic data types that make up the more complex data structures in the SWF file format. All other structures in the SWF file format are built on these fundamental types.

基本数据类型
这章节描述基本数据类型—在SWF文件里可以创建更多复杂数据结构。所有在SWF文件里的其它结构都是由这些基本类型创建的。

Coordinates and twips
The SWF file format stores all x-y coordinates as integers, usually in a unit of measurement called a twip. In the SWF format, a twip is 1/20th of a logical pixel. A logical pixel is the same as a screen pixel when the file is played at 100%—that is, without scaling.

坐标和缇(Twips)
swf文件格式用整数来存储X-Y坐标,通常它的单位默认的是twip,1twip等于1/20的逻辑像素。在没有缩放的情况下,就是100%播放时,swf中的一个逻辑像素和屏幕上的一个像素是对应的。

For example, a rectangle 800 twips wide by 400 twips high is rendered as 40 by 20 logical pixels. Fractional pixel sizes are approximated with anti-aliasing. A rectangle 790 by 390 twips(39.5 by 19.5 pixels) appears to have slightly blurred edges.
Twips are a good compromise between size and precision. They provide sub-pixel accuracy for zooming and precise placement of objects, while consuming very few bits per coordinate.
Coordinates in the SWF file format use the traditional graphics axes: x is horizontal and proceeds from minimum values at the left to maximum values at the right, and y is vertical and proceeds from minimum values at the top to maximum values at the bottom.

例如,一个宽x高是800x400的矩形,就会被翻译成40×20像素,极小像素尺寸也是抗锯齿的。一个790×390twips(39.5x19.5像素)的矩形会出现轻微的边缘模糊。
Twips在大小与精度之间,是一个好的折衷方案。当处理极少数位坐标时,它们提供了缩放的子像素的精确度和对象放置的精度。在swf文件格式里的坐标,它使用的是传统的图像坐标,x轴是水平方向,且是从左到右值是增大的,y轴是垂直方向,并且从下到上是增大的。

Integer types and byte order
The SWF file format uses 8-bit, 16-bit, 32-bit, 64-bit, signed, and unsigned integer types. All integer values are stored in the SWF file by using little-endian byte order: the least significant byte is stored first, and the most significant byte is stored last, in the same way as the Intel x86 architecture. The bit order within bytes in the SWF file format is big-endian: the most significant bit is stored first, and the least significant bit is stored last.

整数类型和字节顺序
swf文件格式中用8-bit、16-bit、32-bit、64-bit有符号和无符号的整数。所有整数在swf文件中都以little-endian的顺序来存储的:低字节在前,高字节在后,同样方法应用于Intel X86体系结构。而每个字节的每一位则是按big-endian的顺序来排列的:即高位在先,低位在后。

For example:
■ The 32-bit value 0x456e7120 is stored as 20 71 6e 45.
■ The 16-bit value 0xe712 is stored as 12 e7.
All integer types must be byte-aligned. That is, the first bit of an integer value must be stored in the first bit of a byte in the SWF file.
Signed integers are represented by using traditional 2’s-complement bit patterns. These are the signed integer representations used on most modern computer platforms. In the 2’s complement system, negative numbers have 1 as the first bit, and zero and positive numbers have 0 as the first bit. A negative number, -n, is represented as the bitwise opposite of the positive-zero number n-1.

例如:
■一个32-bit的值 0x456e7120 是存成 20 71 6e 45 格式。
■一个16位的值0xe712 是存成 12 e7 格式。
所有整数类型必须是字节对齐的。即一个整数值的第一位必须存储在swf文件一个字节的第一位。符号整数通过使用2补数形式来代表的。这种符号整数表示法用于大多数现代电脑平台。在2's complement系统里,负数第一位设为1,并且0和正数第一位设为0.一个负数,-n,表示成这个数的正数n-1的反数。

Integer Types
Type Comment
SI8 Signed 8-bit integer value 带符号8位整数
SI16 Signed 16-bit integer value 带符号16位整数
SI32 Signed 32-bit integer value 带符号32位整数
SI8[n] Signed 8-bit array—n is the number of array elements 带符号8位数组,n是数组元素个数
SI16[n] Signed 16-bit array—n is the is number of array elements 带符号16位数组,n是数组元素个数
UI8 Unsigned 8-bit integer value 不带符号8位整数
UI16 Unsigned 16-bit integer value 不带符号16位整数
UI32 Unsigned 32-bit integer value 不带符号32位整数
UI8[n] Unsigned 8-bit array—n is the number of array elements 不带符号8位数组,n是数组元素个数
UI16[n] Unsigned 16-bit array—n is the number of array elements 不带符号16位数组,n是数组元素个数
UI24[n] Unsigned 24-bit array—n is the number of array elements 不带符号24位数组,n是数组元素个数
UI32[n] Unsigned 32-bit array—n is the number of array elements 不带符号32位数组,n是数组元素个数
UI64[n] Unsigned 64-bit array—n is the number of array elements 不带符号64位数组,n是数组元素个数
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值