Skip to main content

Function: encodeUint8Base64()

encodeUint8Base64(data, min, max): string

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