AttributeCompression

external object AttributeCompression(source)

Attribute compression and decompression functions.

See also

Functions

Link copied to clipboard
external fun compressTextureCoordinates(textureCoordinates: Cartesian2): Double

Pack texture coordinates into a single float. The texture coordinates will only preserve 12 bits of precision.

Link copied to clipboard
external fun decodeRGB565(typedArray: Uint16Array<*>, result: Float32Array<*>? = definedExternally)

Decode RGB565-encoded colors into a floating point typed array containing normalized RGB values.

Link copied to clipboard
external fun decodeRGB8(encoded: Double, result: Color): Color

Decodes RGB values at 8-bit precision from a signle float, equivalent to 0xFFFFFF representation in JavaScript. Perceptually near-lossless in the "srgb" color space; "srgb-linear" and wide-gamut color spaces benefit from 10+ bit precision.

Link copied to clipboard
external fun decompressTextureCoordinates(compressed: Double, result: Cartesian2): Cartesian2

Decompresses texture coordinates that were packed into a single float.

Link copied to clipboard
external fun dequantize(typedArray: TypedArray<*, *, *, *>, componentDatatype: ComponentDatatype, type: AttributeType, count: Double): Float32Array<*>

Dequantizes a quantized typed array into a floating point typed array.

Link copied to clipboard
external fun encodeRGB8(color: Color): Double

Encodes RGB values at 8-bit precision into a single float, equivalent to 0xFFFFFF representation in JavaScript. Perceptually near-lossless in the "srgb" color space; "srgb-linear" and wide-gamut color spaces benefit from 10+ bit precision.

Link copied to clipboard
external fun octDecode(x: Double, y: Double, result: Cartesian3): Cartesian3

Decodes a unit-length vector in 2 byte 'oct' encoding to a normalized 3-component vector.

Link copied to clipboard
external fun octDecodeFloat(value: Double, result: Cartesian3): Cartesian3

Decodes a unit-length vector in 'oct' encoding packed in a floating-point number to a normalized 3-component vector.

Link copied to clipboard
external fun octDecodeFromCartesian4(encoded: Cartesian4, result: Cartesian3): Cartesian3

Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector.

Link copied to clipboard
external fun octDecodeInRange(x: Double, y: Double, rangeMax: Double, result: Cartesian3): Cartesian3

Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector.

Link copied to clipboard
external fun octEncode(vector: Cartesian3, result: Cartesian2): Cartesian2

Encodes a normalized vector into 2 SNORM values in the range of 0-255 following the 'oct' encoding.

Link copied to clipboard
external fun octEncodeFloat(vector: Cartesian3): Double

Encodes a normalized vector into 2 SNORM values in the range of 0-255 following the 'oct' encoding and stores those values in a single float-point number.

Link copied to clipboard
external fun octEncodeInRange(vector: Cartesian3, result: Cartesian2, rangeMax: Double): Cartesian2

Encodes a normalized vector into 2 SNORM values in the range of 0-rangeMax following the 'oct' encoding.

Link copied to clipboard
external fun octEncodeToCartesian4(vector: Cartesian3, result: Cartesian4): Cartesian4
Link copied to clipboard
external fun octPack(v1: Cartesian3, v2: Cartesian3, v3: Cartesian3, result: Cartesian2): Cartesian2

Encodes three normalized vectors into 6 SNORM values in the range of 0-255 following the 'oct' encoding and packs those into two floating-point numbers.

Link copied to clipboard
external fun octPackFloat(encoded: Cartesian2): Double

Packs an oct encoded vector into a single floating-point number.

Link copied to clipboard
external fun octUnpack(packed: Cartesian2, v1: Cartesian3, v2: Cartesian3, v3: Cartesian3)

Decodes three unit-length vectors in 'oct' encoding packed into a floating-point number to a normalized 3-component vector.

Link copied to clipboard
external fun zigZagDeltaDecode(uBuffer: Uint16Array<*>, vBuffer: Uint16Array<*>, heightBuffer: Uint16Array<*>? = definedExternally)

Decodes delta and ZigZag encoded vertices. This modifies the buffers in place.