Ë
    6Š·jP  ã                  óT   — d dl mZ d dlZd dlmZ ddlmZ dZ G d„ d«      Zd	Z	d
Z
dZy)é    )ÚannotationsN)ÚIOé   )ÚEpsImagePluginFc                  óv   — e Zd ZdZddd„Zddd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
erd
dlmZ 	 d	 	 	 	 	 	 	 dd„Zy)ÚPSDrawzi
    Sets up printing to the given file. If ``fp`` is omitted,
    ``sys.stdout.buffer`` is assumed.
    Nc                óJ   — |st         j                  j                  }|| _        y ©N)ÚsysÚstdoutÚbufferÚfp)Úselfr   s     ú@/root/workspace/.venv/lib/python3.12/site-packages/PIL/PSDraw.pyÚ__init__zPSDraw.__init__%   s   € ÙÜ—‘×"Ñ"ˆBØˆ�ó    c                óú   — | j                   j                  d«       | j                   j                  t        «       | j                   j                  t        «       | j                   j                  d«       i | _        y)z=Set up printing of a document. (Write PostScript DSC header.)sD   %!PS-Adobe-3.0
save
/showpage { } def
%%EndComments
%%BeginDocument
s   %%EndProlog
N)r   ÚwriteÚ	EDROFF_PSÚVDI_PSÚisofont)r   Úids     r   Úbegin_documentzPSDraw.begin_document*   sS   € ð 	�‰�‰ð!ô	
ð 	�‰�‰”iÔ Ø�‰�‰”fÔØ�‰�‰Ð&Ô'Ø)+ˆ�r   c                óœ   — | j                   j                  d«       t        | j                   d«      r| j                   j                  «        yy)z-Ends printing. (Write PostScript DSC footer.)s%   %%EndDocument
restore showpage
%%End
ÚflushN)r   r   Úhasattrr   )r   s    r   Úend_documentzPSDraw.end_document:   s3   € à�‰�‰ÐAÔBÜ�4—7‘7˜GÔ$Ø�G‰G�M‰M�Oð %r   c                óÖ   — t        |d«      }|| j                  vr/| j                  j                  d||fz  «       d| j                  |<   | j                  j                  d||fz  «       y)z~
        Selects which font to use.

        :param font: A PostScript font name
        :param size: Size in points.
        zUTF-8s#   /PSDraw-%s ISOLatin1Encoding /%s E
r   s   /F0 %d /PSDraw-%s F
N)Úbytesr   r   r   )r   ÚfontÚsizeÚ
font_bytess       r   ÚsetfontzPSDraw.setfont@   sd   € ô ˜4 Ó)ˆ
Ø˜TŸ\™\Ñ)à�G‰G�M‰MØ7¸:ÀzÐ:RÑRôð ()ˆD�L‰L˜Ñ$à�‰�‰Ð.°$¸
Ð1CÑCÕDr   c                óJ   — | j                   j                  dg |¢|¢­z  «       y)z¿
        Draws a line between the two points. Coordinates are given in
        PostScript point coordinates (72 points per inch, (0, 0) is the lower
        left corner of the page).
        s   %d %d %d %d Vl
N©r   r   )r   Úxy0Úxy1s      r   ÚlinezPSDraw.lineQ   s"   € ð 	�‰�‰Ð)¨L¨c¨L°C©LÑ8Õ9r   c                ó@   — | j                   j                  d|z  «       y)z‰
        Draws a rectangle.

        :param box: A tuple of four integers, specifying left, bottom, width and
           height.
        s   %d %d M 0 %d %d Vr
Nr%   )r   Úboxs     r   Ú	rectanglezPSDraw.rectangleY   s   € ð 	�‰�‰Ð-°Ñ3Õ4r   c                óà   — t        |d«      }dj                  |j                  d«      «      }dj                  |j                  d«      «      }| j                  j	                  d||fz   z  «       y)zŠ
        Draws text at the given position. You must use
        :py:meth:`~PIL.PSDraw.PSDraw.setfont` before calling this method.
        zlatin-1s   \(ó   (s   \)ó   )s   %d %d M (%s) S
N)r   ÚjoinÚsplitr   r   )r   ÚxyÚtextÚ
text_bytess       r   r2   zPSDraw.textb   s_   € ô ˜4 Ó+ˆ
Ø—[‘[ ×!1Ñ!1°$Ó!7Ó8ˆ
Ø—[‘[ ×!1Ñ!1°$Ó!7Ó8ˆ
Ø�‰�‰Ð)¨R°:°-Ñ-?Ñ@ÕAr   r   )ÚImagec                ó¬  — |s|j                   dk(  rd}nd}|j                  d   dz  |z  }|j                  d   dz  |z  }t        |d   |d   z
  «      }t        |d   |d   z
  «      }||kD  r
||z  |z  }|}||kD  r
||z  |z  }|}||z
  dz  |d   z   }||z
  dz  |d   z   }	| j                  j	                  d	||	fz  «       ||f|j                  k7  rD||j                  d   z  }
||j                  d   z  }| j                  j	                  d
|
|fz  «       t        j                  || j                  dd«       | j                  j	                  d«       y)z,Draw a PIL image, centered in the given box.Ú1éÈ   éd   r   éH   r   é   é   s   gsave
%f %f translate
s   %f %f scale
Ú s
   
grestore
N)Úmoder!   Úfloatr   r   r   Ú_save)r   r*   ÚimÚdpiÚxÚyÚxmaxÚymaxÚdxÚdyÚsxÚsys               r   ÚimagezPSDraw.imagep   s`  € ñ
 Ø�w‰w˜#Š~Ø‘à�à�G‰G�A‰J˜‰O˜cÑ!ˆØ�G‰G�A‰J˜‰O˜cÑ!ˆä�S˜‘V˜c !™f‘_Ó%ˆÜ�S˜‘V˜c !™f‘_Ó%ˆØˆtŠ8Ø�D‘˜1‘ˆAØˆAØˆtŠ8Ø�D‘˜1‘ˆAØˆAØ�Q‰h˜!‰^˜c !™fÑ$ˆØ�Q‰h˜!‰^˜c !™fÑ$ˆØ�‰�‰Ð1°R¸°HÑ<Ô=Øˆqˆ6�R—W‘WÒà�R—W‘W˜Q‘Z‘ˆBØ�R—W‘W˜Q‘Z‘ˆBØ�G‰G�M‰MÐ*¨b°"¨XÑ5Ô6Ü×Ñ˜R §¡¨"¨aÔ0Ø�‰�‰�oÕ&r   r
   )r   zIO[bytes] | NoneÚreturnÚNone)r   z
str | NonerK   rL   )rK   rL   )r    Ústrr!   ÚintrK   rL   )r&   útuple[int, int]r'   rO   rK   rL   )r*   útuple[int, int, int, int]rK   rL   )r1   rO   r2   rM   rK   rL   )r*   rP   r@   zImage.ImagerA   z
int | NonerK   rL   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r#   r(   r+   r2   ÚTYPE_CHECKINGr<   r4   rJ   © r   r   r   r      s`   „ ñô
ô
,ó óEó":ó5ó	Bñ Ýð RVð'Ø,ð'Ø2=ð'ØDNð'à	ô'r   r   s×  /S { show } bind def
/P { moveto show } bind def
/M { moveto } bind def
/X { 0 rmoveto } bind def
/Y { 0 exch rmoveto } bind def
/E {    findfont
        dup maxlength dict begin
        {
                1 index /FID ne { def } { pop pop } ifelse
        } forall
        /Encoding exch def
        dup /FontName exch def
        currentdict end definefont pop
} bind def
/F {    findfont exch scalefont dup setfont
        [ exch /setfont cvx ] cvx bind def
} bind def
sß  /Vm { moveto } bind def
/Va { newpath arcn stroke } bind def
/Vl { moveto lineto stroke } bind def
/Vc { newpath 0 360 arc closepath } bind def
/Vr {   exch dup 0 rlineto
        exch dup 0 exch rlineto
        exch neg 0 rlineto
        0 exch neg rlineto
        setgray fill } bind def
/Tm matrix def
/Ve {   Tm currentmatrix pop
        translate scale newpath 0 0 .5 0 360 arc closepath
        Tm setmatrix
} bind def
/Vf { currentgray exch setgray fill setgray } bind def
sã  /landscape false def
/errorBUF 200 string def
/errorNL { currentpoint 10 sub exch pop 72 exch moveto } def
errordict begin /handleerror {
    initmatrix /Courier findfont 10 scalefont setfont
    newpath 72 720 moveto $error begin /newerror false def
    (PostScript Error) show errorNL errorNL
    (Error: ) show
        /errorname load errorBUF cvs show errorNL errorNL
    (Command: ) show
        /command load dup type /stringtype ne { errorBUF cvs } if show
        errorNL errorNL
    (VMstatus: ) show
        vmstatus errorBUF cvs show ( bytes available, ) show
        errorBUF cvs show ( bytes used at level ) show
        errorBUF cvs show errorNL errorNL
    (Operand stargck: ) show errorNL /ostargck load {
        dup type /stringtype ne { errorBUF cvs } if 72 0 rmoveto show errorNL
    } forall errorNL
    (Execution stargck: ) show errorNL /estargck load {
        dup type /stringtype ne { errorBUF cvs } if 72 0 rmoveto show errorNL
    } forall
    end showpage
} def end
)Ú
__future__r   r   Útypingr   r<   r   rU   r   r   r   ÚERROR_PSrV   r   r   ú<module>rZ      s:   ðõ" #ã 
Ý å à€÷p'ñ p'ð@€	ð:
€ð2�r   