ComponentDatatype

ComponentDatatype()

WebGL组件数据类型。组件是内在的, 哪些形状属性,哪些形成顶点。

Members

staticconstantCesium.ComponentDatatype.DOUBLE : Number

64位浮点,对应于gl.DOUBLE(在桌面OpenGL中; 这在WebGL中不受支持,通过GeometryPipeline.encodeAttribute在铯中模拟) 以及Float64Array中元素的类型。
Default Value: 0x140A

staticconstantCesium.ComponentDatatype.INT : Number

INT和类型相对应的32位有符号int Int32Array中的一个元素。

staticconstantCesium.ComponentDatatype.UNSIGNED_INT : Number

UNSIGNED_INT和类型对应的32位无符号int 在Uint32Array中的一个元素中。

staticconstantCesium.ComponentDatatype.BYTE : Number

对应于gl.BYTE和类型的8位有符号字节 Int8Array中的一个元素。

staticconstantCesium.ComponentDatatype.FLOAT : Number

FLOAT和类型对应的32位浮点 Float32Array中的一个元素。

staticconstantCesium.ComponentDatatype.SHORT : Number

SHORT和类型对应的16位有符号短 Int16Array中的一个元素。

staticconstantCesium.ComponentDatatype.UNSIGNED_BYTE : Number

对应于UNSIGNED_BYTE和类型的8位无符号字节 Uint8Array中的一个元素。

staticconstantCesium.ComponentDatatype.UNSIGNED_SHORT : Number

对应于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:

staticCesium.ComponentDatatype.createTypedArray(componentDatatype, valuesOrLength)Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array

创建与组件数据类型相对应的类型化数组。
Name Type Description
componentDatatype ComponentDatatype 组件数据类型。
valuesOrLength Number | Array 要创建的数组或数组的长度。
Returns:
类型化数组。
Throws:
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:

staticCesium.ComponentDatatype.fromTypedArray(array)ComponentDatatype

获取所提供TypedArray实例的ComponentDatatype
Name Type Description
array TypedArray 类型化数组。
Returns:
提供的数组的ComponentDatatype,如果数组不是TypedArray,则为未定义的。

staticCesium.ComponentDatatype.getSizeInBytes(componentDatatype)Number

返回相应数据类型的大小(以字节为单位)。
Name Type Description
componentDatatype ComponentDatatype 要获取大小的组件数据类型。
Returns:
以字节为单位的大小。
Throws:
Example:
// Returns Int8Array.BYTES_PER_ELEMENT
var size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);

staticCesium.ComponentDatatype.validate(componentDatatype)Boolean

验证提供的组件数据类型是否为有效的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.');
}