Ë
    ™2Úi}  ã                   ót   — d Z ddlmZmZmZmZmZ  G d„ d«      Z G d„ d«      Z G d„ d«      Z	 G d	„ d
«      Z
y)z]
(Experimental) WCK-style drawing interface operations

.. seealso:: :py:mod:`PIL.ImageDraw`
é   )ÚImageÚ
ImageColorÚ	ImageDrawÚ	ImageFontÚ	ImagePathc                   ó   — e Zd ZdZdd„Zy)ÚPenz"Stores an outline color and width.c                 óF   — t        j                  |«      | _        || _        y ©N)r   ÚgetrgbÚcolorÚwidth)Úselfr   r   Úopacitys       úE/var/www/html/acx/venv/lib/python3.12/site-packages/PIL/ImageDraw2.pyÚ__init__zPen.__init__!   s   € Ü×&Ñ& uÓ-ˆŒ
Øˆ�
ó    N)r   éÿ   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r	   r	      s
   „ Ù,ôr   r	   c                   ó   — e Zd ZdZdd„Zy)ÚBrushzStores a fill colorc                 ó8   — t        j                  |«      | _        y r   )r   r   r   )r   r   r   s      r   r   zBrush.__init__)   s   € Ü×&Ñ& uÓ-ˆ�
r   N)r   r   r   r   r   r   r   &   s
   „ Ùô.r   r   c                   ó   — e Zd ZdZdd„Zy)ÚFontz Stores a TrueType font and colorc                 ón   — t        j                  |«      | _        t        j                  ||«      | _        y r   )r   r   r   r   ÚtruetypeÚfont)r   r   ÚfileÚsizes       r   r   zFont.__init__0   s(   € ä×&Ñ& uÓ-ˆŒ
Ü×&Ñ& t¨TÓ2ˆ�	r   N)é   r   r   r   r   r   r   -   s
   „ Ù*ô3r   r   c                   óh   — e Zd ZdZdd„Zd„ Zdd„Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚDrawz4
    (Experimental) WCK-style drawing interface
    Nc                 óš   — t        |d«      st        j                  |||«      }t        j                  |«      | _        || _        d | _        y )NÚim)Úhasattrr   Únewr   r'   ÚdrawÚimageÚ	transform)r   r-   r$   r   s       r   r   zDraw.__init__;   s<   € Ü�u˜dÔ#Ü—I‘I˜e T¨5Ó1ˆEÜ—N‘N 5Ó)ˆŒ	ØˆŒ
Øˆ�r   c                 ó   — | j                   S r   )r-   )r   s    r   Úflushz
Draw.flushB   s   € Ø�z‰zÐr   c                 ó"  — d x}}d}t        |t        «      r|j                  }|j                  }n(t        |t        «      r|j                  }|j                  }t        |t        «      r|j                  }nt        |t        «      r|j                  }| j
                  r0t        j                  |«      }|j                  | j
                  «       |dk(  r| j                  j                  |||¬«       y  t        | j                  |«      |||¬«       y )Nr   Úline)Úfillr   )r3   Úoutline)Ú
isinstancer	   r   r   r   r.   r   ÚPathr,   r2   Úgetattr)r   ÚopÚxyÚpenÚbrushr4   r3   r   s           r   ÚrenderzDraw.renderE   sÊ   € àÐˆ�$ØˆÜ�cœ3ÔØ—i‘iˆGØ—I‘I‰EÜ˜œsÔ#Ø—k‘kˆGØ—K‘KˆEÜ�eœUÔ#Ø—;‘;‰DÜ˜œUÔ#Ø—9‘9ˆDà�>Š>Ü—‘ Ó#ˆBØ�L‰L˜Ÿ™Ô(à�Š<Ø�I‰I�N‰N˜2 G°5ˆNÕ9à"ŒG�D—I‘I˜rÓ" 2¨D¸'ÖBr   c                 ó(   — |\  }}dd|dd|f| _         y)zSets a transformation offset.r   é    N)r.   )r   ÚoffsetÚxoffsetÚyoffsets       r   ÚsettransformzDraw.settransform]   s    € à#Ñˆ�'Ø˜Q ¨¨A¨wÐ7ˆ�r   c                 ó0   —  | j                   d|||g|¢­Ž  y)zÄ
        Draws an arc (a portion of a circle outline) between the start and end
        angles, inside the given bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.arc`
        ÚarcN©r<   ©r   r9   ÚstartÚendÚoptionss        r   rD   zDraw.arcb   s   € ð 	ˆ�‰�E˜2˜u cÐ4¨GÔ4r   c                 ó0   —  | j                   d|||g|¢­Ž  y)z·
        Same as :py:meth:`~PIL.ImageDraw2.Draw.arc`, but connects the end points
        with a straight line.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord`
        ÚchordNrE   rF   s        r   rK   z
Draw.chordk   s   € ð 	ˆ�‰�G˜R ¨Ð6¨gÔ6r   c                 ó,   —  | j                   d|g|¢­Ž  y)z‚
        Draws an ellipse inside the given bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
        ÚellipseNrE   ©r   r9   rI   s      r   rM   zDraw.ellipset   s   € ð 	ˆ�‰�I˜rÐ, GÔ,r   c                 ó,   —  | j                   d|g|¢­Ž  y)zˆ
        Draws a line between the coordinates in the ``xy`` list.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
        r2   NrE   rN   s      r   r2   z	Draw.line|   s   € ð 	ˆ�‰�F˜BÐ) Ô)r   c                 ó0   —  | j                   d|||g|¢­Ž  y)zÁ
        Same as arc, but also draws straight lines between the end points and the
        center of the bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.pieslice`
        ÚpiesliceNrE   rF   s        r   rQ   zDraw.pieslice„   s   € ð 	ˆ�‰�J  E¨3Ð9°Ô9r   c                 ó,   —  | j                   d|g|¢­Ž  y)a  
        Draws a polygon.

        The polygon outline consists of straight lines between the given
        coordinates, plus a straight line between the last and the first
        coordinate.


        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.polygon`
        ÚpolygonNrE   rN   s      r   rS   zDraw.polygon�   s   € ð 	ˆ�‰�I˜rÐ, GÔ,r   c                 ó,   —  | j                   d|g|¢­Ž  y)zg
        Draws a rectangle.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
        Ú	rectangleNrE   rN   s      r   rU   zDraw.rectangleš   s   € ð 	ˆ�‰�K Ð. gÔ.r   c                 óâ   — | j                   r0t        j                  |«      }|j                  | j                   «       | j                  j	                  |||j
                  |j                  ¬«       y)zw
        Draws the string at the given position.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
        )r"   r3   N)r.   r   r6   r,   Útextr"   r   ©r   r9   rW   r"   s       r   rW   z	Draw.text¢   sI   € ð �>Š>Ü—‘ Ó#ˆBØ�L‰L˜Ÿ™Ô(Ø�	‰	�‰�r˜4 d§i¡i°d·j±jˆÕAr   c                 óÊ   — | j                   r0t        j                  |«      }|j                  | j                   «       | j                  j	                  |||j
                  ¬«      S )zÁ
        Returns bounding box (in pixels) of given text.

        :return: ``(left, top, right, bottom)`` bounding box

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textbbox`
        ©r"   )r.   r   r6   r,   Útextbboxr"   rX   s       r   r[   zDraw.textbbox­   sI   € ð �>Š>Ü—‘ Ó#ˆBØ�L‰L˜Ÿ™Ô(Ø�y‰y×!Ñ! " d°·±Ð!Ó;Ð;r   c                 óP   — | j                   j                  ||j                  ¬«      S )zÄ
        Returns length (in pixels) of given text.
        This is the amount by which following text should be offset.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textlength`
        rZ   )r,   Ú
textlengthr"   )r   rW   r"   s      r   r]   zDraw.textlengthº   s"   € ð �y‰y×#Ñ# D¨t¯y©yÐ#Ó9Ð9r   )NNr   )r   r   r   r   r   r0   r<   rB   rD   rK   rM   r2   rQ   rS   rU   rW   r[   r]   r   r   r   r'   r'   6   sO   „ ñóòóCò08ò
5ò7ò-ò*ò:ò-ò/ò	Bò<ó:r   r'   N)r   Ú r   r   r   r   r   r	   r   r   r'   r   r   r   ú<module>r_      s=   ðñ(÷ AÕ @÷ñ ÷.ñ .÷3ñ 3÷K:ò K:r   