Members
64位浮点,对应于
gl.DOUBLE
(在桌面OpenGL中;
这在WebGL中不受支持,通过GeometryPipeline.encodeAttribute
在铯中模拟)
以及Float64Array
中元素的类型。-
Default Value:
0x140A
与
INT
和类型相对应的32位有符号int
Int32Array
中的一个元素。UNSIGNED_INT
和类型对应的32位无符号int
在Uint32Array
中的一个元素中。对应于
gl.BYTE
和类型的8位有符号字节
Int8Array
中的一个元素。与
FLOAT
和类型对应的32位浮点
Float32Array
中的一个元素。与
SHORT
和类型对应的16位有符号短
Int16Array
中的一个元素。对应于
UNSIGNED_BYTE
和类型的8位无符号字节
Uint8Array
中的一个元素。对应于
UNSIGNED_SHORT
和类型的16位无符号短
Uint16Array
中的一个元素。Methods
staticCesium.ComponentDatatype.createArrayBufferView(componentDatatype, buffer, byteOffset, length) → Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array
创建字节数组的类型化视图。
Name | Type | Description |
---|---|---|
componentDatatype |
ComponentDatatype | 要创建的视图的类型。 |
buffer |
ArrayBuffer | 要用于视图的缓冲存储器。 |
byteOffset |
Number | optional 视图中第一个元素的偏移量(以字节为单位)。 |
length |
Number | optional 视图中的元素数。 |
Returns:
缓冲区的类型化数组视图。
Throws:
-
DeveloperError :componentDatatype不是有效值。
staticCesium.ComponentDatatype.createTypedArray(componentDatatype, valuesOrLength) → Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array
创建与组件数据类型相对应的类型化数组。
Name | Type | Description |
---|---|---|
componentDatatype |
ComponentDatatype | 组件数据类型。 |
valuesOrLength |
Number | Array | 要创建的数组或数组的长度。 |
Returns:
类型化数组。
Throws:
-
DeveloperError :componentDatatype不是有效值。
Example:
// creates a Float32Array with length of 100
var typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);
staticCesium.ComponentDatatype.fromName(name) → ComponentDatatype
从其名称获取ComponentDatatype。
Name | Type | Description |
---|---|---|
name |
String | 组件数据类型的名称。 |
Returns:
ComponentDatatype。
Throws:
-
DeveloperError :name不是有效值。
staticCesium.ComponentDatatype.fromTypedArray(array) → ComponentDatatype
获取所提供TypedArray实例的
ComponentDatatype
。Name | Type | Description |
---|---|---|
array |
TypedArray | 类型化数组。 |
Returns:
提供的数组的ComponentDatatype,如果数组不是TypedArray,则为未定义的。
返回相应数据类型的大小(以字节为单位)。
Name | Type | Description |
---|---|---|
componentDatatype |
ComponentDatatype | 要获取大小的组件数据类型。 |
Returns:
以字节为单位的大小。
Throws:
-
DeveloperError :componentDatatype不是有效值。
Example:
// Returns Int8Array.BYTES_PER_ELEMENT
var size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);
验证提供的组件数据类型是否为有效的
ComponentDatatype
Name | Type | Description |
---|---|---|
componentDatatype |
ComponentDatatype | 要验证的组件数据类型。 |
Returns:
如果提供的组件数据类型是有效值,则为
true
;否则为false
。Example:
if (!Cesium.ComponentDatatype.validate(componentDatatype)) {
throw new Cesium.DeveloperError('componentDatatype must be a valid value.');
}