+
    UBi0                       ^ RI Ht ^ RIt^ RIHt ^ RIHtHt ^ RIH	t	H
t
 ^RIHtHtHtHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt RtR R ltR R lt ! R R]
4      t ! R R4      t ! R R]P                  4      t]P@                  ! ]PB                  ]]4       ]PD                  ! ]PB                  ]4       ]PF                  ! ]PB                  R4       ]PH                  ! ]PB                  R4       R# )    )annotationsN)BytesIO)ceillog)IO
NamedTuple)BmpImagePluginImage	ImageFilePngImagePlugin)i16le)i32le)o8)o16le)o32les      c               (    V ^8  d   QhRRRRRRRR/# )	   imImage.Imagefp	IO[bytes]filenamezstr | bytesreturnNone )formats   "7/usr/lib/python3.14/site-packages/PIL/IcoImagePlugin.py__annotate__r   +   s.     J Jk Jy JK JD J    c                <	   VP                  \        4       V P                  P                  R 4      R8H  pV P                  P                  R. RO4      p. pV .V P                  P                  R. 4      ,           pV P                  w  rx\        \        V4      4       EF[  p	V	^ ,          V8  g+   V	^,          V8  g   V	^ ,          R8  g   V	^,          R8  d   K>  V F  p
V
P                  V	8w  d   K  VP                  V
4       V'       d   \        P                  V
P                  ,          ^,          pV.pV Fh  pVP                  V	8w  d   K  \        P                  VP                  ,          ^,          pW9  g   KF  VP                  V4       VP                  V4       Kj  	   EK  	  X
P                  4       pVP                  V	\        P                  P                  RR7       VP                  V4       EK^  	  VP                  \!        \#        V4      4      4       VP%                  4       \#        V4      ^,          ,           pV EFQ  pVP                  w  rxTP                  \'        VR8  d   TM^ 4      4       TP                  \'        VR8  d   TM^ 4      4       V'       d)   \        P                  VP                  ,          R,          MRw  ppVP                  \'        V4      4       VP                  R4       VP                  R	4       VP                  \!        V4      4       \)        4       pV'       di   VP+                  VR
4       V^ 8w  dO   \        P,                  ! RX	4      p\.        P0                  ! VV\.        P2                  ! RRV	,           ^ R4      .4       MVP+                  VR4       VP5                  ^ 4       VP7                  4       pV'       d/   VR,          \9        V^,          4      ,           VR,          ,           p\#        V4      pVP                  \9        V4      4       VP                  \9        V4      4       VP%                  4       pVP5                  V4       VP                  V4       VV,           pVP5                  V4       EKT  	  R# )bitmap_formatbmpsizes   append_imagesN)reducing_gap:   NN    s     dib1rawpngN   N:   NN))   r0   )   r1   )    r2   )0   r3   )@   r4   )   r5   )r$   r$   )r2   r   r   r   )r*   r   )write_MAGICencoderinfogetsizesortedsetappendr	   SAVEmodecopy	thumbnailr
   
ResamplingLANCZOSo16lentellr   r   savenewr   _save_Tileseekreado32)r   r   r   r"   r#   framesprovided_imswidthheightr<   provided_imbits	bits_usedother_imframeoffsetcolorsimage_ioand_maskimage_bytes	bytes_lencurrents   &&&                   r   rK   rK   +   sf   HHV
..

_
-
6CNNRE F4"..,,_bAALGGMEs5z"7U?d1g.$q'C-47S='K4'MM+&%**;+;+;<Q?!F	 ,H}}, )..x}}=a@D, h/!((. !- ! (&  $$&EOOD%"2"2":":ONMM% 3 #4 HHSVWWYVr))F


US[Ea01
fslF23>A~**5::6r:wf
F


T9JJx'rz 99S$/__UFTM1lKL JJx'ammo%b/C
O;k#>NNK$	
Y 
V'')

)#
I r   c                    V ^8  d   QhRRRR/# )r   prefixbytesr   boolr   )r   s   "r   r   r   x   s     % %E %d %r   c                ,    V P                  \        4      # N)
startswithr9   )ra   s   &r   _acceptrg   x   s    V$$r   c                      ] tR t^|t$ R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R	&   R
]R&   R]R&   R]R&   RtR# )
IconHeaderintrR   rS   nb_colorreservedplanesbppr<   rY   tuple[int, int]dimsquarecolor_depthr   N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r   r   r   ri   ri   |   s;    JKMMK	H
IK	Kr   ri   c                  Z    ] tR t^tR R ltR R ltRR R lltRR R lltR	 R
 ltRt	R# )IcoFilec                    V ^8  d   QhRRRR/# )r   bufr   r   r   r   )r   s   "r   r   IcoFile.__annotate__   s     0N 0NI 0N$ 0Nr   c                   VP                  ^4      p\        V4      '       g   Rp\        V4      hWn        . V n        \        V^4      V n        \        V P                  4       F  pVP                  ^4      pV^ ,          ;'       g    RpV^,          ;'       g    RpV^,          p\        V^4      p\        TTTV^,          \        V^4      \        V^4      \        V^4      \        V^4      WV3WV,          T;'       g-    V^ 8g  ;'       d    \        \        V^4      4      ;'       g    RR7      p	V P                  P                  V	4       K  	  \        V P                  R R7      V n        \        V P                  R RR7      V n        R	# )
z<
Parse image from file-like object containing ico file data
znot an ICO filer$   )rR   rS   rk   rl   rm   rn   r<   rY   rp   rq   rr   c                    V P                   # re   )rr   xs   &r   <lambda>"IcoFile.__init__.<locals>.<lambda>   s    ammr   )keyc                    V P                   # re   )rq   r   s   &r   r   r      s    ahhr   T)r   reverseN)rN   rg   SyntaxErrorr|   entryi16nb_itemsrangeri   i32r   r   r?   r=   )
selfr|   smsgirR   rS   rk   rn   icon_headers
   &&        r   __init__IcoFile.__init__   sQ    HHQKqzz#Cc""
 Aq	 t}}%AA aDKKCEqT[[SF tHa)C$!11ay1IAY1bzO~  TTHM$L$Ld3x;K6LTTQTK  JJk*5 &8 DJJ,CD
DJJ,>M
r   c                   V ^8  d   QhRR/# )r   r   zset[tuple[int, int]]r   )r   s   "r   r   r}      s     9 9+ 9r   c                n    V P                    Uu0 uF  qP                  VP                  3kK  	  up# u upi )z9
Get a set of all available icon sizes and color depths.
)r   rR   rS   )r   hs   & r   r#   IcoFile.sizes   s+     .2ZZ8Z!((#Z888s    2c               $    V ^8  d   QhRRRRRR/# )r   r<   ro   rn   
int | boolr   rj   r   )r   s   "r   r   r}      s!      / 
 s r   c                	    \        V P                  4       F1  w  r4WP                  8X  g   K  VR J g   W$P                  8X  g   K/  Vu # 	  ^ # F)	enumerater   rp   rr   )r   r<   rn   r   r   s   &&&  r   getentryindexIcoFile.getentryindex   s9    djj)DAuu}#,#2F * r   c               $    V ^8  d   QhRRRRRR/# )r   r<   ro   rn   r   r   r   r   )r   s   "r   r   r}      s!     9 9_ 9: 9+ 9r   c                B    V P                  V P                  W4      4      # )z
Get an image from the icon
)rX   r   )r   r<   rn   s   &&&r   getimageIcoFile.getimage   s     zz$,,T788r   c                    V ^8  d   QhRRRR/# )r   idxrj   r   r   r   )r   s   "r   r   r}      s     Z Z Z Zr   c                   V P                   V,          pV P                  P                  VP                  4       V P                  P	                  ^4      pV P                  P                  VP                  4       VR,          \
        P                  8X  dC   \
        P                  ! V P                  4      p\        P                  ! VP                  4       V# \        P                  ! V P                  4      p\        P                  ! VP                  4       VP                  ^ ,          \        VP                  ^,          ^,          4      3Vn        VP                  ^ ,          w  rVrx\         P"                  ! VR	VP                  ,           Wx4      VP                  ^ &   VP$                  ^ 8X  d   V P                  P                  V4       V P                  P	                  VP                  ^ ,          VP                  ^,          ,          ^,          4      R,          p	 \        P&                  ! RVP                  V	RR4      p
EMVP                  ^ ,          pV^ ,          ^ 8  d)   V^ VP                  ^ ,          ^ ,          ,
          ,          p\        WP                  ^,          ,          ^,          4      pVP                  VP                  ,           V,
          pV P                  P                  V4       V P                  P	                  V4      p \        P&                  ! RVP                  VRR\        V^,          4      R
34      p
V
'       d#   VP-                  R4      pVP/                  V
4       V#   \(         d    \         P*                  '       d   Rp
 LQh i ; i  \(         d    \         P*                  '       d   Rp
 L{h i ; i)z
Get an image from frame idx
r-   :   N   Lr+   Nr*   z1;IRGBAr6   r7   )r   r   r7   )r   r|   rM   rY   rN   r   r9   PngImageFiler
   _decompression_bomb_checkr<   r	   DibImageFilerj   _sizetiler   rL   rn   
frombuffer
ValueErrorLOAD_TRUNCATED_IMAGESconvertputalpha)r   r   headerdatar   deoaalpha_bytesmaskwtotal_bytesand_mask_offset	mask_datas   &&             r   rX   IcoFile.frame   s   
 Cfmm$xx}}Qfmm$ 8~,,,,,TXX6B++BGG4V 	Q  ,,TXX6B++BGG4 
C
Q$78BHJA!"FRWW,<aCBGGAJ zzR a "hhmmBGGAJ,Ca,GHN ++#$D GGAJFa<rwwqzB//A
 "1wwqz>Q"67"(--&++"="Ko. HHMM+6	 ++!AE
B/D  ZZ'D!	W "  666#	< "  666#	s0   $M3 7N 3 NNN O>OO)r|   r   r   Nr   )
rs   rt   ru   rv   r   r#   r   r   rX   rx   r   r   r   rz   rz      s$    0Nd99Z Zr   rz   c                      ] tR tRtRtRtRtR R lt]R R l4       t	]	P                  R	 R
 l4       t	R R ltR R ltRtR# )IcoImageFilei0  a  
PIL read-only image support for Microsoft Windows .ico files.

By default the largest resolution image in the file will be loaded. This
can be changed by altering the 'size' attribute before calling 'load'.

The info dictionary has a key 'sizes' that is a list of the sizes available
in the icon file.

Handles classic, XP and Vista icon formats.

When saving, PNG compression is used. Support for this was only added in
Windows Vista. If you are unable to view the icon in Windows, convert the
image to "RGBA" mode before saving.

This plugin is a refactored version of Win32IconImagePlugin by Bryan Davis
<casadebender@gmail.com>.
https://code.google.com/archive/p/casadebender/wikis/Win32IconImagePlugin.wiki
ICOzWindows Iconc                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   IcoImageFile.__annotate__H  s      t r   c                	    \        V P                  4      V n        V P                  P                  4       V P                  R &   V P                  P
                  ^ ,          P                  V n        V P                  4        R# )r#   N)	rz   r   icor#   infor   rp   r<   loadr   s   &r   _openIcoImageFile._openH  sN    477#!XX^^-		'HHNN1%))			r   c                   V ^8  d   QhRR/# )r   r   ro   r   )r   s   "r   r   r   O  s      o r   c                	    V P                   # re   )r   r   s   &r   r<   IcoImageFile.sizeN  s    zzr   c                    V ^8  d   QhRRRR/# )r   valuero   r   r   r   )r   s   "r   r   r   S  s      / d r   c                	Z    WP                   R ,          9  d   Rp\        V4      hWn        R# )r#   z2This is not one of the allowed sizes of this imageN)r   r   r   )r   r   r   s   && r   r<   r   R  s%    		'**FCS/!
r   c                   V ^8  d   QhRR/# )r   r   zImage.core.PixelAccess | Noner   )r   s   "r   r   r   Y  s     & &3 &r   c                	*   V P                   eE   V P                  P                  V P                  8X  d    \        P                  P	                  V 4      # V P
                  P                  V P                  4      pVP	                  4        VP                  V n        VP                  V n        VP                  '       d   VP                  V n	        VP                  V P                  8w  d   \        P                  ! R4       V P
                  P                  V P                  4      p\        V P                  R,          4      pVP                  W2&   \        V4      V P                  R&   VP                  V n        \        P                  P	                  V 4      # )NzImage was not the expected sizer#   )_imr   r<   r
   r   r   r   rA   _modepalettewarningswarnr   listr   r>   )r   r   indexr#   s   &   r   r   IcoImageFile.loadY  s   88DGGLLDII$=;;##D))XXtyy)
	%%WW
:::::DL77diiMM;<HH**4995E7+,E77EL!$UDIIgDI{{%%r   c                    V ^8  d   QhRRRR/# )r   posrj   r   r   r   )r   s   "r   r   r   o  s      S T r   c                	    R # re   r   )r   r   s   &&r   	load_seekIcoImageFile.load_seeko  s     	r   )r   r   r   r   r   r<   N)rs   rt   ru   rv   __doc__r   format_descriptionr   propertyr<   setterr   r   rx   r   r   r   r   r   0  sT    ( F'   
[[ &, r   r   z.icozimage/x-icon)%
__future__r   r   ior   mathr   r   typingr   r    r	   r
   r   r   _binaryr   r   r   r   r   r   rF   r   rO   r9   rK   rg   ri   rz   r   register_openr   register_saveregister_extensionregister_mimer   r   r   <module>r      s   . #    ! > > ! !  ! !
 
JZ% _ _LB9&& BR   L''w ?   L'' /   ,,f 5   L'' 8r   