Ë
    Eü´jØ
  ã                   óf   — d Z ddlZddlZddlmZ  G d„ de«      Z G d„ de«      Z G d	„ d
e«      Zy)zD
PIL-based formats to take screenshots and grab from the clipboard.
é    Né   )ÚFormatc                   ó`   ‡ — e Zd ZdZdZdZˆ fd„Zd„ Zd„ Z G d„ de	j                  «      Z
ˆ xZS )	ÚBaseGrabFormatzBase format for grab formats.FNc                 ó^   •— t        t        | �
  |i |¤Ž t        j                  «       | _        y ©N)Úsuperr   Ú__init__Ú	threadingÚRLockÚ_lock)ÚselfÚargsÚkwargsÚ	__class__s      €úR/root/workspace/ytshorts/venv/lib/python3.12/site-packages/imageio/plugins/grab.pyr
   zBaseGrabFormat.__init__   s%   ø€ ÜŒn˜dÑ,¨dÐ=°fÒ=Ü—_‘_Ó&ˆ�
ó    c                  ó   — y)NF© ©r   Úrequests     r   Ú
_can_writezBaseGrabFormat._can_write   s   € Ør   c                 ó  — | j                   5  | j                  s0d| _        dd l}t        |d«      st	        d«      ‚	 ddlm} || _        d d d «       | j                  S # t        $ r Y d d d «       y w xY w# 1 sw Y   | j                  S xY w)NTr   Ú__version__z(Imageio Pillow requires Pillow, not PIL!)Ú	ImageGrab)r   Ú_pillow_importedÚPILÚhasattrÚImportErrorr   Ú
_ImageGrab)r   r   r   s      r   Ú_init_pillowzBaseGrabFormat._init_pillow   sŠ   € Ø�Z‰Zñ 	,Ø×(Ò(Ø(,�Ô%Ûä˜s MÔ2Ü%Ð&SÓTÐTð Ý-ð #,�”÷	,ð �‰Ðøô #ò  Ø÷	,ð 	,ð ú÷	,ð �‰Ðús.   �/A5½AÁA5Á	A2Á'A5Á1A2Á2A5Á5B	c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)úBaseGrabFormat.Readerc                  ó   — y r   r   ©r   s    r   Ú_openzBaseGrabFormat.Reader._open)   ó   € Ør   c                  ó   — y r   r   r%   s    r   Ú_closezBaseGrabFormat.Reader._close,   r'   r   c                 ó8   — | j                   j                  |«      S r   )ÚformatÚ	_get_data)r   Úindexs     r   r,   zBaseGrabFormat.Reader._get_data/   s   € Ø—;‘;×(Ñ(¨Ó/Ð/r   N)Ú__name__Ú
__module__Ú__qualname__r&   r)   r,   r   r   r   ÚReaderr#   (   s   „ ò	ò	ó	0r   r1   )r.   r/   r0   Ú__doc__r   r    r
   r   r!   r   r1   Ú__classcell__)r   s   @r   r   r      s5   ø„ Ù'àÐØ€Jô'òòô0�—‘÷ 0ð 0r   r   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚScreenGrabFormata  The ScreenGrabFormat provided a means to grab screenshots using
    the uri of "<screen>".

    This functionality is provided via Pillow. Note that "<screen>" is
    only supported on Windows and OS X.

    Parameters for reading
    ----------------------
    No parameters.
    c                 óT   — |j                   dk7  ryt        | j                  «       «      S )Nz<screen>F©ÚfilenameÚboolr!   r   s     r   Ú	_can_readzScreenGrabFormat._can_read?   s'   € Ø×Ñ˜zÒ)ØÜ�D×%Ñ%Ó'Ó(Ð(r   c                 ó„   — | j                  «       }|sJ ‚|j                  «       }|€J ‚t        j                  |«      }|i fS r   )r!   ÚgrabÚnpÚasarray©r   r-   r   Úpil_imÚims        r   r,   zScreenGrabFormat._get_dataD   sG   € Ø×%Ñ%Ó'ˆ	ÙÐˆyà—‘Ó!ˆØÐ!Ð!Ð!Ü�Z‰Z˜ÓˆØ�2ˆvˆr   N©r.   r/   r0   r2   r:   r,   r   r   r   r5   r5   3   s   „ ñ	ò)ó
r   r5   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚClipboardGrabFormata(  The ClipboardGrabFormat provided a means to grab image data from
    the clipboard, using the uri "<clipboard>"

    This functionality is provided via Pillow. Note that "<clipboard>" is
    only supported on Windows.

    Parameters for reading
    ----------------------
    No parameters.
    c                 óT   — |j                   dk7  ryt        | j                  «       «      S )Nz<clipboard>Fr7   r   s     r   r:   zClipboardGrabFormat._can_readZ   s'   € Ø×Ñ˜}Ò,ØÜ�D×%Ñ%Ó'Ó(Ð(r   c                 ó–   — | j                  «       }|sJ ‚|j                  «       }|€t        d«      ‚t        j                  |«      }|i fS )Nz5There seems to be no image data on the clipboard now.)r!   ÚgrabclipboardÚRuntimeErrorr=   r>   r?   s        r   r,   zClipboardGrabFormat._get_data_   sT   € Ø×%Ñ%Ó'ˆ	ÙÐˆyà×(Ñ(Ó*ˆØˆ>ÜØJóð ô �Z‰Z˜ÓˆØ�2ˆvˆr   NrB   r   r   r   rD   rD   N   s   „ ñ	ò)ó

r   rD   )	r2   r   Únumpyr=   Úcorer   r   r5   rD   r   r   r   ú<module>rK      s:   ðñó ã å ô$0�Vô $0ôN�~ô ô6˜.õ r   