BaseUi

class BaseUi[source]

Bases: ABC

Define the common interface for UI coordinate systems.

abstractmethod point_to_global(coordinates: Point | RelativelyPoint) Point[source]

Convert coordinates to the global screen space.

Parameters:

coordinates (Point | RelativelyPoint) – Local or relative coordinates to convert.

Returns:

Converted global point.

Return type:

Point

abstractmethod point_to_local(coordinates: Point) Point[source]

Convert coordinates to the local UI space.

Parameters:

coordinates (Point) – Global point to convert.

Returns:

Converted local point.

Return type:

Point

abstractmethod get_screenshot() ndarray[source]

Capture the current UI screenshot.

Returns:

Screenshot data.

Return type:

numpy.ndarray

abstract property window: Window

Return the window associated with the UI context.

Returns:

Underlying application window.

Return type:

Window