+
    ^eòj   ã                   óÖ   € ^RI HtHt ^RIHt ^RIHtHt ^RIH	t	  ! R R]	4      t
 ! R R4      t ! R	 R
4      t ! R R4      tR t ! R R4      t ! R R]4      t ! R R]4      tR# )é   )Ú	MIME_TYPEÚPNG_CHUNK_TYPE)ÚInvalidImageStreamError)Ú
BIG_ENDIANÚStreamReader)ÚBaseImageHeaderc                   óT   a € ] tR t^t o Rt]R 4       t]R 4       t]R 4       t	Rt
V tR# )ÚPngz#Image header parser for PNG images.c                ó"   € \         P                  # )zMMIME content type for this image, unconditionally `image/png` for PNG
images.)r   ÚPNG©Úselfs   &Ú…/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/docx/image/png.pyÚcontent_typeÚPng.content_type
   s   € ô �}‰}Ðó    c                ó   € R# )z8Default filename extension, always 'png' for PNG images.Úpng© r   s   &r   Údefault_extÚPng.default_ext   s   € ñ r   c                óž   € \         P                  V4      pVP                  pVP                  pVP                  pVP
                  pV ! W4WV4      # )zOReturn a |Png| instance having header properties parsed from image in
`stream`.)Ú
_PngParserÚparseÚpx_widthÚ	px_heightÚhorz_dpiÚvert_dpi)ÚclsÚstreamÚparserr   r   r   r   s   &&     r   Úfrom_streamÚPng.from_stream   sG   € ô ×!Ñ! &Ó)ˆà—?‘?ˆØ×$Ñ$ˆ	Ø—?‘?ˆØ—?‘?ˆá�8¨Ó;Ð;r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úpropertyr   r   Úclassmethodr"   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r
   r
      sB   ø‡ € Ù-àñó ðð
 ñó ðð ñ
<ó ö
<r   r
   c                   ó–   a a€ ] tR t^#t oRtV 3R lt]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       t]R 4       tR	tVtV ;t# )
r   zNParses a PNG image stream to extract the image properties found in its chunks.c                ó8   <€ \         \        V `  4        Wn        R # ©N)Úsuperr   Ú__init__Ú_chunks)r   ÚchunksÚ	__class__s   &&€r   r2   Ú_PngParser.__init__&   s   ø€ ÜŒj˜$Ñ(Ô*ØŽr   c                ó<   € \         P                  V4      pV ! V4      # )zfReturn a |_PngParser| instance containing the header properties parsed from
the PNG image in `stream`.)Ú_Chunksr"   )r   r    r4   s   && r   r   Ú_PngParser.parse*   s   € ô ×$Ñ$ VÓ,ˆÙ�6‹{Ðr   c                óF   € V P                   P                  pVP                  # )z.The number of pixels in each row of the image.)r3   ÚIHDRr   ©r   r;   s   & r   r   Ú_PngParser.px_width1   s   € ð �|‰|× Ñ ˆØ�}‰}Ðr   c                óF   € V P                   P                  pVP                  # )z2The number of stacked rows of pixels in the image.)r3   r;   r   r<   s   & r   r   Ú_PngParser.px_height7   s   € ð �|‰|× Ñ ˆØ�~‰~Ðr   c                ó†   € V P                   P                  pVf   ^H# V P                  VP                  VP                  4      # )zwInteger dots per inch for the width of this image.

Defaults to 72 when not present in the file, as is often the case.
)r3   ÚpHYsÚ_dpiÚunits_specifierÚhorz_px_per_unit©r   rA   s   & r   r   Ú_PngParser.horz_dpi=   ó8   € ð �|‰|× Ñ ˆØŠ<ÙØ�y‰y˜×-Ñ-¨t×/DÑ/DÓEÐEr   c                ó†   € V P                   P                  pVf   ^H# V P                  VP                  VP                  4      # )zxInteger dots per inch for the height of this image.

Defaults to 72 when not present in the file, as is often the case.
)r3   rA   rB   rC   Úvert_px_per_unitrE   s   & r   r   Ú_PngParser.vert_dpiH   rG   r   c                óZ   € V ^8X  d$   V'       d   \        \        VR,          4      4      # ^H# )zOReturn dots per inch value calculated from `units_specifier` and
`px_per_unit`.g¦
F%uš?)ÚintÚround)rC   Úpx_per_units   &&r   rB   Ú_PngParser._dpiS   s&   € ð ˜aÔ§KÜ”u˜[¨6Õ1Ó2Ó3Ð3Ùr   ©r3   )r$   r%   r&   r'   r(   r2   r*   r   r)   r   r   r   r   ÚstaticmethodrB   r+   r,   Ú__classcell__©r5   r-   s   @@r   r   r   #   sŽ   ù‡ € ÙXõð ñó ðð ñó ðð
 ñó ðð
 ñFó ðFð ñFó ðFð ñó ÷ð r   r   c                   ól   a a€ ] tR t^\t oRtV 3R lt]R 4       t]R 4       t	]R 4       t
R tRtVtV ;t# )r8   z8Collection of the chunks parsed from a PNG image stream.c                óL   <€ \         \        V `  4        \        V4      V n        R # r0   )r1   r8   r2   Úlistr3   )r   Úchunk_iterabler5   s   &&€r   r2   Ú_Chunks.__init___   s   ø€ ÜŒg�tÑ%Ô'Ü˜NÓ+ˆŽr   c                ón   € \         P                  V4      p\        VP                  4       4      pV ! V4      # )zBReturn a |_Chunks| instance containing the PNG chunks in `stream`.)Ú_ChunkParserr"   rV   Úiter_chunks)r   r    Úchunk_parserr4   s   &&  r   r"   Ú_Chunks.from_streamc   s1   € ô $×/Ñ/°Ó7ˆÜ�l×.Ñ.Ó0Ó1ˆÙ�6‹{Ðr   c                óL   € R pV P                  V4      pVf   \        R4      hV# )zIHDR chunk in PNG image.c                 ó<   € V P                   \        P                  8H  # r0   )Ú	type_namer   r;   ©Úchunks   &r   Ú<lambda>Ú_Chunks.IHDR.<locals>.<lambda>m   ó   € ˜eŸo™o´×1DÑ1DÒDr   zno IHDR chunk in PNG image)Ú_find_firstr   )r   Úmatchr;   s   &  r   r;   Ú_Chunks.IHDRj   s0   € ñ EˆØ×Ñ Ó&ˆØŠ<Ü)Ð*FÓGÐGØˆr   c                ó*   € R pV P                  V4      # )z2PHYs chunk in PNG image, or |None| if not present.c                 ó<   € V P                   \        P                  8H  # r0   )r`   r   rA   ra   s   &r   rc   Ú_Chunks.pHYs.<locals>.<lambda>v   re   r   )rf   )r   rg   s   & r   rA   Ú_Chunks.pHYss   s   € ñ EˆØ×Ñ Ó&Ð&r   c                óP   € V P                    F  pV! V4      '       g   K  Vu # 	  R# )zGReturn first chunk in stream order returning True for function `match`.NrP   )r   rg   rb   s   && r   rf   Ú_Chunks._find_firsty   s#   € à—\”\ˆEÙ�U�|Œ|Ø’ñ "ñ r   rP   )r$   r%   r&   r'   r(   r2   r*   r"   r)   r;   rA   rf   r+   r,   rR   rS   s   @@r   r8   r8   \   sS   ù‡ € ÙBõ,ð ñó ðð ñó ðð ñ'ó ð'÷
ò r   r8   c                   óR   a a€ ] tR t^�t oRtV 3R lt]R 4       tR tR t	Rt
VtV ;t# )rZ   z(Extracts chunks from a PNG image stream.c                ó8   <€ \         \        V `  4        Wn        R # r0   )r1   rZ   r2   Ú_stream_rdr)r   Ú
stream_rdrr5   s   &&€r   r2   Ú_ChunkParser.__init__„   s   ø€ ÜŒl˜DÑ*Ô,Ø%Ör   c                ó2   € \        V\        4      pV ! V4      # )z\Return a |_ChunkParser| instance that can extract the chunks from the PNG
image in `stream`.)r   r   )r   r    rr   s   && r   r"   Ú_ChunkParser.from_streamˆ   s   € ô " &¬*Ó5ˆ
Ù�:‹Ðr   c              #  ót   "  € V P                  4        F  w  r\        WP                  V4      pVx € K!  	  R# 5i)zyGenerate a |_Chunk| subclass instance for each chunk in this parser's PNG
stream, in the order encountered in the stream.N)Ú_iter_chunk_offsetsÚ_ChunkFactoryrq   )r   Ú
chunk_typeÚoffsetrb   s   &   r   r[   Ú_ChunkParser.iter_chunks�   s4   é € ð #'×":Ñ":Ö"<ÑˆJÜ! *×.>Ñ.>ÀÓGˆEØŒKó #=ùs   ‚68c              #  óà   "  € ^p V P                   P                  V4      pV P                   P                  ^V^4      pV^,           pW43x € VR8X  d   R# V^V,           ^,           ,          pKi  5i)z‘Generate a (chunk_type, chunk_offset) 2-tuple for each of the chunks in the
PNG image stream.

Iteration stops after the IEND chunk is returned.
ÚIENDN)rq   Ú	read_longÚread_str)r   Úchunk_offsetÚchunk_data_lenry   Údata_offsets   &    r   rw   Ú _ChunkParser._iter_chunk_offsets–   sq   é € ð ˆØØ!×-Ñ-×7Ñ7¸ÓEˆNØ×)Ñ)×2Ñ2°1°lÀAÓFˆJØ&¨Õ*ˆKØÐ)Ò)Ø˜VÔ#Ùà˜E NÕ2°QÕ6Õ6ŠLùs   ‚A,A.)rq   )r$   r%   r&   r'   r(   r2   r*   r"   r[   rw   r+   r,   rR   rS   s   @@r   rZ   rZ   �   s0   ù‡ € Ù2õ&ð ñó ðò÷7ò 7r   rZ   c                ó¦   € \         P                  \        \         P                  \        /pVP                  V \        4      pVP                  WV4      # )zeReturn a |_Chunk| subclass instance appropriate to `chunk_type` parsed from
`stream_rdr` at `offset`.)r   r;   Ú
_IHDRChunkrA   Ú
_pHYsChunkÚgetÚ_ChunkÚfrom_offset)ry   rr   rz   Úchunk_cls_mapÚ	chunk_clss   &&&  r   rx   rx   ¨   sH   € ô 	×ÑœZÜ×ÑœZð€Mð ×!Ñ! *¬fÓ5€IØ× Ñ  ¸Ó@Ð@r   c                   óV   a a€ ] tR t^³t oRtV 3R lt]R 4       t]R 4       t	Rt
VtV ;t# )rˆ   zMBase class for specific chunk types.

Also serves as the default chunk type.
c                ó8   <€ \         \        V `  4        Wn        R # r0   )r1   rˆ   r2   Ú_chunk_type)r   ry   r5   s   &&€r   r2   Ú_Chunk.__init__¹   s   ø€ ÜŒf�dÑ$Ô&Ø%Ör   c                ó   € V ! V4      # )z@Return a default _Chunk instance that only knows its chunk type.r   )r   ry   rr   rz   s   &&&&r   r‰   Ú_Chunk.from_offset½   s   € ñ �:‹Ðr   c                ó   € V P                   # )z.The chunk type name, e.g. 'IHDR', 'pHYs', etc.©rŽ   r   s   &r   r`   Ú_Chunk.type_nameÂ   s   € ð ×ÑÐr   r“   )r$   r%   r&   r'   r(   r2   r*   r‰   r)   r`   r+   r,   rR   rS   s   @@r   rˆ   rˆ   ³   s<   ù‡ € ñõ
&ð ñó ðð ñ ó ÷ ð  r   rˆ   c                   óf   a a€ ] tR t^Èt oRtV 3R lt]R 4       t]R 4       t	]R 4       t
RtVtV ;t# )r…   z*IHDR chunk, contains the image dimensions.c                óF   <€ \         \        V `  V4       W n        W0n        R # r0   )r1   r…   r2   Ú	_px_widthÚ
_px_height)r   ry   r   r   r5   s   &&&&€r   r2   Ú_IHDRChunk.__init__Ë   s   ø€ ÜŒj˜$Ñ(¨Ô4Ø!ŒØ#Žr   c                óZ   € VP                  V4      pVP                  V^4      pV ! WV4      # )ztReturn an _IHDRChunk instance containing the image dimensions extracted from
the IHDR chunk in `stream` at `offset`.)r~   )r   ry   rr   rz   r   r   s   &&&&  r   r‰   Ú_IHDRChunk.from_offsetÐ   s3   € ð ×'Ñ'¨Ó/ˆØ×(Ñ(¨°Ó3ˆ	Ù�:¨Ó3Ð3r   c                ó   € V P                   # r0   )r—   r   s   &r   r   Ú_IHDRChunk.px_widthØ   s   € à�~‰~Ðr   c                ó   € V P                   # r0   )r˜   r   s   &r   r   Ú_IHDRChunk.px_heightÜ   s   € à�‰Ðr   )r˜   r—   )r$   r%   r&   r'   r(   r2   r*   r‰   r)   r   r   r+   r,   rR   rS   s   @@r   r…   r…   È   sN   ù‡ € Ù4õ$ð
 ñ4ó ð4ð ñó ðð ñó ÷ð r   r…   c                   óv   a a€ ] tR t^át oRtV 3R lt]R 4       t]R 4       t	]R 4       t
]R 4       tRtVtV ;t# )r†   z/PYHs chunk, contains the image dpi information.c                óR   <€ \         \        V `  V4       W n        W0n        W@n        R # r0   )r1   r†   r2   Ú_horz_px_per_unitÚ_vert_px_per_unitÚ_units_specifier)r   ry   rD   rI   rC   r5   s   &&&&&€r   r2   Ú_pHYsChunk.__init__ä   s$   ø€ ÜŒj˜$Ñ(¨Ô4Ø!1ÔØ!1ÔØ /Ör   c                ó~   € VP                  V4      pVP                  V^4      pVP                  V^4      pV ! WWV4      # )zsReturn a _pHYsChunk instance containing the image resolution extracted from
the pHYs chunk in `stream` at `offset`.)r~   Ú	read_byte)r   ry   rr   rz   rD   rI   rC   s   &&&&   r   r‰   Ú_pHYsChunk.from_offsetê   sH   € ð &×/Ñ/°Ó7ÐØ%×/Ñ/°¸Ó:ÐØ$×.Ñ.¨v°qÓ9ˆÙ�:Ð1AÓSÐSr   c                ó   € V P                   # r0   )r¢   r   s   &r   rD   Ú_pHYsChunk.horz_px_per_unitó   ó   € à×%Ñ%Ð%r   c                ó   € V P                   # r0   )r£   r   s   &r   rI   Ú_pHYsChunk.vert_px_per_unit÷   r«   r   c                ó   € V P                   # r0   )r¤   r   s   &r   rC   Ú_pHYsChunk.units_specifierû   s   € à×$Ñ$Ð$r   )r¢   r¤   r£   )r$   r%   r&   r'   r(   r2   r*   r‰   r)   rD   rI   rC   r+   r,   rR   rS   s   @@r   r†   r†   á   sd   ù‡ € Ù9õ0ð ñTó ðTð ñ&ó ð&ð ñ&ó ð&ð ñ%ó ÷%ð %r   r†   N)Ú	constantsr   r   Ú
exceptionsr   Úhelpersr   r   Úimager   r
   r   r8   rZ   rx   rˆ   r…   r†   r   r   r   Ú<module>r´      sf   ðß 0Ý /ß -Ý "ô<ˆ/ô <÷86ñ 6÷r"ñ "÷J$7ñ $7òNA÷ ñ  ô*�ô ô2%�ö %r   