QPoint2d Class

Represents a Point2d compressed such that each component x and y is quantized to the 16-bit integer range [0, 0xffff]. These are primarily used to reduce the space required for coordinates used by RenderGraphics.

see QParams2d to define quantization parameters for a range of points.

see QPoint2dList for a list of points all quantized to the same range.

extensions

Methods

Name Description
constructor(): QPoint2d Construct with x and y initialized to zero.  
clone(out?: QPoint2d): QPoint2d Create a copy of this point.  
copyFrom(src: QPoint2d): void Initialize x and y from src.  
init(pos: Readonly<WritableXAndY>, params: QParams2d): void Initialize this point by quantizing the supplied { x, y } using the specified params  
setFromScalars(x: number, y: number): void Set the x and y components directly.  
unquantize(params: QParams2d, out?: Point2d): Point2d Return a Point2d unquantized according to the supplied params.  
create(pos: Point2d, params: QParams2d): QPoint2d Static Create a quantized point from the supplied Point2d using the specified params  
fromScalars(x: number, y: number): QPoint2d Static Create a QPoint2d directly from x and y components.  

Properties

Name Type Description
x Accessor number The quantized x component.  
y Accessor number The quantized y component.  

Defined in

Last Updated: 20 June, 2023