
    9i
                     f    S r SSKrSSKrSSKJr   " S S\5      r " S S\5      r " S	 S
\5      rg)zD
PIL-based formats to take screenshots and grab from the clipboard.
    N   )Formatc                   j   ^  \ rS rSrSrSrSrU 4S jrS rS r	 " S S	\
R                  5      rS
rU =r$ )BaseGrabFormat   zBase format for grab formats.FNc                 b   > [         [        U ]
  " U0 UD6  [        R                  " 5       U l        g N)superr   __init__	threadingRLock_lock)selfargskwargs	__class__s      T/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/imageio/plugins/grab.pyr   BaseGrabFormat.__init__   s%    nd,d=f=__&
    c                     g)NF r   requests     r   
_can_writeBaseGrabFormat._can_write   s    r   c                 6   U R                      U R                  (       d4  SU l        SS Kn[        US5      (       d  [	        S5      e SSKJn  X l        S S S 5        U R                  $ ! [         a     S S S 5        g f = f! , (       d  f       U R                  $ = f)NTr   __version__z(Imageio Pillow requires Pillow, not PIL!)	ImageGrab)r   _pillow_importedPILhasattrImportErrorr   
_ImageGrab)r   r    r   s      r   _init_pillowBaseGrabFormat._init_pillow   s    ZZ(((,%sM22%&STT - #,   #   Z  Z s/   9A?A'A?'
A<1A?;A<<A??
Bc                   &    \ rS rSrS rS rS rSrg)BaseGrabFormat.Reader(   c                     g r	   r   r   s    r   _openBaseGrabFormat.Reader._open)       r   c                     g r	   r   r*   s    r   _closeBaseGrabFormat.Reader._close,   r-   r   c                 8    U R                   R                  U5      $ r	   )format	_get_data)r   indexs     r   r3   BaseGrabFormat.Reader._get_data/   s    ;;((//r   r   N)__name__
__module____qualname____firstlineno__r+   r/   r3   __static_attributes__r   r   r   Readerr'   (   s    			0r   r;   )r#   r   r   )r6   r7   r8   r9   __doc__r   r#   r   r   r$   r   r;   r:   __classcell__)r   s   @r   r   r      s5    'J'0 0 0r   r   c                   $    \ rS rSrSrS rS rSrg)ScreenGrabFormat3   zThe 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                 V    UR                   S:w  a  g[        U R                  5       5      $ )Nz<screen>Ffilenameboolr$   r   s     r   	_can_readScreenGrabFormat._can_read?   s'    z)D%%'((r   c                     U R                  5       nU(       d   eUR                  5       nUc   e[        R                  " U5      nU0 4$ r	   )r$   grabnpasarrayr   r4   r   pil_imims        r   r3   ScreenGrabFormat._get_dataD   sG    %%'	y!!!!ZZ2vr   r   Nr6   r7   r8   r9   r<   rE   r3   r:   r   r   r   r?   r?   3   s    	)
r   r?   c                   $    \ rS rSrSrS rS rSrg)ClipboardGrabFormatN   a  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                 V    UR                   S:w  a  g[        U R                  5       5      $ )Nz<clipboard>FrB   r   s     r   rE   ClipboardGrabFormat._can_readZ   s'    },D%%'((r   c                     U R                  5       nU(       d   eUR                  5       nUc  [        S5      e[        R                  " U5      nU0 4$ )Nz5There seems to be no image data on the clipboard now.)r$   grabclipboardRuntimeErrorrI   rJ   rK   s        r   r3   ClipboardGrabFormat._get_data_   sT    %%'	y((*>J  ZZ2vr   r   NrO   r   r   r   rQ   rQ   N   s    	)

r   rQ   )	r<   r   numpyrI   corer   r   r?   rQ   r   r   r   <module>r[      s:      $0V $0N~ 6. r   