%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/PIL/__pycache__/ImageDraw2.cpython-312.pyc

�

��e����dZddlmZddlmZmZmZmZmZGd�d�Z	Gd�d�Z
Gd	�d
�ZGd�d�Zy
)z]
(Experimental) WCK-style drawing interface operations

.. seealso:: :py:mod:`PIL.ImageDraw`
�)�annotations�)�Image�
ImageColor�	ImageDraw�	ImageFont�	ImagePathc��eZdZdZdd�Zy)�Penz"Stores an outline color and width.c�F�tj|�|_||_y�N)r�getrgb�color�width)�selfrr�opacitys    �0/usr/lib/python3/dist-packages/PIL/ImageDraw2.py�__init__zPen.__init__!s���&�&�u�-��
���
�N)r���__name__�
__module__�__qualname__�__doc__r�rrrrs
��,�rrc��eZdZdZdd�Zy)�BrushzStores a fill colorc�8�tj|�|_yr
)rrr)rrrs   rrzBrush.__init__)s���&�&�u�-��
rN)rrrrrrr&s
���.rrc��eZdZdZdd�Zy)�Fontz Stores a TrueType font and colorc�n�tj|�|_tj||�|_yr
)rrrr�truetype�font)rr�file�sizes    rrz
Font.__init__0s(���&�&�u�-��
��&�&�t�T�2��	rN)�rrrrr!r!-s
��*�3rr!c�h�eZdZdZdd�Zd�Zdd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zy)�Drawz4
    (Experimental) WCK-style drawing interface
    Nc��t|d�stj|||�}tj|�|_||_d|_y)N�im)�hasattrr�newrr)�draw�image�	transform)rr/r&rs    rrz
Draw.__init__;s<���u�d�#��I�I�e�T�5�1�E��N�N�5�)��	���
���rc��|jSr
)r/)rs r�flushz
Draw.flushBs���z�z�rc�"�dx}}d}t|t�r|j}|j}n(t|t�r|j}|j}t|t�r
|j}nt|t�r|j}|j
r0t
j|�}|j|j
�|dk(r|jj|||��yt|j|�|||��y)Nr�line)�fillr)r5�outline)�
isinstancerrrrr0r	�Pathr.r4�getattr)r�op�xy�pen�brushr6r5rs        r�renderzDraw.renderEs������$����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�'�Brc�(�|\}}dd|dd|f|_y)zSets a transformation offset.rrN)r0)r�offset�xoffset�yoffsets    r�settransformzDraw.settransform]s ��#���'��Q���A�w�7��rc�0�|jd|||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>�rr;�start�end�optionss     rrEzDraw.arcbs��	����E�2�u�c�4�G�4rc�0�|jd|||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`
        �chordNrFrGs     rrLz
Draw.chordks��	����G�R���6�g�6rc�,�|jd|g|���y)z�
        Draws an ellipse inside the given bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
        �ellipseNrF�rr;rJs   rrNzDraw.ellipsets��	����I�r�,�G�,rc�,�|jd|g|���y)z�
        Draws a line between the coordinates in the ``xy`` list.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
        r4NrFrOs   rr4z	Draw.line|s��	����F�B�)��)rc�0�|jd|||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`
        �piesliceNrFrGs     rrRz
Draw.pieslice�s��	����J��E�3�9��9rc�,�|jd|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`
        �polygonNrFrOs   rrTzDraw.polygon�s��	����I�r�,�G�,rc�,�|jd|g|���y)zg
        Draws a rectangle.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
        �	rectangleNrFrOs   rrVzDraw.rectangle�s��	����K��.�g�.rc���|jr0tj|�}|j|j�|jj	|||j
|j��y)zw
        Draws the string at the given position.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
        )r$r5N)r0r	r8r.�textr$r�rr;rXr$s    rrXz	Draw.text�sI���>�>�����#�B��L�L����(��	�	���r�4�d�i�i�d�j�j��Arc���|jr0tj|�}|j|j�|jj	|||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$)r0r	r8r.�textbboxr$rYs    rr\z
Draw.textbbox�sI���>�>�����#�B��L�L����(��y�y�!�!�"�d����!�;�;rc�P�|jj||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`
        r[)r.�
textlengthr$)rrXr$s   rr^zDraw.textlength�s"���y�y�#�#�D�t�y�y�#�9�9r)NNr
)rrrrrr2r>rCrErLrNr4rRrTrVrXr\r^rrrr)r)6sO�����C�08�
5�7�-�*�:�-�/�	B�<�:rr)N)
r�
__future__r�rrrrr	rrr!r)rrr�<module>ras?��(�
#�@�@���.�.�3�3�K:�K:r

Zerion Mini Shell 1.0