
    h;                        S r SSKJr  SSKJrJrJr  SSKJrJ	r	J
r
JrJr  SSKJrJr   " S S5      r " S	 S
5      r " S S5      r " S S5      rg)z]
(Experimental) WCK-style drawing interface operations

.. seealso:: :py:mod:`PIL.ImageDraw`
    )annotations)AnyAnyStrBinaryIO   )Image
ImageColor	ImageDraw	ImageFont	ImagePath)CoordsStrOrBytesPathc                  &    \ rS rSrSrSSS jjrSrg)Pen!   z"Stores an outline color and width.c                F    [         R                  " U5      U l        X l        g N)r	   getrgbcolorwidth)selfr   r   opacitys       @/var/www/html/env/lib/python3.13/site-packages/PIL/ImageDraw2.py__init__Pen.__init__$   s    &&u-

    )r   r   N)r      )r   strr   intr   r   returnNone__name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r   r   r   r   !   s    , r   r   c                  &    \ rS rSrSrSSS jjrSrg)Brush)   zStores a fill colorc                :    [         R                  " U5      U l        g r   )r	   r   r   )r   r   r   s      r   r   Brush.__init__,   s    &&u-
r   )r   N)r   )r   r   r   r   r    r!   r"   r)   r   r   r+   r+   )   s    . .r   r+   c                  6    \ rS rSrSr S       SS jjrSrg)Font0   z Stores a TrueType font and colorc                p    [         R                  " U5      U l        [        R                  " X#5      U l        g r   )r	   r   r   r   truetypefont)r   r   filesizes       r   r   Font.__init__3   s(      &&u-
&&t2	r   )r   r4   N)   )r   r   r5   zStrOrBytesPath | BinaryIOr6   floatr    r!   r"   r)   r   r   r0   r0   0   s6    * JL33 93AF3	3 3r   r0   c                  .   \ rS rSrSr  S       SS jjrSS jr S           SS jjrSS jr            SS jr	            SS	 jr
SS
 jrSS jr            SS jrSS jrSS jrSS jr        SS jrSS jrSrg)Draw;   z,
(Experimental) WCK-style drawing interface
Nc                    [        U[        5      (       a'  Uc  Sn[        U5      e[        R                  " XU5      n[
        R                  " U5      U l        Xl        S U l	        g )Nz>If image argument is mode string, size must be a list or tuple)

isinstancer   
ValueErrorr   newr
   r;   drawimage	transform)r   rB   r6   r   msgs        r   r   Draw.__init__@   sQ     eS!!|V o%IIe51ENN5)	
QUr   c                    U R                   $ r   )rB   )r   s    r   flush
Draw.flushO   s    zzr   c                   S =pgSn[        U[        5      (       a  UR                  nUR                  nO-[        U[        5      (       a  UR                  nUR                  n[        U[        5      (       a  UR                  nO![        U[        5      (       a  UR                  nU R
                  (       a3  [        R                  " U5      n	U	R                  U R
                  5        U	nUS;   a  UR                  SU5        O$UR                  SU5        UR                  SU5        US:X  a  UR                  SU5        [        U R                  U5      " U40 UD6  g )Nr   )arclinefilloutlinerK   r   )r>   r   r   r   r+   rC   r   Path
setdefaultgetattrrA   )
r   opxypenbrushkwargsrM   rL   r   paths
             r   renderDraw.renderR   s    c3iiGIIEs##kkGKKEeU##;;DU##99D>>>>"%DNN4>>*B fg.fd+i1<gu-		2r,V,r   c                &    Uu  p#SSUSSU4U l         g)zSets a transformation offset.r   r   N)rC   )r   offsetxoffsetyoffsets       r   settransformDraw.settransformv   s    #QAw7r   c                2    U R                   " SX/UQ7X4S.6  g)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`
rJ   startendNrW   r   rR   rS   ra   rb   optionss         r   rJ   Draw.arc{   s     	E2CWCECr   c                2    U R                   " SX/UQ7X4S.6  g)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`
chordr`   Nrc   rd   s         r   rh   
Draw.chord   s     	GREwEeEr   c                ,    U R                   " SX/UQ76   g)zj
Draws an ellipse inside the given bounding box.

.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`
ellipseNrc   r   rR   rS   re   s       r   rk   Draw.ellipse   s     	Ir11r   c                ,    U R                   " SX/UQ76   g)zp
Draws a line between the coordinates in the ``xy`` list.

.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`
rK   Nrc   rl   s       r   rK   	Draw.line   s     	FB.g.r   c                2    U R                   " SX/UQ7X4S.6  g)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`
pieslicer`   Nrc   rd   s         r   rq   Draw.pieslice   s     	JH'HHr   c                ,    U R                   " SX/UQ76   g)z
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`
polygonNrc   rl   s       r   rt   Draw.polygon   s     	Ir11r   c                ,    U R                   " SX/UQ76   g)zO
Draws a rectangle.

.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`
	rectangleNrc   rl   s       r   rw   Draw.rectangle   s     	K373r   c                    U R                   (       a3  [        R                  " U5      nUR                  U R                   5        UnU R                  R	                  XUR
                  UR                  S9  g)z_
Draws the string at the given position.

.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`
)r4   rL   N)rC   r   rN   rA   textr4   r   r   rR   rz   r4   rV   s        r   rz   	Draw.text   sL     >>>>"%DNN4>>*B		rdiidjjAr   c                    U R                   (       a3  [        R                  " U5      nUR                  U R                   5        UnU R                  R	                  XUR
                  S9$ )z
Returns bounding box (in pixels) of given text.

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

.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textbbox`
r4   )rC   r   rN   rA   textbboxr4   r{   s        r   r   Draw.textbbox   sL     >>>>"%DNN4>>*Byy!!"!;;r   c                H    U R                   R                  XR                  S9$ )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~   )rA   
textlengthr4   )r   rz   r4   s      r   r   Draw.textlength   s      yy##Dyy#99r   )rA   rB   rC   )NN)rB   zImage.Image | strr6   z"tuple[int, int] | list[int] | Noner   z&float | tuple[float, ...] | str | Noner    r!   )r    zImage.Imager   )rQ   r   rR   r   rS   Pen | Brush | NonerT   zBrush | Pen | NonerU   r   r    r!   )rZ   tuple[float, float]r    r!   )rR   r   rS   r   ra   r9   rb   r9   re   r   r    r!   )rR   r   rS   r   re   r   r    r!   )rR   r   rz   r   r4   r0   r    r!   )rR   r   rz   r   r4   r0   r    z!tuple[float, float, float, float])rz   r   r4   r0   r    r9   )r#   r$   r%   r&   r'   r   rG   rW   r]   rJ   rh   rk   rK   rq   rt   rw   rz   r   r   r(   r)   r   r   r;   r;   ;   s    488<	V V 1V 6	V
 
V %)"-"- "-  	"-
 ""- "- 
"-H8
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<;?<	*< :r   r;   N)r'   
__future__r   typingr   r   r    r   r	   r
   r   r   _typingr   r   r   r+   r0   r;   r)   r   r   <module>r      sH   (
 # ( ( @ @ + . .3 3x: x:r   