ó <×ï[c@sýddlZddlmZddlmZmZmZmZddlm Z m Z m Z ddlmZmZdZdZd „Zd „Zd efd „ƒYZd ejfd„ƒYZejejeeƒejejeƒejejdƒdS(iÿÿÿÿN(tBytesIOi(tImaget ImageFiletBmpImagePlugintPngImagePlugin(ti8ti16leti32le(tlogtceils0.1sc s)|jtƒ|jjddddddddgƒ}|j\‰‰t‡‡fd †|ƒ}t|ƒ}|jtjd t |ƒƒƒ|j ƒt |ƒd}x||D]t}|\‰‰|jtjd ˆdkràˆnd ƒƒ|jtjd ˆdkr ˆnd ƒƒ|jd ƒ|jd ƒ|jdƒ|jtjd dƒƒt ƒ}|j ƒ}|j |tjƒ|j|dƒ|jd ƒ|jƒ}t |ƒ} |jtjd| ƒƒ|jtjd|ƒƒ|j ƒ} |j|ƒ|j|ƒ|| }|j| ƒq­WdS(Ntsizesiii i0i@i€icsH|dˆks@|dˆks@|ddks@|ddkrDtStS(Niii(tFalsetTrue(tx(theighttwidth(s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyt.s s       cCsd„|jDƒS(sJ Get a list of all available icon sizes and color depths. cSs$h|]}|d|df’qS(RR((t.0th((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pys Žs (R;(RC((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyR ŠscCsfxVt|jƒD]E\}}||dkr|tksH||dkr|j|ƒSqW|jdƒS(s, Get an image from the icon R6R5i(t enumerateR;R tframe(RCRR4RERJ((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pytgetimages,c CsŽ|j|}|jj|dƒ|jjdƒ}|jj|dƒ|d tjkrotj|jƒ}ntj|jƒ}|j dt |j ddƒf|_ |j d\}}}}|d|j ||f|j d<|d} d} x7tj jƒD]&\} } | | dkr| } PqqWd| kr|jj|ƒ|jj|j d|j ddƒdd d…} tjd |j | d dƒ}nÑ|j d}|ddkrÖ|d|j dd7}n|t |j d|j d| d ƒ}t ||j ddƒ}|jj|ƒ|jj|ƒ}tjd|j |d dt |dƒd fƒ}|jdƒ}|j|ƒ|S(s- Get an image from frame idx R'iiiii iiNtLtrawiÿÿÿÿg @t1s1;ItRGBA(ii(RNiiÿÿÿÿ(R;R:R"R#RRt PngImageFileRt DibImageFileRtintt_sizettiletBIT2MODEtitemsRt frombuffertconverttputalpha(RCtidxtheadertdataR$tdtetotatmodeR4tktvt alpha_bytestmasktwtand_mask_offsett total_bytest mask_data((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyRL™sT '   5   (t__name__t __module__RHR R RMRL(((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyR0Rs 7  t IcoImageFilecBsVeZdZdZdZd„Zed„ƒZejd„ƒZd„Z d„Z RS(s9 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. This plugin is a refactored version of Win32IconImagePlugin by Bryan Davis . https://code.google.com/archive/p/casadebender/wikis/Win32IconImagePlugin.wiki tICOs Windows IconcCsMt|jƒ|_|jjƒ|jd<|jjdd|_|jƒdS(NR iR6(R0R%ticoR tinfoR;Rtload(RC((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyt_openscCs|jS(N(RU(RC((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyR scCs/||jdkr"tdƒ‚n||_dS(NR s2This is not one of the allowed sizes of this image(Rqt ValueErrorRU(RCtvalue((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyRs cCsG|jj|jƒ}|jƒ|j|_|j|_|j|_dS(N(RpRMRRrR$Rc(RCR$((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyRrs    cCsdS(N((RC((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyt load_seeks( RlRmt__doc__tformattformat_descriptionRstpropertyRtsetterRrRv(((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyRnñs  s.ico(RtioRtRRRRt_binaryRRR<RR?tmathRR t __version__RR-R/tobjectR0Rnt register_openRxt register_savetregister_extension(((s2/tmp/pip-build-SKekGm/pillow/PIL/IcoImagePlugin.pyts " & Ÿ4