o $•aAã@sldZddlZddlZddlmZdZdZe dd¡ZdZ d Z d e d ee fd d „Z d e de d dfdd„ZdS)zÀ sphinx.util.png ~~~~~~~~~~~~~~~ PNG image manipulation helpers. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. éN)ÚOptionalé éú!ié s tEXtDepths IEND®B`‚ÚfilenameÚreturncCs‚t|dƒ2}| tt d¡| t¡}| tt¡s$ WdƒdSt  d|dd…¡dWdƒS1s:wYdS)zARead the special tEXt chunk indicating the depth from a PNG file.ÚrbéNréér) ÚopenÚseekÚLEN_IENDÚ LEN_DEPTHÚreadÚ startswithÚDEPTH_CHUNK_LENÚDEPTH_CHUNK_STARTÚstructÚunpack)rÚfÚ depthchunk©rú1/usr/lib/python3/dist-packages/sphinx/util/png.pyÚread_png_depths  û$ùrÚdepthcCsŠt d|¡}t|dƒ0}| t d¡| tt|¡t  t|¡d@}| t d|¡¡| t ¡WdƒdS1s>wYdS)z‰Write the special tEXt chunk indicating the depth to a PNG file. The chunk is placed immediately before the special IEND chunk. rzr+br lÿÿz!IN) rÚpackr rrÚwriterrÚbinasciiÚcrc32Ú IEND_CHUNK)rrÚdatarÚcrcrrrÚwrite_png_depth#s   "÷r$)Ú__doc__rrÚtypingrrrrrrr!ÚstrÚintrr$rrrrÚs