Ë
    îì�i?  ã                   óD   — d dgZ ddlZddlmZ  edd«      d„ «       Zd	„ Zy)
Úpolygon_clipÚpolygon_areaé    Né   )ÚrequireÚ
matplotlibz>=3.3c                 ó  — ddl m}m} |j                  t	        j
                  | |f«      j                  d¬«      }|j                  ||g||gg«      }	|j                  |	«      j                  «       d   }
|
dd…df   |
dd…df   fS )aû  Clip a polygon to the given bounding box.

    Parameters
    ----------
    rp, cp : (K,) ndarray of double
        Row and column coordinates of the polygon.
    (r0, c0), (r1, c1) : double
        Top-left and bottom-right coordinates of the bounding box.

    Returns
    -------
    r_clipped, c_clipped : (L,) ndarray of double
        Coordinates of clipped polygon.

    Notes
    -----
    This makes use of Sutherland-Hodgman clipping as implemented in
    AGG 2.4 and exposed in Matplotlib.

    r   )ÚpathÚ
transformsT)ÚclosedNr   )
r   r	   r
   ÚPathÚnpÚvstackÚTÚBboxÚclip_to_bboxÚto_polygons)ÚrpÚcpÚr0Úc0Úr1Úc1r	   r
   ÚpolyÚ	clip_rectÚpoly_clippeds              ú~/var/www/ITT-ServiceAPI-Services/ITT-Document-Scan/mrzscanner/mrzenv/lib/python3.12/site-packages/skimage/_shared/_geometry.pyr   r      s‚   € ÷, ,à�9‰9”R—Y‘Y  B˜xÓ(×*Ñ*°4ˆ9Ó8€DØ—‘ " b ¨B°¨8Ð 4Ó5€IØ×$Ñ$ YÓ/×;Ñ;Ó=¸aÑ@€Làš˜1˜Ñ˜|ªA¨q¨DÑ1Ð1Ð1ó    c           
      óÖ   — t        j                  | «      } t        j                  |«      }dt        j                  t        j                  |dd | dd z  |dd | dd z  z
  «      «      z  S )zÓCompute the area of a polygon.

    Parameters
    ----------
    pr, pc : (K,) array of float
        Polygon row and column coordinates.

    Returns
    -------
    a : float
        Area of the polygon.
    g      à?Néÿÿÿÿr   )r   ÚasarrayÚabsÚsum)ÚprÚpcs     r   r   r   '   sb   € ô 
�‰�B‹€BÜ	�‰�B‹€BØ”—‘œŸ™  3 B ¨"¨Q¨R¨&Ñ 0°R¸¸°V¸bÀÀ"¸gÑ5EÑFÓGÓHÑHÐHr   )Ú__all__Únumpyr   Úversion_requirementsr   r   r   © r   r   ú<module>r)      s6   ðØ˜>Ð
*€ã å )ñ 	ˆ�wÓñ2ó  ð2ó<Ir   