scistag.imagestag.pos2d.Pos2D

class Pos2D(value=None, y=None, x=None)[source]

Bases: object

Defines the position of a 2D element in pixels

Parameters
  • value (Pos2DTypes | float | None) – The new value, either a Pos2D object to copy, x or a tuple containing x and y

  • y (float | None) – The y coordinate component

  • x (float | None) – The x coordinate component

Example:

Pos2D(15, 14) == Pos2D((15, 14)) == Pos2D(x=15, y=14) == Pos2D(Pos2D(x=15, y=14))

Methods

to_int_tuple

Returns the position as int tuple

to_tuple

Returns the position as tuple

Attributes

__annotations__

__dataclass_fields__

__dataclass_params__

__dict__

__doc__

__hash__

__module__

__weakref__

list of weak references to the object (if defined)

x

The x component

y

The y component

to_int_tuple()[source]

Returns the position as int tuple

Returns

X, Y

to_tuple()[source]

Returns the position as tuple

Returns

X, Y

x: float

The x component

y: float

The y component