§
    Wp«f|  ã                   ó°   — d Z ddlZddlmZmZ ddlmZ ddlmZ ej	        Z
ej         G d„ d¦  «        ¦   «         Zej         G d„ d	¦  «        ¦   «         Z	dS )
zRect data class.é    N)ÚAnyÚOptional)Úrect_pb2)Údoc_controlsc                   ó<   — e Zd ZU dZeed<   eed<   eed<   eed<   dS )ÚRecta,  A rectangle, used as part of detection results or as input region-of-interest.

  The coordinates are normalized wrt the image dimensions, i.e. generally in
  [0,1] but they may exceed these bounds if describing a region overlapping the
  image. The origin is on the top-left corner of the image.

  Attributes:
    left: The X coordinate of the left side of the rectangle.
    top: The Y coordinate of the top of the rectangle.
    right: The X coordinate of the right side of the rectangle.
    bottom: The Y coordinate of the bottom of the rectangle.
  ÚleftÚtopÚrightÚbottomN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚfloatÚ__annotations__© ó    úq/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/mediapipe/tasks/python/components/containers/rect.pyr   r      s@   € € € € € € ðð ð 	€+€++Ø€*€**Ø	€,€,,Ø
€-€--€-€-r   r   c                   óà   — e Zd ZU dZeed<   eed<   eed<   eed<   dZee         ed<   dZee	         ed	<   e
j        d
efd„¦   «         Zee
j        ded
d fd„¦   «         ¦   «         Zded
efd„ZdS )ÚNormalizedRecta  A rectangle with rotation in normalized coordinates.

  Location of the center of the rectangle in image coordinates. The (0.0, 0.0)
  point is at the (top, left) corner.

  The values of box center location and size are within [0, 1].

  Attributes:
    x_center: The normalized X coordinate of the rectangle, in image
      coordinates.
    y_center: The normalized Y coordinate of the rectangle, in image
      coordinates.
    width: The width of the rectangle.
    height: The height of the rectangle.
    rotation: Rotation angle is clockwise in radians.
    rect_id: Optional unique id to help associate different rectangles to each
      other.
  Úx_centerÚy_centerÚwidthÚheightg        ÚrotationNÚrect_idÚreturnc                 óh   — t          | j        | j        | j        | j        | j        | j        ¬¦  «        S )z+Generates a NormalizedRect protobuf object.©r   r   r   r   r   r   )Ú_NormalizedRectProtor   r   r   r   r   r   )Úselfs    r   Úto_pb2zNormalizedRect.to_pb2J   s9   € õ  Ø”Ø”ØŒjØŒ{Ø”Ø”ðñ ô ð r   Úpb2_objc                 óh   — t          |j        |j        |j        |j        |j        |j        ¬¦  «        S )zACreates a `NormalizedRect` object from the given protobuf object.r    )r   r   r   r   r   r   r   )Úclsr$   s     r   Úcreate_from_pb2zNormalizedRect.create_from_pb2U   s<   € õ ØÔ!ØÔ!ØŒmØŒ~ØÔ!Ø”ð!ñ !ô !ð !r   Úotherc                 ó¢   — t          |t          ¦  «        sdS |                      ¦   «                              |                     ¦   «         ¦  «        S )z£Checks if this object is equal to the given object.

    Args:
      other: The object to be compared with.

    Returns:
      True if the objects are equal.
    F)Ú
isinstancer   r#   Ú__eq__)r"   r(   s     r   r+   zNormalizedRect.__eq__a   s?   € õ e^Ñ,Ô,ð ØˆUà;Š;‰=Œ=×Ò §¢¡¤Ñ/Ô/Ð/r   )r   r   r   r   r   r   r   r   r   Úintr   Údo_not_generate_docsr!   r#   Úclassmethodr'   r   Úboolr+   r   r   r   r   r   .   sø   € € € € € € ðð ð& €/€//Ø€/€//Ø	€,€,,Ø
€-€--Ø!€(ˆHUŒOÐ!Ð!Ñ!Ø€'ˆ8CŒ=ÐÐÑàÔ$ðÐ*ð ð ð ñ %Ô$ðð ØÔ$ð!Ð$8ð !Ð=Mð !ð !ð !ñ %Ô$ñ „;ð!ð0˜#ð 0 $ð 0ð 0ð 0ð 0ð 0ð 0r   r   )r   ÚdataclassesÚtypingr   r   Úmediapipe.framework.formatsr   Ú1mediapipe.tasks.python.core.optional_dependenciesr   r   r!   Ú	dataclassr   r   r   r   ú<module>r5      sØ   ðð Ð à Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø JÐ JÐ JÐ JÐ JÐ JàÔ.Ð ð Ôðð ð ð ð ñ ô ñ Ôðð( Ôð>0ð >0ð >0ð >0ð >0ñ >0ô >0ñ Ôð>0ð >0ð >0r   