Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2v�j>��T�SSKJr SSKrSSKJr SSKJr Sr"SS5rS	r	S3r4Srg)�)�annotationsN)�IO�)�EpsImagePluginFc��\rSrSrSrSSSjjrSSSjjrSSjrSSjrSSjr	SS	jr5SS6jr\(aSSK
Jr SSS
jjrSrg)�PSDraw�z]7Sets up printing to the given file. If ``fp`` is omitted,8``sys.stdout.buffer`` is assumed.9Nc�R�U(d[RRnXlg�N)�sys�stdout�buffer�fp)�selfrs  �PD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/PSDraw.py�__init__�PSDraw.__init__%s������"�"�B���c���URRS5 URR[5 URR[5 URRS5 0Ulg)z=Set up printing of a document. (Write PostScript DSC header.)sD%!PS-Adobe-3.010save11/showpage { } def12%%EndComments13%%BeginDocument14s%%EndProlog15N)r�write�	EDROFF_PS�VDI_PS�isofont)r�ids  r�begin_document�PSDraw.begin_document*sS��	
���
�
�
!�	16�	
���
�
�i� ����
�
�f�����
�
�&�'�)+��rc��URRS5 [URS5(aURR5 gg)z-Ends printing. (Write PostScript DSC footer.)s%%%EndDocument17restore showpage18%%End19�flushN)rr�hasattrr)rs r�end_document�PSDraw.end_document:s6�����
�
�A�B��4�7�7�G�$�$��G�G�M�M�O�%rc���[US5nX0R;a.URRSX34-5 SURU'URRSX#4-5 g)z^20Selects which font to use.21 22:param font: A PostScript font name23:param size: Size in points.24zUTF-8s#/PSDraw-%s ISOLatin1Encoding /%s E25rs/F0 %d /PSDraw-%s F26N)�bytesrrr)r�font�size�27font_bytess    r�setfont�PSDraw.setfont@s^���4��)�28��\�\�)��G�G�M�M�7�:�:R�R�
�()�D�L�L��$����
�
�.�$�1C�C�Drc�J�URRS/UQUQ7-5 g)z�29Draws a line between the two points. Coordinates are given in30PostScript point coordinates (72 points per inch, (0, 0) is the lower31left corner of the page).32s%d %d %d %d Vl33N�rr)r�xy0�xy1s   r�line�PSDraw.lineQs"��	
���
�
�)�L�c�L�C�L�8�9rc�@�URRSU-5 g)zi34Draws a rectangle.35 36:param box: A tuple of four integers, specifying left, bottom, width and37   height.38s%d %d M 0 %d %d Vr39Nr*)r�boxs  r�	rectangle�PSDraw.rectangleYs��	
���
�
�-��3�4rc���[US5nSRURS55nSRURS55nURR	SX4--5 g)zr40Draws text at the given position. You must use41:py:meth:`~PIL.PSDraw.PSDraw.setfont` before calling this method.42zlatin-1s\(�(s\)�)s%d %d M (%s) S43N)r#�join�splitrr)r�xy�text�44text_bytess    rr9�PSDraw.textbs]���4��+�45��[�[��!1�!1�$�!7�8�46��[�[��!1�!1�$�!7�8�47����
�
�)�R�-�-?�@�Arr)�Imagec��U(dURS:XaSnOSnURSS-U-nURSS-U-n[USUS-485n[USUS-495nXF:�a	XV-U-nUnXW:�a	XG-U-nUnXd-50S-US-nXu-51S-US-n	URR	S	X�4-5 XE4UR:waAXBRS-n52XRRS-nURR	S53X�4-5 [54R"X RSS5 URR	S5 g
)z,Draw a PIL image, centered in the given box.�1���dr�Hr��sgsave55%f %f translate56s%f %f scale57�s5859grestore60N)�moder%�floatrrr�_save)rr0�im�dpi�x�y�xmax�ymax�dx�dy�sx�sys            r�image�PSDraw.imagepsH��61��w�w�#�~������G�G�A�J��O�c�!���G�G�A�J��O�c�!���S��V�c�!�f�_�%���S��V�c�!�f�_�%���8���1��A��A��8���1��A��A��h�!�^�c�!�f�
$���h�!�^�c�!�f�
$�����
�
�1�R�H�<�=�
�6�R�W�W���W�W�Q�Z��B��W�W�Q�Z��B��G�G�M�M�*�b�X�5�6����R���"�a�0����
�
�o�&r)rrr)rzIO[bytes] | None�return�None)rz62str | NonerTrU)rTrU)r$�strr%�intrTrU)r+�tuple[int, int]r,rXrTrU)r0�tuple[int, int, int, int]rTrU)r8rXr9rVrTrU)r0rYrHzImage.ImagerIz63int | NonerTrU)�__name__�64__module__�__qualname__�__firstlineno__�__doc__rrr r'r-r1r9�
TYPE_CHECKINGrDr<rR�__static_attributes__�rrrrse���65�66,� �E�":�5�	B���RV�'�,�'�2=�'�DN�'�	
�'�'rrs�/S { show } bind def67/P { moveto show } bind def68/M { moveto } bind def69/X { 0 rmoveto } bind def70/Y { 0 exch rmoveto } bind def71/E {    findfont72        dup maxlength dict begin73        {74                1 index /FID ne { def } { pop pop } ifelse75        } forall76        /Encoding exch def77        dup /FontName exch def78        currentdict end definefont pop79} bind def80/F {    findfont exch scalefont dup setfont81        [ exch /setfont cvx ] cvx bind def82} bind def83s�/Vm { moveto } bind def84/Va { newpath arcn stroke } bind def85/Vl { moveto lineto stroke } bind def86/Vc { newpath 0 360 arc closepath } bind def87/Vr {   exch dup 0 rlineto88        exch dup 0 exch rlineto89        exch neg 0 rlineto90        0 exch neg rlineto91        setgray fill } bind def92/Tm matrix def93/Ve {   Tm currentmatrix pop94        translate scale newpath 0 0 .5 0 360 arc closepath95        Tm setmatrix96} bind def97/Vf { currentgray exch setgray fill setgray } bind def98s�/landscape false def99/errorBUF 200 string def100/errorNL { currentpoint 10 sub exch pop 72 exch moveto } def101errordict begin /handleerror {102    initmatrix /Courier findfont 10 scalefont setfont103    newpath 72 720 moveto $error begin /newerror false def104    (PostScript Error) show errorNL errorNL105    (Error: ) show106        /errorname load errorBUF cvs show errorNL errorNL107    (Command: ) show108        /command load dup type /stringtype ne { errorBUF cvs } if show109        errorNL errorNL110    (VMstatus: ) show111        vmstatus errorBUF cvs show ( bytes available, ) show112        errorBUF cvs show ( bytes used at level ) show113        errorBUF cvs show errorNL errorNL114    (Operand stargck: ) show errorNL /ostargck load {115        dup type /stringtype ne { errorBUF cvs } if 72 0 rmoveto show errorNL116    } forall errorNL117    (Execution stargck: ) show errorNL /estargck load {118        dup type /stringtype ne { errorBUF cvs } if 72 0 rmoveto show errorNL119    } forall120    end showpage121} def end122)�123__future__rr�typingrrDrr_rrr�ERROR_PSrarr�<module>res:��"#�124����
�p'�p'�@
�	�:125��2�r
codekingpro/portable-devtools · Team Ai