QParams2d Class
Parameters used for 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.
- QPoint2dList for a list of QPoint2ds quantized using a QParams2d.
Methods
| Name | Description | |
|---|---|---|
| clone(out?: QParams2d): QParams2d | Create a copy of these params. | |
| copyFrom(src: QParams2d): void | Set origin and scale from src. | |
| isQuantizable(point: Point2d): boolean | Return true if the point point is quantizable using these parameters. | |
| setFromRange(range: Range2d, rangeScale: numberQuantization.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 xandycomponents. | |
| fromNormalizedRange(rangeScale: numberQuantization.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: numberQuantization.rangeScale16): QParams2d Static | Create parameters to support quantization of values within the specified range. | |
| fromZeroToOne(rangeScale: numberQuantization.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
- core/common/src/QPoint.ts Line 76
Last Updated: 24 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.