
    h                    T    S SK Jr  S SKrS SKJr  SSKJr  Sr " S S5      rS	r	S
r
Srg)    )annotationsN)IO   )EpsImagePluginFc                      \ rS rSrSrSSS j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\(       a  SSKJr   S       SS jjrSrg)PSDraw   z]
Sets up printing to the given file. If ``fp`` is omitted,
``sys.stdout.buffer`` is assumed.
Nc                R    U(       d  [         R                  R                  nXl        g N)sysstdoutbufferfp)selfr   s     </var/www/html/env/lib/python3.13/site-packages/PIL/PSDraw.py__init__PSDraw.__init__%   s    ""B    c                    U R                   R                  S5        U R                   R                  [        5        U R                   R                  [        5        U R                   R                  S5        0 U l        g)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_documentPSDraw.begin_document*   sS     	!	
 	i f&')+r   c                    U R                   R                  S5        [        U R                   S5      (       a  U R                   R                  5         gg)z-Ends printing. (Write PostScript DSC footer.)s%   %%EndDocument
restore showpage
%%End
flushN)r   r   hasattrr   )r   s    r   end_documentPSDraw.end_document:   s6    AB477G$$GGMMO %r   c                    [        US5      nX0R                  ;  a.  U R                  R                  SX34-  5        SU R                  U'   U R                  R                  SX#4-  5        g)z^
Selects which font to use.

:param font: A PostScript font name
:param size: Size in points.
UTF-8s#   /PSDraw-%s ISOLatin1Encoding /%s E
r   s   /F0 %d /PSDraw-%s F
N)bytesr   r   r   )r   fontsize
font_bytess       r   setfontPSDraw.setfont@   s^     4)
\\)GGMM7::RR ()DLL$.$1CCDr   c                J    U R                   R                  S/ UQUQ7-  5        g)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   linePSDraw.lineQ   s"     	)LcLCL89r   c                @    U R                   R                  SU-  5        g)zi
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   	rectanglePSDraw.rectangleY   s     	-34r   c                    [        US5      nSR                  UR                  S5      5      nSR                  UR                  S5      5      nU R                  R	                  SX4-   -  5        g)zr
Draws text at the given position. You must use
:py:meth:`~PIL.PSDraw.PSDraw.setfont` before calling this method.
r#   s   \(   (s   \)   )s   %d %d M (%s) S
N)r$   joinsplitr   r   )r   xytext
text_bytess       r   r:   PSDraw.textb   s]    
 4)
[[!1!1$!78
[[!1!1$!78
)R--?@Ar   r   )Imagec                   U(       d  UR                   S:X  a  SnOSnUR                  S   S-  U-  nUR                  S   S-  U-  n[        US   US   -
  5      n[        US   US   -
  5      nXF:  a	  XV-  U-  nUnXW:  a	  XG-  U-  nUnXd-
  S-  US   -   nXu-
  S-  US   -   n	U R                  R	                  S	X4-  5        XE4UR                  :w  aA  XBR                  S   -  n
XRR                  S   -  nU R                  R	                  S
X4-  5        [
        R                  " X R                  SS5        U R                  R	                  S5        g)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   r1   imdpixyxmaxymaxdxdysxsys               r   imagePSDraw.imageo   sH   
 ww#~GGAJOc!GGAJOc!SVc!f_%SVc!f_%81AA81AAh!^c!f$h!^c!f$1RH<=6RWWWWQZBWWQZBGGMM*bX56R"a0o&r   )r   r   r   )r   zIO[bytes] | NonereturnNone)r   z
str | NonerU   rV   )rU   rV   )r%   strr&   intrU   rV   )r,   tuple[int, int]r-   rY   rU   rV   )r1   tuple[int, int, int, int]rU   rV   )r9   rY   r:   rW   rU   rV   )r1   rZ   rI   zImage.ImagerJ   z
int | NonerU   rV   )__name__
__module____qualname____firstlineno____doc__r   r   r    r(   r.   r2   r:   TYPE_CHECKINGrE   r=   rS   __static_attributes__ r   r   r   r      se    

, 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   rE   r   r`   r   r   r   ERROR_PSrb   r   r   <module>rf      s:   " # 
  o' o'~	:
2r   