Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/PIL/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/PIL/__pycache__/ImageDraw2.cpython-312.pyc

�

&ٜg;���dZddlmZddlmZmZmZddlmZm	Z	m
Z
mZmZddl
mZmZGd�d�ZGd	�d
�ZGd�d�ZGd
�d�Zy)z]
(Experimental) WCK-style drawing interface operations

.. seealso:: :py:mod:`PIL.ImageDraw`
�)�annotations)�Any�AnyStr�BinaryIO�)�Image�
ImageColor�	ImageDraw�	ImageFont�	ImagePath)�Coords�StrOrBytesPathc��eZdZdZddd�Zy)�Penz"Stores an outline color and width.c�F�tj|�|_||_y�N)r	�getrgb�color�width)�selfrr�opacitys    �9/usr/local/lib/python3.12/site-packages/PIL/ImageDraw2.py�__init__zPen.__init__$s���&�&�u�-��
���
�N)r�)r�strr�intrr�return�None��__name__�
__module__�__qualname__�__doc__r�rrrr!s
��,�rrc��eZdZdZddd�Zy)�BrushzStores a fill colorc�8�tj|�|_yr)r	rr)rrrs   rrzBrush.__init__,s���&�&�u�-��
rN)r)rrrrrrr r%rrr'r')s
���.rr'c�*�eZdZdZ	d							dd�Zy)�Fontz Stores a TrueType font and colorc�n�tj|�|_tj||�|_yr)r	rrr�truetype�font)rr�file�sizes    rrz
Font.__init__3s*�� �&�&�u�-��
��&�&�t�T�2��	rN)�)rrr.zStrOrBytesPath | BinaryIOr/�floatrrr r%rrr*r*0s1��*�JL�3��3� 9�3�AF�3�	
�3rr*c��eZdZdZ		d							dd�Zdd�Z	d											dd�Zdd�Z												dd�Z												dd�Z	dd	�Z
dd
�Z												dd�Zdd�Z
dd
�Zdd�Z								dd�Zdd�Zy)�Drawz4
    (Experimental) WCK-style drawing interface
    Nc��t|t�r&|�
d}t|��tj|||�}tj|�|_||_d|_	y)Nz>If image argument is mode string, size must be a list or tuple)
�
isinstancer�
ValueErrorr�newr
r3�draw�image�	transform)rr9r/r�msgs     rrz
Draw.__init__@sR���e�S�!��|�V�� ��o�%��I�I�e�T�5�1�E��N�N�5�)��	���
�QU��rc��|jSr)r9)rs r�flushz
Draw.flushOs���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
r2t
j|�}	|	j|j
�|	}|dvr|jd|�n$|jd|�|jd|�|dk(r|jd|�t|j|�|fi|��y)Nr)�arc�line�fill�outliner@r)r5rrrr'r:r�Path�
setdefault�getattrr8)
r�op�xy�pen�brush�kwargsrBrAr�paths
          r�renderzDraw.renderRs�����$����c�3���i�i�G��I�I�E�
��s�
#��k�k�G��K�K�E��e�U�#��;�;�D�
��U�
#��9�9�D��>�>��>�>�"�%�D��N�N�4�>�>�*��B�
�� ����f�g�.����f�d�+����i��1�
��<����g�u�-����	�	�2��r�,�V�,rc�(�|\}}dd|dd|f|_y)zSets a transformation offset.rrN)r:)r�offset�xoffset�yoffsets    r�settransformzDraw.settransformvs ��#���'��Q���A�w�7��rc�6�|jd||g|��||d��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`
        r?��start�endN�rL�rrGrHrTrU�optionss      rr?zDraw.arc{s"��	����E�2�s�C�W�C�E�s�Crc�6�|jd||g|��||d��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`
        �chordrSNrVrWs      rrZz
Draw.chord�s"��	����G�R��E�w�E�e��Erc�.�|jd||g|���y)z�
        Draws an ellipse inside the given bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
        �ellipseNrV�rrGrHrXs    rr\zDraw.ellipse�s��	����I�r�3�1��1rc�.�|jd||g|���y)z�
        Draws a line between the coordinates in the ``xy`` list.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
        r@NrVr]s    rr@z	Draw.line�s��	����F�B��.�g�.rc�6�|jd||g|��||d��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`
        �pieslicerSNrVrWs      rr`z
Draw.pieslice�s"��	����J��C�H�'�H��C�Hrc�.�|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`
        �polygonNrVr]s    rrbzDraw.polygon�s��	����I�r�3�1��1rc�.�|jd||g|���y)zg
        Draws a rectangle.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
        �	rectangleNrVr]s    rrdzDraw.rectangle�s��	����K��S�3�7�3rc���|jr2tj|�}|j|j�|}|jj	|||j
|j��y)zw
        Draws the string at the given position.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
        )r-rAN)r:rrCr8�textr-r�rrGrfr-rKs     rrfz	Draw.text�sN���>�>��>�>�"�%�D��N�N�4�>�>�*��B��	�	���r�4�d�i�i�d�j�j��Arc���|jr2tj|�}|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-)r:rrCr8�textbboxr-rgs     rrjz
Draw.textbbox�sN���>�>��>�>�"�%�D��N�N�4�>�>�*��B��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`
        ri)r8�
textlengthr-)rrfr-s   rrlzDraw.textlength�s"���y�y�#�#�D�t�y�y�#�9�9r)NN)r9zImage.Image | strr/z"tuple[int, int] | list[int] | Nonerz&float | tuple[float, ...] | str | Nonerr)rzImage.Imager)rFrrGr
rH�Pen | Brush | NonerIzBrush | Pen | NonerJrrr)rN�tuple[float, float]rr)rGr
rHrmrTr1rUr1rXrrr)rGr
rHrmrXrrr)rGrnrfrr-r*rr)rGrnrfrr-r*rz!tuple[float, float, float, float])rfrr-r*rr1)r!r"r#r$rr=rLrQr?rZr\r@r`rbrdrfrjrlr%rrr3r3;s����48�8<�	
V� �
V�1�
V�6�	
V�

�
V��%)�"-��"-�
�"-� �	"-�
"�"-��
"-�
�"-�H8�
D��D� �D��	D�
�D��
D�
�D� F��F� �F��	F�
�F��
F�
�F� 2�/�I��I� �I��	I�
�I��
I�
�I� 2�4�
B�<�%�<�-3�<�;?�<�	*�<� :rr3N)r$�
__future__r�typingrrr�rr	r
rr�_typingr
rrr'r*r3r%rr�<module>rssH��(�
#�(�(�@�@�+���.�.�3�3�x:�x:r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists