Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
ImageDraw2.cpython-313.pyc100 linesDownload Raw Back to __pycache__
1�

2v�j.���SrSSKJr SSKJrJrJr SSKJrJ	r	J3r4JrJr SSK
JrJr "SS5r"S	S55r"SS5r"S
S5rg)z]6(Experimental) WCK-style drawing interface operations7 8.. seealso:: :py:mod:`PIL.ImageDraw`9�)�annotations)�Any�AnyStr�BinaryIO�)�Image�10ImageColor�	ImageDraw�	ImageFont�	ImagePath)�Coords�StrOrBytesPathc�&�\rSrSrSrSSSjjrSrg)�Pen�"z"Stores an outline color and width.c�F�[R"U5UlX lg�N)r	�getrgb�color�width)�selfrr�opacitys    �TD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/ImageDraw2.py�__init__�Pen.__init__%s���&�&�u�-��11��12�)rrN)r��)r�strr�intrr�return�None��__name__�13__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�rrrr"s��,��rrc�&�\rSrSrSrSSSjjrSrg)�Brush�*zStores a fill colorc�:�[R"U5Ulgr)r	rr)rrrs   rr�Brush.__init__-s���&�&�u�-��14r)rN)r)rrrrr r!r"r)rrr+r+*s���.�.rr+c�6�\rSrSrSrSSSjjrSrg)�Font�1z Stores a TrueType font and colorc�p�[R"U5Ul[R"X#5Ulgr)r	rrr�truetype�font)rr�file�sizes    rr�
Font.__init__4s(�� �&�&�u�-��15��&�&�t�2��	r)rr4N)�)rrr5zStrOrBytesPath | BinaryIOr6�floatr r!r"r)rrr0r01s6��*�JL�3��3� 9�3�AF�3�	
�3�3rr0c�.�\rSrSrSrSSSjjrSSjrSSSjjrSSjrSSjr	SS	jr16SS17jrSSjrSSjr
SS
jrSSjrSSjrSSjrSSjrSrg)�Draw�<z,18(Experimental) WCK-style drawing interface19Nc���[U[5(a'Uc
Sn[U5e[R"XU5n[20R"U5UlXlSUl	g)Nz>If image argument is mode string, size must be a list or tuple)21�22isinstancer�23ValueErrorr�newr24r;�draw�image�	transform)rrBr6r�msgs     rr�
Draw.__init__AsQ���e�S�!�!��|�V�� ��o�%��I�I�e�5�1�E��N�N�5�)��	��25�QU��rc��UR$r)rB)rs r�flush�26Draw.flushPs���z�z�rc��S=pgSn[U[5(aURnURnO-[U[5(aURnURn[U[5(a
URnO![U[5(aURnUR27(a3[R"U5n	U	RUR285 U	nUS;aURSU5 O$URSU5 URSU5 US:XaURSU5 [URU5"U40UD6 g)Nr)�arc�line�fill�outlinerKr)r>rrrr+rCr�Path�29setdefault�getattrrA)30r�op�xy�pen�brush�kwargsrMrLr�paths31          r�render�Draw.renderSs��������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�&�Uup#SSUSSU4Ulg)zSets a transformation offset.rrN)rC)r�offset�xoffset�yoffsets    r�settransform�Draw.settransformws��!����Q���A�w�7��rc�2�UR"SX/UQ7X4S.6 g)z�32Draws an arc (a portion of a circle outline) between the start and end33angles, inside the given bounding box.34 35.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.arc`36rJ��start�endN�rW�rrRrSrarb�optionss      rrJ�Draw.arc|s��	
���E�2�C�W�C�E�Crc�2�UR"SX/UQ7X4S.6 g)z�37Same as :py:meth:`~PIL.ImageDraw2.Draw.arc`, but connects the end points38with a straight line.39 40.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord`41�chordr`Nrcrds      rrh�42Draw.chord�s��	
���G�R�E�w�E�e�Erc�,�UR"SX/UQ76 g)zj43Draws an ellipse inside the given bounding box.44 45.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.ellipse`46�ellipseNrc�rrRrSres    rrk�Draw.ellipse�s��	
���I�r�1��1rc�,�UR"SX/UQ76 g)zp47Draws a line between the coordinates in the ``xy`` list.48 49.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.line`50rKNrcrls    rrK�	Draw.line�s��	
���F�B�.�g�.rc�2�UR"SX/UQ7X4S.6 g)z�51Same as arc, but also draws straight lines between the end points and the52center of the bounding box.53 54.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.pieslice`55�pieslicer`Nrcrds      rrq�
Draw.pieslice�s��	
���J��H�'�H��Hrc�,�UR"SX/UQ76 g)z�56Draws a polygon.57 58The polygon outline consists of straight lines between the given59coordinates, plus a straight line between the last and the first60coordinate.61 62 63.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.polygon`64�polygonNrcrls    rrt�Draw.polygon�s��	
���I�r�1��1rc�,�UR"SX/UQ76 g)zO65Draws a rectangle.66 67.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.rectangle`68�	rectangleNrcrls    rrw�Draw.rectangle�s��	
���K��3�7�3rc���UR(a3[R"U5nURUR5 UnURR	XUR69URS9 g)z_70Draws the string at the given position.71 72.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.text`73)r4rLN)rCrrNrA�textr4r�rrRrzr4rVs     rrz�	Draw.text�sL���>�>��>�>�"�%�D��N�N�4�>�>�*��B��	�	���r�d�i�i�d�j�j��Arc���UR(a3[R"U5nURUR5 UnURR	XUR74S9$)z�75Returns bounding box (in pixels) of given text.76 77:return: ``(left, top, right, bottom)`` bounding box78 79.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textbbox`80�r4)rCrrNrA�textbboxr4r{s     rr�
Draw.textbbox�sL���>�>��>�>�"�%�D��N�N�4�>�>�*��B��y�y�!�!�"����!�;�;rc�H�URRXRS9$)z�81Returns length (in pixels) of given text.82This is the amount by which following text should be offset.83 84.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textlength`85r~)rA�86textlengthr4)rrzr4s   rr��Draw.textlength�s ���y�y�#�#�D�y�y�#�9�9r)rArBrC)NN)rBzImage.Image | strr6z"tuple[int, int] | list[int] | Nonerz&float | tuple[float, ...] | str | Noner r!)r zImage.Imager)rQrrRr
rS�Pen | Brush | NonerTzBrush | Pen | NonerUrr r!)rZ�tuple[float, float]r r!)rRr
rSr�rar9rbr9rerr r!)rRr
rSr�rerr r!)rRr�rzrr4r0r r!)rRr�rzrr4r0r z!tuple[float, float, float, float])rzrr4r0r r9)r#r$r%r&r'rrGrWr]rJrhrkrKrqrtrwrzrr�r(r)rrr;r;<s����48�8<�	
V� �
V�1�
V�6�	
V�8788�
V��%)�"-��"-�
�"-� �	"-�89"�"-��
"-�90�"-�H8�91D��D� �D��	D�92�D��
D�93�D� F��F� �F��	F�94�F��
F�95�F� 2�/�I��I� �I��	I�96�I��
I�97�I� 2�4�98B�<�%�<�-3�<�;?�<�	*�<� :rr;N)r'�99__future__r�typingrrr�rr	r100rr�_typingr
rrr+r0r;r)rr�<module>r�sH��(�#�(�(�@�@�+���.�.�3�3�x:�x:r
codekingpro/portable-devtools · Team Ai