HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/PIL/__pycache__/ImageDraw2.cpython-310.pyc
o

we}�@s\dZddlmZmZmZmZmZGdd�d�ZGdd�d�ZGdd�d�Z	Gd	d
�d
�Z
dS)z]
(Experimental) WCK-style drawing interface operations

.. seealso:: :py:mod:`PIL.ImageDraw`
�)�Image�
ImageColor�	ImageDraw�	ImageFont�	ImagePathc@seZdZdZddd�ZdS)�Penz"Stores an outline color and width.r�cCst�|�|_||_dS�N)r�getrgb�color�width)�selfrr�opacity�r�G/home/arjun/projects/env/lib/python3.10/site-packages/PIL/ImageDraw2.py�__init__!s
zPen.__init__N)rr��__name__�
__module__�__qualname__�__doc__rrrrrr�rc@�eZdZdZddd�ZdS)�BrushzStores a fill colorrcCst�|�|_dSr	)rr
r)r
rrrrrr)szBrush.__init__N)rrrrrrr&rrc@r)�Fontz Stores a TrueType font and color�cCst�|�|_t�||�|_dSr	)rr
rr�truetype�font)r
r�file�sizerrrr0sz
Font.__init__N)rrrrrrr-rrc@s�eZdZdZddd�Zdd�Zd dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)!�Drawz4
    (Experimental) WCK-style drawing interface
    NcCs4t|d�st�|||�}t�|�|_||_d|_dS)N�im)�hasattrr�newrr �draw�image�	transform)r
r%rrrrrr;s


z
Draw.__init__cCs|jSr	)r%)r
rrr�flushBsz
Draw.flushcCs�d}}d}t|t�r|j}|j}nt|t�r|j}|j}t|t�r&|j}nt|t�r.|j}|jr<t�|�}|�|j�|dkrK|jj	|||d�dSt
|j|�|||d�dS)Nr�line)�fillr)r)�outline)�
isinstancerrrrr&r�Pathr$r(�getattr)r
�op�xy�pen�brushr*r)rrrr�renderEs$




zDraw.rendercCs|\}}dd|dd|f|_dS)zSets a transformation offset.r�N)r&)r
�offset�xoffset�yoffsetrrr�settransform]szDraw.settransformcG�|jd|||g|�R�dS)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�r2�r
r/�start�end�optionsrrrr9b�zDraw.arccGr8)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`
        �chordNr:r;rrrr@kr?z
Draw.chordcG�|jd|g|�R�dS)z�
        Draws an ellipse inside the given bounding box.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
        �ellipseNr:�r
r/r>rrrrBt�zDraw.ellipsecGrA)z�
        Draws a line between the coordinates in the ``xy`` list.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
        r(Nr:rCrrrr(|rDz	Draw.linecGr8)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`
        �piesliceNr:r;rrrrE�r?z
Draw.pieslicecGrA)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`
        �polygonNr:rCrrrrF�szDraw.polygoncGrA)zg
        Draws a rectangle.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
        �	rectangleNr:rCrrrrG�rDzDraw.rectanglecCs8|jrt�|�}|�|j�|jj|||j|jd�dS)zw
        Draws the string at the given position.

        .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
        )rr)N)r&rr,r$�textrr�r
r/rHrrrrrH�s
z	Draw.textcCs0|jrt�|�}|�|j�|jj|||jd�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&rr,r$�textbboxrrIrrrrK�s
z
Draw.textbboxcCs|jj||jd�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`
        rJ)r$�
textlengthr)r
rHrrrrrL�szDraw.textlength)NNr	)rrrrrr'r2r7r9r@rBr(rErFrGrHrKrLrrrrr 6s 

			

r N)r�rrrrrrrrr rrrr�<module>s