ó
    ©Rj.  ã                  ó¤   • 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       Ú:D:\diplom_project\venv\Lib\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)ÚFonté1   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__4   s(   € ô  ×&Ò& uÓ-ˆŒ
Ü×&Ò& tÓ2ˆ�	r   )r   r4   N)é   )r   r   r5   zStrOrBytesPath | BinaryIOr6   Úfloatr    r!   r"   r)   r   r   r0   r0   1   s6   † Ù*ð JLð3Øð3Ø 9ð3ØAFð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__A   sQ   € ô �eœS×!Ñ!Ø‰|ØV�Ü  “oÐ%Ü—I’I˜e¨5Ó1ˆEÜ—N’N 5Ó)ˆŒ	ØŒ
ØQUˆ�r   c                ó   • U R                   $ r   )rB   )r   s    r   ÚflushÚ
Draw.flushP   s   € Ø�z‰zÐ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.renderS   s  € ð ÐˆØˆÜ�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Ó,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.settransformw   s   € à!ÑˆØ˜Q ¨¨A¨wÐ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   € ð 	�Š�E˜2ÐC WÑC°EÔ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   € ð 	�Š�G˜RÐE wÑE°eÔ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   € ð 	�Š�I˜rÐ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   € ð 	�Š�F˜BÐ. 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   € ð 	�Š�I˜rÐ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 Ð3¨7Ô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Ø�N‰N˜4Ÿ>™>Ô*ØˆBØ�	‰	�‰�r d§i¡i°d·j±jˆÒ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Ø�N‰N˜4Ÿ>™>Ô*ØˆBØ�y‰y×!Ñ! "°·±Ð!Ð;Ð;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    € ð �y‰y×#Ñ# D¯y©yÐ#Ð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¤  † ñð 48Ø8<ð	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   