QParams2d Class

Parameters used for QParams2d.Quantization of 2d points such that the x and y components are each quantized to 16-bit unsigned integers.

@see - QPoint2d for the quantized representation of a Point2d.

Methods

Name Description
clone(out?: QParams2d): QParams2d Create a copy of these params.  
copyFrom(src: QParams2d): void Set QParams2d.origin and QParams2d.scale from src.  
isQuantizable(point: Point2d): boolean Return true if the point point is quantizable using these parameters.  
setFromRange(range: Range2d, rangeScale: number = Quantization.rangeScale16): void Initialize these parameters to support quantization of values within the specified range.  
unquantize(x: number, y: number, out?: Point2d): Point2d Return the unquantized point for the input x and y components.  
fromNormalizedRange(rangeScale: number = Quantization.rangeScale16): QParams2d Static Creates parameters supporting quantization of values within the range [-1.0, 1.0], appropriate for normalized 2d vectors.  
fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number): QParams2d Static Create parameters from origin and scale components  
fromRange(range: Range2d, out?: QParams2d, rangeScale: number = Quantization.rangeScale16): QParams2d Static Create parameters to support quantization of values within the specified range.  
fromZeroToOne(rangeScale: number = Quantization.rangeScale16): QParams2d Static Create parameters supporting quantization of values within the range [0.0, 1.0].  

Properties

Name Type Description
origin Readonly Point2d The origin of the quantization range.  
scale Readonly Point2d The scale applied to coordinates to quantize them.  

Defined in

Last Updated: 29 March, 2024