o
    	Ð'fC  ã                   @   s<   d dl mZ d dlmZmZ d dlmZ G dd„ deƒZdS )é   )Ú	MIME_TYPE)ÚLITTLE_ENDIANÚStreamReader)ÚBaseImageHeaderc                   @   s@   e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZe	dd	„ ƒZ
d
S )ÚBmpz#Image header parser for BMP images.c           	      C   sT   t |tƒ}| d¡}| d¡}| d¡}| d¡}|  |¡}|  |¡}| ||||ƒS )z]Return |Bmp| instance having header properties parsed from the BMP image in
        `stream`.é   é   é&   é*   )r   r   Ú	read_longÚ_dpi)	ÚclsÚstreamÚ
stream_rdrÚpx_widthÚ	px_heightÚhorz_px_per_meterÚvert_px_per_meterÚhorz_dpiÚvert_dpi© r   úF/home/ubuntu/flask/venv/lib/python3.10/site-packages/docx/image/bmp.pyÚfrom_stream	   s   






zBmp.from_streamc                 C   s   t jS )zUMIME content type for this image, unconditionally `image/bmp` for BMP
        images.)r   ÚBMP©Úselfr   r   r   Úcontent_type   s   zBmp.content_typec                 C   s   dS )z8Default filename extension, always 'bmp' for BMP images.Úbmpr   r   r   r   r   Údefault_ext    s   zBmp.default_extc                 C   s   | dkrdS t t| d ƒƒS )zkReturn the integer pixels per inch from `px_per_meter`, defaulting to 96 if
        `px_per_meter` is zero.é    é`   g¦
F%uš?)ÚintÚround)Úpx_per_meterr   r   r   r   %   s   zBmp._dpiN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úclassmethodr   Úpropertyr   r   Ústaticmethodr   r   r   r   r   r      s    


r   N)Ú	constantsr   Úhelpersr   r   Úimager   r   r   r   r   r   Ú<module>   s    