
    g%#                        S SK Jr  S SKrS SKJr  S SKJrJrJr  SSK	J
r
Jr  \(       a  SSKJr  SS jr        SS	 jr " S
 S5      r " S S5      rSS jrSS jrg)    )annotationsN)BytesIO)TYPE_CHECKINGAnycast   )Image	ImageFile)CapsuleTypec                    S nSU ;   a  U R                  S5      nO SU ;   a  [        U R                  S5      5      nU(       d  g [        R                  " U5      $ )Nfiledata)popr   r	   open)kwsources     S/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/PIL/ImageTk.py_get_image_from_kwr   *   sI    F|	2(::f    c                   UR                   n UR                  X[        U5      5        g ! [        R                   aC    SSKJn  UR                  UR                  5       5        UR                  X[        U5      5         g f = f)Nr   )
_imagingtk)	tkcallreprtkinterTclError r   tkinit
interpaddr)commandphotoptrr   r   s        r   _pyimagingtkcallr#   5   sd     
B+
S	* + 	!"--/*
S	*+s   * AB Bc                  j    \ rS rSrS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
rg)
PhotoImageH   a  
A Tkinter-compatible photo image.  This can be used
everywhere Tkinter expects an image object.  If the image is an RGBA
image, pixels having alpha 0 are treated as transparent.

The constructor takes either a PIL image, or a mode and a size.
Alternatively, you can use the ``file`` or ``data`` options to initialize
the photo image object.

:param image: Either a PIL image, or a mode string.  If a mode string is
              used, a size must also be given.
:param size: If the first argument is a mode string, this defines the size
             of the image.
:keyword file: A filename to load the image from (using
               ``Image.open(file)``).
:keyword data: An 8-bit string containing image data (as loaded from an
               image file).
Nc                f   Uc  [        U5      nUc  Sn[        U5      e[        U[        5      (       a  UnS nUc  Sn[        U5      eOrUR                  nUS:X  aI  UR                  5         UR                  5         UR                  (       a  UR                  R                  OSnUR                  nUu  US'   US'   US;  a  [        R                  " U5      nXPl        X l        [        R                  " S0 UD6U l        U R                  R                   U l        U(       a  U R#                  U5        g g )	NImage is requiredz+If first argument is mode, size is requiredPRGBwidthheight)1Lr*   RGBA )r   
ValueError
isinstancestrmodeapply_transparencyloadpalettesizer	   getmodebase_PhotoImage__mode_PhotoImage__sizer   r%   _PhotoImage__photor   paste)selfimager8   r   msgr4   s         r   __init__PhotoImage.__init__\   s    =&r*E=%CS/!s##DE|C o% 
 ::Ds{((*

-2]]u}}))::D(,%BwKH00$$T*D))/B/,,//JJu r   c                     U R                   R                  nS U R                   l         U R                   R                  R	                  SSU5        g ! [         a     g f = f! [
         a     g f = fNr?   delete)r<   nameAttributeErrorr   r   	Exceptionr>   rF   s     r   __del__PhotoImage.__del__   j    	<<$$D !	LLOO  (D9	  		
  		"   A 'A" 
AA"
A/.A/c                ,    [        U R                  5      $ )z
Get the Tkinter photo image identifier.  This method is automatically
called by Tkinter whenever a PhotoImage object is passed to a Tkinter
method.

:return: A Tkinter photo image identifier (a string).
)r3   r<   r>   s    r   __str__PhotoImage.__str__        4<<  r   c                     U R                   S   $ z=
Get the width of the image.

:return: The width, in pixels.
r   r;   rO   s    r   r+   PhotoImage.width        {{1~r   c                     U R                   S   $ z?
Get the height of the image.

:return: The height, in pixels.
r   rU   rO   s    r   r,   PhotoImage.height   rW   r   c                j   UR                  5       nUR                  nUR                  5       (       a  UR                  U R                  :w  aQ  [
        R                  R                  U R                  UR                  5      nUR                  XC5        UR                  n[        SU R                  U5        g)a  
Paste a PIL image into the photo image.  Note that this can
be very slow if the photo image is displayed.

:param im: A PIL image. The size must match the target region.  If the
           mode does not match, the image is converted to the mode of
           the bitmap image.
PyImagingPhotoN)getimimisblockr4   r:   r	   core	new_blockr8   convert2r"   r#   r<   )r>   r^   r"   r?   blocks        r   r=   PhotoImage.paste   sv     hhj}}"''T[["8JJ((bgg>ENN5())C)4<<=r   )__mode__photo__sizer   )NN)r?   zImage.Image | str | Noner8   ztuple[int, int] | Noner   r   returnNonerh   ri   rh   r3   rh   int)r^   Image.Imagerh   ri   )__name__
__module____qualname____firstlineno____doc__rA   rJ   rP   r+   r,   r=   __static_attributes__r0   r   r   r%   r%   H   sT    * +/'+''' %' 	'
 
'R	!>r   r%   c                  N    \ rS rSrSrS
SS jjrSS jrSS jrSS jrSS jr	S	r
g)BitmapImage   a  
A Tkinter-compatible bitmap image.  This can be used everywhere Tkinter
expects an image object.

The given image must have mode "1".  Pixels having value 0 are treated as
transparent.  Options, if any, are passed on to Tkinter.  The most commonly
used option is ``foreground``, which is used to specify the color for the
non-transparent parts.  See the Tkinter documentation for information on
how to specify colours.

:param image: A PIL image.
Nc                    Uc  [        U5      nUc  Sn[        U5      eUR                  U l        UR                  U l        [        R                  " SSUR                  5       0UD6U l	        g )Nr(   r   r0   )
r   r1   r4   _BitmapImage__moder8   _BitmapImage__sizer   rv   tobitmap_BitmapImage__photo)r>   r?   r   r@   s       r   rA   BitmapImage.__init__   s\    =&r*E=%CS/!jjjj**G0@GBGr   c                     U R                   R                  nS U R                   l         U R                   R                  R	                  SSU5        g ! [         a     g f = f! [
         a     g f = frD   )r|   rF   rG   r   r   rH   rI   s     r   rJ   BitmapImage.__del__   rL   rM   c                     U R                   S   $ rT   rz   rO   s    r   r+   BitmapImage.width   rW   r   c                     U R                   S   $ rY   r   rO   s    r   r,   BitmapImage.height   rW   r   c                ,    [        U R                  5      $ )z
Get the Tkinter bitmap image identifier.  This method is automatically
called by Tkinter whenever a BitmapImage object is passed to a Tkinter
method.

:return: A Tkinter bitmap image identifier (a string).
)r3   r|   rO   s    r   rP   BitmapImage.__str__   rR   r   )re   rf   rg   )N)r?   zImage.Image | Noner   r   rh   ri   rj   rl   rk   )ro   rp   rq   rr   rs   rA   rJ   r+   r,   rP   rt   r0   r   r   rv   rv      s!    H	!r   rv   c                    [         R                  " SU R                  5       U R                  5       45      n[	        SXR                  5       5        U$ )z:Copies the contents of a PhotoImage to a PIL image memory.r/   PyImagingPhotoGet)r	   newr+   r,   r#   r]   )r!   r^   s     r   getimager     s9    	6EKKM5<<>:	;B(%<Ir   c                     " S S[         R                  5      n[        [         S5      (       d  Sn[        U5      e[         R                  " 5       nU(       a  UR                  U5        U" X@5      R                  5         g)z!Helper for the Image.show method.c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )_show.<locals>.UIi  c                   > U   UR                   S:X  a  [        USUS9U l        O[        X!S9U l        [        (       a%  [        [        R                  U R                  5      nOU R                  n[        TU ]%  XSSS9  g )Nr-   white)
foregroundmaster)r   blackr   )r?   bgbd)
r4   rv   r?   r%   r   r   r   _ImagesuperrA   )r>   r   r^   r?   	__class__s       r   rA   _show.<locals>.UI.__init__  sc    ww#~(O
':
}W^^TZZ8

GVWCr   )r?   )r   ztkinter.Toplevelr^   rn   rh   ri   )ro   rp   rq   rr   rA   rt   __classcell__)r   s   @r   UIr     s    
	D 
	Dr   r   _default_rootztkinter not initializedN)r   LabelgetattrOSErrorTopleveltitlepack)r?   r   r   r@   tops        r   _showr     s_    DW]] D 7O,,'cl



C		%sNr   )r   zdict[str, Any]rh   zImageFile.ImageFile | None)r    r3   r!   zPhotoImage | tkinter.PhotoImager"   r   rh   ri   )r!   r%   rh   rn   )r?   rn   r   z
str | Nonerh   ri   )
__future__r   r   ior   typingr   r   r   r   r	   r
   _typingr   r   r#   r%   rv   r   r   r0   r   r   <module>r      sk   6 #   + + $++8+?J+	+&s> s>t>! >!Br   