Ë
    ^ãjì  ã                  ó¬   — d dl mZ ddhZd dlZd dlmZ ddlmZmZ dZ	e	rd d	l
mZ dd
lmZ dd„Z	 	 	 	 	 	 	 	 dd„Z G d„ d«      Z G d„ d«      Zdd„Zy)é    )ÚannotationsÚioÚtkinterN)ÚBytesIOé   )ÚImageÚ	ImageFileF)ÚAny)ÚCapsuleTypec                óž   — d }d| v r| j                  d«      }nd| v rt        | j                  d«      «      }|sy t        j                  |«      S )NÚfileÚdata)Úpopr   r   Úopen)ÚkwÚsources     úM/var/www/html/metafoliadorv2/venv/lib/python3.12/site-packages/PIL/ImageTk.pyÚ_get_image_from_kwr   .   sI   € Ø€FØ��|Ø—‘˜“‰Ø	�2‰Ü˜Ÿ™ ›Ó(ˆÙØÜ�:‰:�fÓÐó    c                ó
  — |j                   }	 |j                  | |t        |«      «       y # t        j                  $ rD ddlm} |j                  |j                  «       «       |j                  | |t        |«      «       Y y w xY w)Nr   )Ú
_imagingtk)	ÚtkÚcallÚreprr   ÚTclErrorÚ r   ÚtkinitÚ
interpaddr)ÚcommandÚphotoÚptrr   r   s        r   Ú_pyimagingtkcallr"   9   sh   € ð 
�‰€Bð+Ø
�‰�˜¤ S£	Õ*øÜ×Ñò +õ 	!à×Ñ˜"Ÿ-™-›/Ô*Ø
�‰�˜¤ S£	Ö*ð+ús   Ž+ «ABÂBc                  óT   — e Zd ZdZ	 	 d		 	 	 	 	 	 	 d
d„Zdd„Zdd„Zdd„Zdd„Zdd„Z	y)Ú
PhotoImagea3  
    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                ó:  — |€t        |«      }|€d}t        |«      ‚t        |t        «      r|}d }|€yd}t        |«      ‚|j                  }|dk(  rD|j                  «        |j                  «        |j                  r|j                  j                  nd}|j                  }|\  |d<   |d<   |dvrt        j                  |«      }|| _        || _        t        j                  di |¤Ž| _        | j                  j                   | _        |r| j#                  |«       y y )	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Úimager6   r   Úmsgr2   s         r   Ú__init__zPhotoImage.__init__`   s  € ð ˆ=Ü& rÓ*ˆEàˆ=Ø%ˆCÜ˜S“/Ð!Ü˜œsÔ#ØˆDØˆEàˆ|ØC�Ü  “oÐ%ð —:‘:ˆDØ�sŠ{à×(Ñ(Ô*Ø—
‘
”Ø-2¯]ª]�u—}‘}×)Ò)À�Ø—:‘:ˆDØ(,Ñ%ˆBˆw‰K˜˜H™àÐ0Ñ0Ü×$Ñ$ TÓ*ˆDàˆŒØˆŒÜ×)Ñ)Ñ/¨BÑ/ˆŒØ—,‘,—/‘/ˆŒÙØ�J‰J�uÕð r   c                óà   — 	 | j                   j                  }d | j                   _        	 | j                   j                  j	                  dd|«       y # t        $ r Y y w xY w# t
        $ r Y y w xY w©Nr=   Údelete)r:   ÚnameÚAttributeErrorr   r   Ú	Exception©r<   rC   s     r   Ú__del__zPhotoImage.__del__‰   ój   € ð	Ø—<‘<×$Ñ$ˆDð !ˆ�‰Ôð	Ø�L‰L�O‰O× Ñ  ¨(°DÕ9øô	 ò 	Ùð	ûô
 ò 	Ùð	úó"   ‚A ª'A! Á	AÁAÁ!	A-Á,A-c                ó,   — t        | j                  «      S )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).
        )r1   r:   ©r<   s    r   Ú__str__zPhotoImage.__str__”   ó   € ô �4—<‘<Ó Ð r   c                ó    — | j                   d   S ©zU
        Get the width of the image.

        :return: The width, in pixels.
        r   ©r9   rK   s    r   r)   zPhotoImage.widthž   ó   € ð �{‰{˜1‰~Ðr   c                ó    — | j                   d   S ©zW
        Get the height of the image.

        :return: The height, in pixels.
        r   rP   rK   s    r   r*   zPhotoImage.height¦   rQ   r   c                ó^  — |j                  «       }|j                  }|j                  «       r|j                  | j                  k7  rQt
        j                  j                  | j                  |j                  «      }|j                  |«       |j                  }t        d| j                  |«       y)aF  
        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Úisblockr2   r8   r   ÚcoreÚ	new_blockr6   Úconvert_intor!   r"   r:   )r<   rW   r!   r=   Úblocks        r   r;   zPhotoImage.paste®   sv   € ð �h‰h‹jˆØ—‘ˆØ�}‰}Œ "§'¡'¨T¯[©[Ò"8Ü—J‘J×(Ñ(¨¯©°b·g±gÓ>ˆEØ×Ñ˜uÔ%Ø—)‘)ˆCäÐ)¨4¯<©<¸Õ=r   )NN)r=   zImage.Image | str | Noner6   ztuple[int, int] | Noner   r
   ÚreturnÚNone©r]   r^   ©r]   r1   ©r]   Úint)rW   úImage.Imager]   r^   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r?   rG   rL   r)   r*   r;   r.   r   r   r$   r$   L   sT   „ ñð* +/Ø'+ð'à'ð'ð %ð'ð ð	'ð
 
ó'óR	ó!óóô>r   r$   c                  ó:   — e Zd ZdZdd	d„Zd
d„Zdd„Zdd„Zdd„Zy)ÚBitmapImageaä  
    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                óÔ   — |€t        |«      }|€d}t        |«      ‚|j                  | _        |j                  | _        t        j                  dd|j                  «       i|¤Ž| _	        y )Nr&   r   r.   )
r   r/   r2   Ú_BitmapImage__moder6   Ú_BitmapImage__sizer   ri   ÚtobitmapÚ_BitmapImage__photo)r<   r=   r   r>   s       r   r?   zBitmapImage.__init__Ô   s\   € àˆ=Ü& rÓ*ˆEàˆ=Ø%ˆCÜ˜S“/Ð!Ø—j‘jˆŒØ—j‘jˆŒä×*Ñ*ÑG°·±Ó0@ÐGÀBÑGˆ�r   c                óà   — 	 | j                   j                  }d | j                   _        	 | j                   j                  j	                  dd|«       y # t        $ r Y y w xY w# t
        $ r Y y w xY wrA   )rn   rC   rD   r   r   rE   rF   s     r   rG   zBitmapImage.__del__á   rH   rI   c                ó    — | j                   d   S rO   ©rl   rK   s    r   r)   zBitmapImage.widthì   rQ   r   c                ó    — | j                   d   S rS   rq   rK   s    r   r*   zBitmapImage.heightô   rQ   r   c                ó,   — t        | j                  «      S )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).
        )r1   rn   rK   s    r   rL   zBitmapImage.__str__ü   rM   r   )N)r=   zImage.Image | Noner   r
   r]   r^   r_   ra   r`   )	rd   re   rf   rg   r?   rG   r)   r*   rL   r.   r   r   ri   ri   Æ   s!   „ ñôHó	óóô!r   ri   c                ó¤   — t        j                  d| j                  «       | j                  «       f«      }t	        d| |j                  «       «       |S )z:Copies the contents of a PhotoImage to a PIL image memory.r-   ÚPyImagingPhotoGet)r   Únewr)   r*   r"   rV   )r    rW   s     r   Úgetimagerw     s;   € ä	�‰�6˜EŸK™K›M¨5¯<©<«>Ð:Ó	;€BäÐ(¨%°·±³Ô<à€Ir   )r   zdict[str, Any]r]   zImageFile.ImageFile | None)r   r1   r    zPhotoImage | tkinter.PhotoImager!   r   r]   r^   )r    r$   r]   rc   )Ú
__future__r   Ú__lazy_modules__r   r   r   r   r   r	   ÚTYPE_CHECKINGÚtypingr
   Ú_typingr   r   r"   r$   ri   rw   r.   r   r   ú<module>r}      ss   ðõ6 #à˜)Ð$Ð ã Ý ç à€ÙÝå$óð+Øð+Ø8ð+Ø?Jð+à	ó+÷&s>ñ s>÷t>!ñ >!ôBr   