Quantization Namespace

Provides facilities for quantizing floating point values within a specified range into 16-bit unsigned integers. This is a lossy compression technique. Given a floating point range [min, max], a floating point value x within that range is quantized by subtracting min, scaling the result according to max, and truncating the result to an integer. Therefore min quantizes to 0, max to 0xffff, (min+max)/2 to 0x7fff, and so on. These routines are chiefly used by classes like QPoint2d and QPoint3d to reduce the space required to store coordinate values for RenderGraphics.

Variable

Name Description
Quantization.rangeScale16  
Quantization.rangeScale8  

Function

Name Description
Quantization.computeScale Compute the scale factor required to quantize extent to rangeScale discrete values.
Quantization.quantize Return pos quantized to the range [origin, origin + rangeScale].
Quantization.unquantize Give qpos quantized to the range [origin, origin + rangeScale], return the unquantized value.

Defined in

Last Updated: 12 June, 2024