Point for absolute pixel coordinates and NormalizedPoint for relative positions.
Point
Represents absolute pixel coordinates on the screen:Properties
| Property | Type | Description |
|---|---|---|
x | int | X coordinate in pixels |
y | int | Y coordinate in pixels |
Usage
Points work seamlessly with all TapKit actions:Tuple Unpacking
Points support tuple unpacking:Distance Calculation
Calculate distance between points:NormalizedPoint
Represents coordinates as 0.0-1.0 values relative to screen dimensions. Useful when working with vision models.Convert to Absolute
Convert normalized coordinates to absolute pixels:From Different Scales
Vision models often use different coordinate scales:Properties
| Property | Type | Description |
|---|---|---|
x | float | X coordinate (0.0-1.0) |
y | float | Y coordinate (0.0-1.0) |
Methods
| Method | Returns | Description |
|---|---|---|
to_absolute(width, height) | Point | Convert to absolute pixels |
from_1000_scale(x, y) | NormalizedPoint | Create from 0-1000 coordinates |
from_100_scale(x, y) | NormalizedPoint | Create from 0-100 percentages |
from_absolute(point, w, h) | NormalizedPoint | Create from absolute point |