pub fn convert_normalized_to_screen(
norm_x: f64,
norm_y: f64,
window_x: f64,
window_y: f64,
screenshot_w: f64,
screenshot_h: f64,
dpi_scale: f64,
resize_scale: f64,
) -> (f64, f64)Expand description
Convert normalized coordinates (0-999) to absolute screen coordinates.
The Gemini model outputs coordinates in a normalized 0-999 range. This function converts them to actual screen pixel coordinates, accounting for window position, DPI scaling, and any resize scaling.
§Arguments
norm_x- Normalized X coordinate (0-999)norm_y- Normalized Y coordinate (0-999)window_x- Window X position on screenwindow_y- Window Y position on screenscreenshot_w- Screenshot width in pixelsscreenshot_h- Screenshot height in pixelsdpi_scale- DPI scale factorresize_scale- Resize scale factor (if image was resized for model)
§Returns
Tuple of (screen_x, screen_y) absolute coordinates