Skip to main content

Variable: LATENT_CODECS

const LATENT_CODECS: object

Latent-grid codecs keyed by the manifest level dtype.

Type Declaration​

uint2​

uint2: object

uint2.decode​

decode: (str, min, max, length) => Float32Array<ArrayBufferLike> = decodeUint2Base64

Parameters​
str​

string

min​

number

max​

number

length​

number

Returns​

Float32Array<ArrayBufferLike>

uint2.encode​

encode: (data, min, max) => string = encodeUint2Base64

Parameters​
data​

Float32Array

min​

number

max​

number

Returns​

string

uint4​

uint4: object

uint4.decode​

decode: (str, min, max, length) => Float32Array<ArrayBufferLike> = decodeUint4Base64

Parameters​
str​

string

min​

number

max​

number

length​

number

Returns​

Float32Array<ArrayBufferLike>

uint4.encode​

encode: (data, min, max) => string = encodeUint4Base64

Parameters​
data​

Float32Array

min​

number

max​

number

Returns​

string

uint8​

uint8: object

uint8.decode​

decode: (str, min, max, length) => Float32Array = decodeUint8Base64

Decodes a base64 Uint8 blob (as produced by encodeUint8Base64) back into a Float32Array of length values, using the same min/max range.

Parameters​
str​

string

min​

number

max​

number

length​

number

Returns​

Float32Array

uint8.encode​

encode: (data, min, max) => string = encodeUint8Base64

Quantizes a Float32Array to a base64 string of Uint8 bytes: per-element clamp((x - min) / (max - min), 0, 1), rounded to the nearest of 256 discrete levels - used for latent-grid blobs. min === max (a constant grid) is handled by treating every value as level 0, rather than dividing by zero.

Parameters​
data​

Float32Array

min​

number

max​

number

Returns​

string