ó ˙gdSc@szdZddlZddlZddlmZdZdZejddƒZedƒZ ed ƒZ d „Z d „Z dS( sŔ sphinx.util.png ~~~~~~~~~~~~~~~ PNG image manipulation helpers. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. i˙˙˙˙N(tbi is!ii t tEXtDeptht IENDŽB`‚cCsƒd}t|dƒ}z\|jtt dƒ|jtƒ}|jttƒsSdSt j d|dd!ƒd}Wd|j ƒX|S(sARead the special tEXt chunk indicating the depth from a PNG file.trbis!iiiiN( tNonetopentseektLEN_IENDt LEN_DEPTHtreadt startswithtDEPTH_CHUNK_LENtDEPTH_CHUNK_STARTtstructtunpacktclose(tfilenametresulttft depthchunk((s9/usr/local/lib/python2.7/site-packages/sphinx/util/png.pytread_png_depths! cCsštjd|ƒ}t|dƒ}zg|jt dƒ|jtt|ƒtj t|ƒd@}|jtjd|ƒƒ|jt ƒWd|j ƒXdS(s‰Write the special tEXt chunk indicating the depth to a PNG file. The chunk is placed immediately before the special IEND chunk. s!isr+biI˙˙˙˙s!IN( R tpackRRRtwriteR R tbinasciitcrc32t IEND_CHUNKR(RtdepthtdataRtcrc((s9/usr/local/lib/python2.7/site-packages/sphinx/util/png.pytwrite_png_depth)s( t__doc__R Rtsphinx.util.pycompatRRRRR R RRR(((s9/usr/local/lib/python2.7/site-packages/sphinx/util/png.pyt s