+
    UBi                        ^ 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                  2    ] 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 )formats   "1/usr/lib/python3.14/site-packages/PIL/ImageWin.py__annotate__HDC.__annotate__   s      3 4     c                	    Wn         R # Nr	   )selfr	   s   &&r   __init__HDC.__init__   s    r   c                   V ^8  d   QhRR/# r   r   r
   r   )r   s   "r   r   r   "   s       r   c                	    V P                   # r   r   r   s   &r   __int__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                  2    ] 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                    V ^8  d   QhRRRR/# )r   wndr
   r   r   r   )r   s   "r   r   HWND.__annotate__-   s      C D r   c                	    Wn         R # r   r)   )r   r)   s   &&r   r   HWND.__init__-   s    r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r*   0   s       r   c                	    V P                   # r   r,   r   s   &r   r   HWND.__int__0   s    xxr   r,   Nr   r   r   r   r'   r'   &   s     r   r'   c                  z    ] 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   s   "r   r   Dib.__annotate__H   s$      &.D	r   c                	   \        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)1LPRGB)
isinstancestr
ValueErrormoder5   r   getmodebasecoredisplayr4   paste)r   r4   r5   r@   msgs   &&&  r   r   Dib.__init__H   s     eS!!DE|C o%  ::D::D--$$T*DZZ''3
		!%----JJu r   c                    V ^8  d   QhRRRR/# )r   handleint | HDC | HWNDr   r   r   )r   s   "r   r   r6   ]   s     * *- *$ *r   c                f   \        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'   r4   getdcexpose	releasedc)r   rH   
handle_intr	   s   &&  r   rL   
Dib.expose]   s     [
fd##!!*-B5

!!"%

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

$$Z4   B B0c               (    V ^8  d   QhRRRRRRRR/# )	r   rH   rI   dstztuple[int, int, int, int]src tuple[int, int, int, int] | Noner   r   r   )r   s   "r   r   r6   o   s2     2 2 2 '2 .	2
 
2r   c                   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   )r5   r
   r=   r'   r4   rK   drawrM   )r   rH   rR   rS   rN   r	   s   &&&&  r   rV   Dib.drawo   s     ;499$C[
fd##!!*-B5

-

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

$$Z4s   B, ,C	c                    V ^8  d   QhRRRR/# )r   rH   rI   r   r
   r   )r   s   "r   r   r6      s      $4  r   c                f   \        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'   r4   rK   query_paletterM   )r   rH   rN   results   &&  r   rZ   Dib.query_palette   s     [
fd##ZZ%%j1F511&9

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

$$V4rP   c               $    V ^8  d   QhRRRRRR/# )r   imzImage.ImageboxrT   r   r   r   )r   s   "r   r   r6      s$     $ $$$D$	$r   c                <   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)loadr@   convertr4   rD   r^   )r   r^   r_   s   &&&r   rD   	Dib.paste   s`     		99DII&BJJRUUC(JJRUU#r   c                    V ^8  d   QhRRRR/# )r   bufferbytesr   r   r   )r   s   "r   r   r6      s     % % %$ %r   c                <    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)r4   	frombytes)r   re   s   &&r   rh   Dib.frombytes   s     	

V$r   c                   V ^8  d   QhRR/# )r   r   rf   r   )r   s   "r   r   r6      s     $ $ $r   c                6    V P                   P                  4       # )za
Copy display memory contents to bytes object.

:return: A bytes object containing display data.
)r4   tobytesr   s   &r   rl   Dib.tobytes   s     zz!!##r   )r4   r@   r5   r   )r    r!   r"   r#   r$   r   rL   rV   rZ   rD   rh   rl   r%   r   r   r   r2   r2   4   s/    &**$264$,%$ $r   r2   c                  ~    ] 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               (    V ^8  d   QhRRRRRRRR/# )r   titler>   widthz
int | Noneheightr   r   r   )r   s   "r   r   Window.__annotate__   s,     
 

)3
DN
	
r   c                	    \         P                  P                  YP                  T;'       g    ^ T;'       g    ^ 4      V n        R# )r   N)r   rB   createwindow_Window__dispatcherhwnd)r   rq   rr   rs   s   &&&&r   r   Window.__init__   s3     JJ++$$ejjq&++A
	r   c               $    V ^8  d   QhRRRRRR/# )r   actionr>   argsr
   r   r   r   )r   s   "r   r   rt      s!     4 43 4s 4t 4r   c                	,    \        V R V 24      ! V!   R# )
ui_handle_N)getattr)r   r{   r|   s   &&*r   __dispatcher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   s   "r   r   rt      s6      # 3 C S c d r   c                	    R # r   r   r   r	   r   r   r   r   s   &&&&&&r   ui_handle_clearWindow.ui_handle_clear       r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )r   r   r
   r   r   r   r   r   r   )r   s   "r   r   rt      s/      3 C S c d r   c                	    R # r   r   )r   r   r   r   r   s   &&&&&r   ui_handle_damageWindow.ui_handle_damage   r   r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   rt      s      4 r   c                	    R # r   r   r   s   &r   ui_handle_destroyWindow.ui_handle_destroy   r   r   c               0    V ^8  d   QhRRRRRRRRRRRR/# r   r   )r   s   "r   r   rt      s6      3 C S c s t r   c                	    R # r   r   r   s   &&&&&&r   ui_handle_repairWindow.ui_handle_repair   r   r   c               $    V ^8  d   QhRRRRRR/# )r   rr   r
   rs   r   r   r   )r   s   "r   r   rt      s!      c 3 4 r   c                	    R # r   r   )r   rr   rs   s   &&&r   ui_handle_resizeWindow.ui_handle_resize   r   r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rt      s      $ r   c                	B    \         P                  P                  4        R # r   )r   rB   	eventloopr   s   &r   mainloopWindow.mainloop   s    

r   )rx   )PILNN)r    r!   r"   r#   r$   r   rw   r   r   r   r   r   r   r%   r   r   r   ro   ro      s2    4
4 r   ro   c                  B   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               $    V ^8  d   QhRRRRRR/# )r   r4   zImage.Image | Dibrq   r>   r   r   r   )r   s   "r   r   ImageWindow.__annotate__   s"     < </ < < <r   c                	   < \        V\        4      '       g   \        V4      pWn        VP                  w  r4\        SV `  W#VR 7       R# ))rr   rs   N)r=   r2   r4   r5   superr   )r   r4   rq   rr   rs   	__class__s   &&&  r   r   ImageWindow.__init__   s;    %%%JE


F;r   c               0    V ^8  d   QhRRRRRRRRRRRR/# r   r   )r   s   "r   r   r      s6     . .3 .C .S .c .s .t .r   c                	B    V P                   P                  WW4V34       R # r   )r4   rV   r   s   &&&&&&r   r   ImageWindow.ui_handle_repair   s    

,-r   )r4   )r   )	r    r!   r"   r#   r$   r   r   r%   __classcell__)r   s   @r   r   r      s    @< <. .r   r   N)	
__future__r   r8   r   r   r'   r2   ro   r   r   r   r   <module>r      sE   & #   U$ U$p @.& .r   