+
    ^eòj‹(  ã                   óþ   € ^RI HtHtHt ^RIHt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 R]4      t ! R R]4      tR# )é   )Ú	MIME_TYPEÚTIFF_FLDÚTIFF_TAG)Ú
BIG_ENDIANÚLITTLE_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# )ÚTiffzXImage header parser for TIFF images.

Handles both big and little endian byte ordering.
c                ó"   € \         P                  # )zSReturn the MIME type of this TIFF image, unconditionally the string
``image/tiff``.)r   ÚTIFF©Úselfs   &Ú†/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/docx/image/tiff.pyÚcontent_typeÚTiff.content_type   s   € ô �~‰~Ðó    c                ó   € R# )z:Default filename extension, always 'tiff' for TIFF images.Útiff© r   s   &r   Údefault_extÚTiff.default_ext   s   € ñ r   c                óž   € \         P                  V4      pVP                  pVP                  pVP                  pVP
                  pV ! W4WV4      # )zQReturn a |Tiff| instance containing the properties of the TIFF image in
`stream`.)Ú_TiffParserÚparseÚpx_widthÚ	px_heightÚhorz_dpiÚvert_dpi)ÚclsÚstreamÚparserr   r   r   r   s   &&     r   Úfrom_streamÚTiff.from_stream   sG   € ô ×"Ñ" 6Ó*ˆà—?‘?ˆØ×$Ñ$ˆ	Ø—?‘?ˆØ—?‘?ˆá�8¨Ó;Ð;r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úpropertyr   r   Úclassmethodr#   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      sF   ø‡ € ñð
 ñó ðð
 ñó ðð ñ
<ó ö
<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]R
 4       tRtVtV ;t# )r   zgParses a TIFF image stream to extract the image properties found in its main
image file directory (IFD)c                ó8   <€ \         \        V `  4        Wn        R # ©N)Úsuperr   Ú__init__Ú_ifd_entries)r   Úifd_entriesÚ	__class__s   &&€r   r4   Ú_TiffParser.__init__)   s   ø€ ÜŒk˜4Ñ)Ô+Ø'Ör   c                ó€   € V P                  V4      pVP                  ^4      p\        P                  W#4      pV ! V4      # )zeReturn an instance of |_TiffParser| containing the properties parsed from the
TIFF image in `stream`.)Ú_make_stream_readerÚ	read_longÚ_IfdEntriesr#   )r    r!   Ú
stream_rdrÚifd0_offsetr6   s   &&   r   r   Ú_TiffParser.parse-   s?   € ð ×,Ñ,¨VÓ4ˆ
Ø ×*Ñ*¨1Ó-ˆÜ!×-Ñ-¨jÓFˆÙ�;ÓÐr   c                ó@   € V P                  \        P                  4      # )z”The horizontal dots per inch value calculated from the XResolution and
ResolutionUnit tags of the IFD; defaults to 72 if those tags are not present.)Ú_dpir   ÚX_RESOLUTIONr   s   &r   r   Ú_TiffParser.horz_dpi6   ó   € ð �y‰yœ×.Ñ.Ó/Ð/r   c                ó@   € V P                  \        P                  4      # )z’The vertical dots per inch value calculated from the XResolution and
ResolutionUnit tags of the IFD; defaults to 72 if those tags are not present.)rA   r   ÚY_RESOLUTIONr   s   &r   r   Ú_TiffParser.vert_dpi<   rD   r   c                óT   € V P                   P                  \        P                  4      # )z¢The number of stacked rows of pixels in the image, |None| if the IFD contains
no ``ImageLength`` tag, the expected case when the TIFF is embeded in an Exif
image.)r5   Úgetr   ÚIMAGE_LENGTHr   s   &r   r   Ú_TiffParser.px_heightB   s!   € ð
 × Ñ ×$Ñ$¤X×%:Ñ%:Ó;Ð;r   c                óT   € V P                   P                  \        P                  4      # )z�The number of pixels in each row in the image, |None| if the IFD contains no
``ImageWidth`` tag, the expected case when the TIFF is embeded in an Exif
image.)r5   rI   r   ÚIMAGE_WIDTHr   s   &r   r   Ú_TiffParser.px_widthI   s!   € ð
 × Ñ ×$Ñ$¤X×%9Ñ%9Ó:Ð:r   c                ól   € VP                  ^ 4       VP                  ^4      pVR8X  d   \        # \        # )zƒReturn either BIG_ENDIAN or LITTLE_ENDIAN depending on the endian indicator
found in the TIFF `stream` header, either 'MM' or 'II'.s   MM)ÚseekÚreadr   r   )r    r!   Ú
endian_strs   && r   Ú_detect_endianÚ_TiffParser._detect_endianP   s.   € ð 	�‰�AŒØ—[‘[ “^ˆ
Ø'¨5Ô0ŒzÐC´mÐCr   c                óÖ   € V P                   pW9  d   ^H# VP                  \        P                  ^4      pV^8X  d   ^H# V^8X  d   ^MRpW!,          p\	        \        WT,          4      4      # )a  Return the dpi value calculated for `resolution_tag`, which can be either
TIFF_TAG.X_RESOLUTION or TIFF_TAG.Y_RESOLUTION.

The calculation is based on the values of both that tag and the
TIFF_TAG.RESOLUTION_UNIT tag in this parser's |_IfdEntries| instance.
gR¸…ëQ@)r5   rI   r   ÚRESOLUTION_UNITÚintÚround)r   Úresolution_tagr6   Úresolution_unitÚunits_per_inchÚdots_per_units   &&    r   rA   Ú_TiffParser._dpiX   sd   € ð ×'Ñ'ˆàÔ,Ùð &Ÿ/™/¬(×*BÑ*BÀAÓFˆà˜aÔÙà-°Ô2™¸ˆØ#Õ3ˆÜ”5˜Õ7Ó8Ó9Ð9r   c                ó:   € V P                  V4      p\        W4      # )z•Return a |StreamReader| instance with wrapping `stream` and having "endian-
ness" determined by the 'MM' or 'II' indicator in the TIFF stream header.)rS   r   )r    r!   Úendians   && r   r:   Ú_TiffParser._make_stream_readern   s   € ð ×#Ñ# FÓ+ˆÜ˜FÓ+Ð+r   )r5   )r%   r&   r'   r(   r)   r4   r+   r   r*   r   r   r   r   rS   rA   r:   r,   r-   Ú__classcell__©r7   r/   s   @@r   r   r   %   s§   ù‡ € ñ"õ(ð ñ ó ð ð ñ0ó ð0ð
 ñ0ó ð0ð
 ñ<ó ð<ð ñ;ó ð;ð ñDó ðDò:ð, ñ,ó ÷,ð ,r   r   c                   ó\   a a€ ] tR t^vt oRtV 3R ltR tR t]R 4       t	RR lt
RtVtV ;t# )	r<   zyImage File Directory for a TIFF image, having mapping (dict) semantics allowing
"tag" values to be retrieved by tag code.c                ó8   <€ \         \        V `  4        Wn        R # r2   )r3   r<   r4   Ú_entries)r   Úentriesr7   s   &&€r   r4   Ú_IfdEntries.__init__z   s   ø€ ÜŒk˜4Ñ)Ô+ØŽr   c                ó8   € V P                   P                  V4      # )z5Provides ``in`` operator, e.g. ``tag in ifd_entries``)re   Ú__contains__©r   Úkeys   &&r   ri   Ú_IfdEntries.__contains__~   s   € à�}‰}×)Ñ)¨#Ó.Ð.r   c                ó8   € V P                   P                  V4      # )zCProvides indexed access, e.g. ``tag_value = ifd_entries[tag_code]``)re   Ú__getitem__rj   s   &&r   rn   Ú_IfdEntries.__getitem__‚   s   € à�}‰}×(Ñ(¨Ó-Ð-r   c                ó˜   € \        W4      pVP                  4        Uu/ uF  qDP                  VP                  bK  	  ppV ! V4      # u upi )zNReturn a new |_IfdEntries| instance parsed from `stream` starting at
`offset`.)Ú
_IfdParserÚiter_entriesÚtagÚvalue)r    r!   ÚoffsetÚ
ifd_parserÚerf   s   &&&   r   r#   Ú_IfdEntries.from_stream†   sG   € ô   Ó/ˆ
Ø+5×+BÑ+BÔ+DÓEÑ+D a—5‘5˜!Ÿ'™'’>Ñ+DˆÐEÙ�7‹|Ðùò Fs   žAc                ó8   € V P                   P                  W4      # )z`Return value of IFD entry having tag matching `tag_code`, or `default` if no
matching tag found.)re   rI   )r   Útag_codeÚdefaults   &&&r   rI   Ú_IfdEntries.getŽ   s   € ð �}‰}× Ñ  Ó3Ð3r   )re   r2   )r%   r&   r'   r(   r)   r4   ri   rn   r+   r#   rI   r,   r-   ra   rb   s   @@r   r<   r<   v   s7   ù‡ € ñ1õ ò/ò.ð ñó ð÷4ô 4r   r<   c                   óL   a a€ ] tR t^”t oRtV 3R ltR t]R 4       tRt	Vt
V ;t# )rq   z]Service object that knows how to extract directory entries from an Image File
Directory (IFD)c                óD   <€ \         \        V `  4        Wn        W n        R # r2   )r3   rq   r4   Ú_stream_rdrÚ_offset)r   r=   ru   r7   s   &&&€r   r4   Ú_IfdParser.__init__˜   s   ø€ ÜŒj˜$Ñ(Ô*Ø%ÔØŽr   c              #  ó¼   "  € \        V P                  4       F>  pV P                  ^,           V^,          ,           p\        V P                  V4      pVx € K@  	  R# 5i)zNGenerate an |_IfdEntry| instance corresponding to each entry in the
directory.N)ÚrangeÚ_entry_countr€   Ú_IfdEntryFactoryr   )r   ÚidxÚdir_entry_offsetÚ	ifd_entrys   &   r   rr   Ú_IfdParser.iter_entries�   sL   é € ô ˜×*Ñ*Ö+ˆCØ#Ÿ|™|¨aÕ/°3¸µ8Õ<ÐÜ(¨×)9Ñ)9Ð;KÓLˆIØŒOó ,ùs   ‚AAc                óL   € V P                   P                  V P                  4      # )zDThe count of directory entries, read from the top of the IFD header.)r   Ú
read_shortr€   r   s   &r   r„   Ú_IfdParser._entry_count¥   s   € ð ×Ñ×*Ñ*¨4¯<©<Ó8Ð8r   )r€   r   )r%   r&   r'   r(   r)   r4   rr   r*   r„   r,   r-   ra   rb   s   @@r   rq   rq   ”   s-   ù‡ € ñõò
ð ñ9ó ÷9ð 9r   rq   c                ó  € \         P                  \        \         P                  \        \         P
                  \        \         P                  \        /pV P                  V^4      pVP                  V\        4      pVP                  W4      # )zpReturn an |_IfdEntry| subclass instance containing the value of the directory
entry at `offset` in `stream_rdr`.)r   ÚASCIIÚ_AsciiIfdEntryÚSHORTÚ_ShortIfdEntryÚLONGÚ_LongIfdEntryÚRATIONALÚ_RationalIfdEntryr‹   rI   Ú	_IfdEntryr#   )r=   ru   Úifd_entry_classesÚ
field_typeÚEntryClss   &&   r   r…   r…   «   sj   € ô 	�‰œÜ�‰œÜ�‰”}Ü×ÑÔ,ð	Ðð ×&Ñ& v¨qÓ1€JØ ×$Ñ$ Z´Ó;€HØ×Ñ 
Ó3Ð3r   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–   zkBase class for IFD entry classes.

Subclasses are differentiated by value type, e.g. ASCII, long int, etc.
c                óD   <€ \         \        V `  4        Wn        W n        R # r2   )r3   r–   r4   Ú	_tag_codeÚ_value)r   rz   rt   r7   s   &&&€r   r4   Ú_IfdEntry.__init__¿   s   ø€ ÜŒi˜Ñ'Ô)Ø!ŒØŽr   c                ó¢   € VP                  V^ 4      pVP                  V^4      pVP                  V^4      pV P                  WWE4      pV ! W64      # )a  Return an |_IfdEntry| subclass instance containing the tag and value of the
tag parsed from `stream_rdr` at `offset`.

Note this method is common to all subclasses. Override the ``_parse_value()``
method to provide distinctive behavior based on field type.
)r‹   r;   Ú_parse_value)r    r=   ru   rz   Úvalue_countÚvalue_offsetrt   s   &&&    r   r#   Ú_IfdEntry.from_streamÄ   sW   € ð ×(Ñ(¨°Ó3ˆØ ×*Ñ*¨6°1Ó5ˆØ!×+Ñ+¨F°AÓ6ˆØ× Ñ  °[ÓOˆÙ�8Ó#Ð#r   c                ó   € R# )zoReturn the value of this field parsed from `stream_rdr` at `offset`.

Intended to be overridden by subclasses.
zUNIMPLEMENTED FIELD TYPEr   ©r    r=   ru   r¡   r¢   s   &&&&&r   r    Ú_IfdEntry._parse_valueÒ   s   € ñ *r   c                ó   € V P                   # )z.Short int code that identifies this IFD entry.)rœ   r   s   &r   rs   Ú_IfdEntry.tagÚ   s   € ð �~‰~Ðr   c                ó   € V P                   # )z7Value of this tag, its type being dependent on the tag.)r�   r   s   &r   rt   Ú_IfdEntry.valueß   s   € ð �{‰{Ðr   )rœ   r�   )r%   r&   r'   r(   r)   r4   r+   r#   r    r*   rs   rt   r,   r-   ra   rb   s   @@r   r–   r–   ¹   sd   ù‡ € ñõ
ð
 ñ$ó ð$ð ñ*ó ð*ð ñó ðð ñó ÷ð r   r–   c                   ó4   a € ] tR t^åt o Rt]R 4       tRtV tR# )r�   z<IFD entry having the form of a NULL-terminated ASCII string.c                ó4   € VP                  V^,
          V4      # )z¡Return the ASCII string parsed from `stream_rdr` at `value_offset`.

The length of the string, including a terminating ' ' (NUL) character, is in
`value_count`.
)Úread_strr¥   s   &&&&&r   r    Ú_AsciiIfdEntry._parse_valueè   s   € ð ×"Ñ" ;°¥?°LÓAÐAr   r   N©	r%   r&   r'   r(   r)   r+   r    r,   r-   r.   s   @r   r�   r�   å   s   ø‡ € ÙFàñBó öBr   r�   c                   ó4   a € ] tR t^òt o Rt]R 4       tRtV tR# )r‘   z0IFD entry expressed as a short (2-byte) integer.c                ó8   € V^8X  d   VP                  V^4      # R# )zyReturn the short int value contained in the `value_offset` field of this
entry.

Only supports single values at present.
z)Multi-value short integer NOT IMPLEMENTED)r‹   r¥   s   &&&&&r   r    Ú_ShortIfdEntry._parse_valueõ   s"   € ð ˜!ÔØ×(Ñ(¨°Ó3Ð3á>r   r   Nr¯   r.   s   @r   r‘   r‘   ò   s   ø‡ € Ù:àñ	?ó ö	?r   r‘   c                   ó4   a € ] tR tRt o Rt]R 4       tRtV tR# )r“   i  z/IFD entry expressed as a long (4-byte) integer.c                ó8   € V^8X  d   VP                  V^4      # R# )zxReturn the long int value contained in the `value_offset` field of this
entry.

Only supports single values at present.
z(Multi-value long integer NOT IMPLEMENTED©r;   r¥   s   &&&&&r   r    Ú_LongIfdEntry._parse_value  s"   € ð ˜!ÔØ×'Ñ'¨°Ó2Ð2á=r   r   Nr¯   r.   s   @r   r“   r“     s   ø‡ € Ù9àñ	>ó ö	>r   r“   c                   ó4   a € ] tR tRt o Rt]R 4       tRtV tR# )r•   i  z5IFD entry expressed as a numerator, denominator pair.c                ój   € V^8X  d,   VP                  V4      pVP                  V^4      pWV,          # R# )z›Return the rational (numerator / denominator) value at `value_offset` in
`stream_rdr` as a floating-point number.

Only supports single values at present.
z$Multi-value Rational NOT IMPLEMENTEDrµ   )r    r=   ru   r¡   r¢   Ú	numeratorÚdenominators   &&&&&  r   r    Ú_RationalIfdEntry._parse_value  s:   € ð ˜!ÔØ"×,Ñ,¨\Ó:ˆIØ$×.Ñ.¨|¸QÓ?ˆKØÕ*Ð*á9r   r   Nr¯   r.   s   @r   r•   r•     s   ø‡ € Ù?àñ:ó ö:r   r•   N)Ú	constantsr   r   r   Úhelpersr   r   r   Úimager	   r   r   r<   rq   r…   r–   r�   r‘   r“   r•   r   r   r   Ú<module>r¿      sƒ   ðß 4Ñ 4ß <Ñ <Ý "ô<ˆ?ô <÷>N,ñ N,÷b4ñ 4÷<9ñ 9ò.4÷)ñ )ôX
B�Yô 
Bô?�Yô ?ô >�Iô >ô :˜	ö :r   