+
     i  c                  s    ^ RI Ht ^RIHt  ! R R4      t ! R R4      t ! R R4      t ! R	 R
4      t ! R R]4      tR# )    )annotations)Imagec                  s2    ] tR t^tRtR R ltR R ltRtR# )HDCz
Wraps an HDC integer. The resulting object can be passed to the
:py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose`
methods.
c                    V ^8  d   QhRRRR/# )   dcintreturnNone Zformat   "3/usr/lib64/python3.14/site-packages/PIL/ImageWin.py__annotate__HDC.__annotate__   s      3 4     c                	    Wn         R # Nr   )selfr      &&r   __init__ZHDC.__init__   s    r   c                   V ^8  d   QhRR/# r   r   r   r
   r   r   r   r   r   "   s       r   c                	    V P                   # r   r   r      &r   __int__ZHDC.__int__"   s    wwr   r   N__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r
   r   r   r   r      s     r   r   c                  s2    ] tR t^&tRtR R ltR R ltRtR# )HWNDz
Wraps an HWND integer. The resulting object can be passed to the
:py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose`
methods, instead of a DC.
c               r   )r   wndr   r   r	   r
   r   r   r   r   HWND.__annotate__-   s      C D r   c                	r   r   r%   )r   r%   r   r   r   ZHWND.__init__-   s    r   c               r   r   r
   r   r   r   r   r&   0   s       r   c                	r   r   r'   r   r   r   r   ZHWND.__int__0   s    xxr   r'   Nr   r
   r   r   r$   r$   &   s     r   r$   c                  sz    ] tR t^4tRtRR R lltR R ltRR R lltR	 R
 ltRR R llt	R R lt
R R ltRtR# )Diba  
A Windows bitmap with the given mode and size.  The mode can be one of "1",
"L", "P", or "RGB".

If the display requires a palette, this constructor creates a suitable
palette and associates it with the image. For an "L" image, 128 graylevels
are allocated. For an "RGB" image, a 6x6x6 colour cube is used, together
with 20 graylevels.

To make sure that palettes work properly under Windows, you must call the
``palette`` method upon certain events from Windows.

:param image: Either a PIL image, or a mode string. If a mode string is
              used, a size must also be given.  The mode can be one of "1",
              "L", "P", or "RGB".
:param size: If the first argument is a mode string, this
             defines the size of the image.
Nc               $    V ^8  d   QhRRRRRR/# )r   imagezImage.Image | strsizeztuple[int, int] | Noner   r	   r
   r   r   r   r   Dib.__annotate__H   s$      &.D	r   c                	s   \        V\        4      '       d   TpR pVf   Rp\        V4      hMVP                  pVP                  pVR9  d   \
        P                  ! V4      p\
        P                  P                  W24      V n	        W0n        W n        V'       d,   \        V\        4      '       d   Q hV P                  V4       R# R# ) Nz+If first argument is mode, size is required)Z1ZLZPZRGB)
isinstancestrZ
ValueErrormoder+   r   ZgetmodebasecoreZdisplayr*   paste)r   r*   r+   r0   Zmsgs   &&&  r   r   ZDib.__init__H   s     eS!!DE|C o%  ::D::D--$$T*DZZ''3
		!%----JJu r   c               r   )r   handleint | HDC | HWNDr   r	   r
   r   r   r   r   r,   ]   s     * *- *$ *r   c                sf   \        V4      p\        V\        4      '       dU   V P                  P	                  V4      p V P                  P                  V4       V P                  P                  W#4       R# V P                  P                  V4       R#   T P                  P                  Y#4       i ; i)z
Copy the bitmap contents to a device context.

:param handle: Device context (HDC), cast to a Python integer, or an
               HDC or HWND instance.  In PythonWin, you can use
               ``CDC.GetHandleAttrib()`` to get a suitable handle.
N)r   r.   r$   r*   getdcexpose	releasedc)r   r3   
handle_intr      &&  r   r6   Z
Dib.expose]   s     [
fd##!!*-B5

!!"%

$$Z4JJj) 

$$Z4   B B0c               s(    V ^8  d   QhRRRRRRRR/# )	r   r3   r4   dstztuple[int, int, int, int]src tuple[int, int, int, int] | Noner   r	   r
   r   r   r   r   r,   o   s2     2 2 2 '2 .	2
 
2r   c                s   Vf   RV P                   ,           p\        V4      p\        V\        4      '       dV   V P                  P                  V4      p V P                  P                  WRV4       V P                  P                  WE4       R# V P                  P                  WBV4       R#   T P                  P                  YE4       i ; i)a5  
Same as expose, but allows you to specify where to draw the image, and
what part of it to draw.

The destination and source areas are given as 4-tuple rectangles. If
the source is omitted, the entire image is copied. If the source and
the destination have different sizes, the image is resized as
necessary.
N)r    r    )r+   r   r.   r$   r*   r5   drawr7   )r   r3   r;   r<   r8   r   s   &&&&  r   r>   ZDib.drawo   s     ;499$C[
fd##!!*-B5

-

$$Z4JJOOJS1 

$$Z4s   B, ,C	c               r   )r   r3   r4   r   r   r
   r   r   r   r   r,      s      $4  r   c                sf   \        V4      p\        V\        4      '       dU   V P                  P	                  V4      p V P                  P                  V4      pV P                  P                  W4       V# V P                  P                  V4      pV#   T P                  P                  Y4       i ; i)a  
Installs the palette associated with the image in the given device
context.

This method should be called upon **QUERYNEWPALETTE** and
**PALETTECHANGED** events from Windows. If this method returns a
non-zero value, one or more display palette entries were changed, and
the image should be redrawn.

:param handle: Device context (HDC), cast to a Python integer, or an
               HDC or HWND instance.
:return: The number of entries that were changed (if one or more entries,
         this indicates that the image should be redrawn).
)r   r.   r$   r*   r5   query_paletter7   )r   r3   r8   Zresultr9   r   r?   ZDib.query_palette   s     [
fd##ZZ%%j1F511&9

$$V4  ZZ--j9F 

$$V4r:   c               r)   )r   imzImage.Imageboxr=   r   r	   r
   r   r   r   r   r,      s$     $ $$$D$	$r   c                s<   VP                  4        V P                  VP                  8w  d   VP                  V P                  4      pV'       d)   V P                  P	                  VP
                  V4       R# V P                  P	                  VP
                  4       R# )a  
Paste a PIL image into the bitmap image.

: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.
:param box: A 4-tuple defining the left, upper, right, and
            lower pixel coordinate.  See :ref:`coordinate-system`. If
            None is given instead of a tuple, all of the image is
            assumed.
N)Zloadr0   Zconvertr*   r2   r@   )r   r@   rA      &&&r   r2   Z	Dib.paste   s`     		99DII&BJJRUUC(JJRUU#r   c               r   )r   bufferbytesr   r	   r
   r   r   r   r   r,      s     % % %$ %r   c                s<    V P                   P                  V4       R# )z
Load display memory contents from byte data.

:param buffer: A buffer containing display data (usually
               data returned from :py:func:`~PIL.ImageWin.Dib.tobytes`)
N)r*   	frombytes)r   rC   r   r   rE   ZDib.frombytes   s     	

V$r   c               r   )r   r   rD   r
   r   r   r   r   r,      s     $ $ $r   c                s6    V P                   P                  4       # )za
Copy display memory contents to bytes object.

:return: A bytes object containing display data.
)r*   tobytesr   r   r   rF   ZDib.tobytes   s     zz!!##r   )r*   r0   r+   r   )r   r   r    r!   r"   r   r6   r>   r?   r2   rE   rF   r#   r
   r   r   r(   r(   4   s/    &**$264$,%$ $r   r(   c                  s~    ] tR t^tRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRtR# )Windowz*Create a Window with the given title size.Nc               s(    V ^8  d   QhRRRRRRRR/# )r   titler/   widthz
int | Noneheightr   r	   r
   r   r   r   r   Window.__annotate__   s,     
 

)3
DN
	
r   c                	s    \         P                  P                  YP                  T;'       g    ^ T;'       g    ^ 4      V n        R# )r    N)r   r1   Zcreatewindow_Window__dispatcherhwnd)r   rH   rI   rJ   s   &&&&r   r   ZWindow.__init__   s3     JJ++$$ejjq&++A
	r   c               r)   )r   actionr/   argsr   r   r	   r
   r   r   r   r   rK      s!     4 43 4s 4t 4r   c                	s,    \        V R V 24      ! V!   R# )Z
ui_handle_N)Zgetattr)r   rN   rO   s   &&*r   Z__dispatcherZWindow.__dispatcher   s    
6(+,d3r   c               0    V ^8  d   QhRRRRRRRRRRRR/# 	r   r   r   x0y0x1y1r   r	   r
   r   r   r   r   rK      s6      # 3 C S c d r   c                	    R # r   r
   r   r   rR   rS   rT   rU      &&&&&&r   ui_handle_clearZWindow.ui_handle_clear       r   c          
     s,    V ^8  d   QhRRRRRRRRRR/# )r   rR   r   rS   rT   rU   r   r	   r
   r   r   r   r   rK      s/      3 C S c d r   c                	rV   r   r
   )r   rR   rS   rT   rU   s   &&&&&r   ui_handle_damageZWindow.ui_handle_damage   rZ   r   c               r   r   r   r	   r
   r   r   r   r   rK      s      4 r   c                	rV   r   r
   r   r   r   ui_handle_destroyZWindow.ui_handle_destroy   rZ   r   c               rP   rQ   r
   r   r   r   r   rK      s6      3 C S c s t r   c                	rV   r   r
   rW   rX   r   ui_handle_repairZWindow.ui_handle_repair   rZ   r   c               s$    V ^8  d   QhRRRRRR/# )r   rI   r   rJ   r   r	   r
   r   r   r   r   rK      s!      c 3 4 r   c                	rV   r   r
   )r   rI   rJ   rB   r   ui_handle_resizeZWindow.ui_handle_resize   rZ   r   c               r   r\   r
   r   r   r   r   rK      s      $ r   c                	sB    \         P                  P                  4        R # r   )r   r1   Z	eventloopr   r   r   mainloopZWindow.mainloop   s    

r   )rM   )PILNN)r   r   r    r!   r"   r   rL   rY   r[   r]   r^   r_   r`   r#   r
   r   r   rG   rG      s2    4
4 r   rG   c                  sB   a  ] tR t^tRtRR V 3R llltR R ltRtV ;t# )ImageWindowz6Create an image window which displays the given image.c               r)   )r   r*   zImage.Image | DibrH   r/   r   r	   r
   r   r   r   r   ImageWindow.__annotate__   s"     < </ < < <r   c                	s   < \        V\        4      '       g   \        V4      pWn        VP                  w  r4\        SV `  W#VR 7       R# ))rI   rJ   N)r.   r(   r*   r+   Zsuperr   )r   r*   rH   rI   rJ   	__class__s   &&&  r   r   ZImageWindow.__init__   s;    %%%JE


F;r   c               rP   rQ   r
   r   r   r   r   rc      s6     . .3 .C .S .c .s .t .r   c                	sB    V P                   P                  WW4V34       R # r   )r*   r>   rW   rX   r   r^   ZImageWindow.ui_handle_repair   s    

,-r   )r*   )ra   )	r   r   r    r!   r"   r   r^   r#   Z__classcell__)rd   s   @r   rb   rb      s    @< <. .r   rb   N)	Z
__future__r   r-   r   r   r$   r(   rG   rb   r
   r   r   <module>re      sE   & #   U$ U$p @.& .r   