o
    Õj  ã                   @   sf   d dl mZ d dlmZ d dlZd dlmZ d dlmZm	Z
 edgddd	d
„ ƒZdd„ Zdd„ ZdS )é    )ÚBytesIO)ÚPathN)Úimage_comparison)ÚcmÚpyplotzpngsuite.pngg{®Gáz¤?)Ztolc                  C   s¢   t ttƒjd  d¡ƒ} tjt| ƒdfd t| ƒD ]"\}}t 	|¡}d }|j
dkr-tj}tj|||d ddf|dd qt ¡ j d	¡ t ¡  dt| ƒ¡ d S )
Nzbaseline_images/pngsuitez	basn*.pngé   )Zfigsizeé   r   Údata)ZextentÚcmapZinterpolation_stagez#ddffff)Úsortedr   Ú__file__ÚparentÚglobÚpltZfigureÚlenÚ	enumerateÚimreadÚndimr   ÚgrayZimshowZgcaÚpatchZset_facecolorZset_xlim)ÚfilesÚiÚfnamer	   r
   © r   úZ/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/matplotlib/tests/test_png.pyÚtest_pngsuite
   s   ÿ

ÿr   c                 C   sÂ   | d }| d }t  |¡ t|dƒ}| ¡ }W d   ƒ n1 s!w   Y  t|dƒ}| |d d… ¡ W d   ƒ n1 s?w   Y  t t¡ t  |¡ W d   ƒ d S 1 sZw   Y  d S )Nztest.pngztest_truncated.pngÚrbÚwbé   )	r   ÚsavefigÚopenÚreadÚwriteÚpytestÚraisesÚ	Exceptionr   )Ztmp_pathÚpathZpath_tZfinÚbufZfoutr   r   r   Útest_truncated_file    s   

ÿÿ"ÿr(   c                  C   sl   t ƒ } t | ¡ |  d¡ t |  d¡ƒ}| d¡ t t¡ t |¡ W d   ƒ d S 1 s/w   Y  d S )Nr   r   )	r   r   r   Úseekr!   r#   r$   r%   r   )ÚbÚb2r   r   r   Útest_truncated_buffer-   s   


"ÿr,   )Úior   Úpathlibr   r#   Zmatplotlib.testing.decoratorsr   Z
matplotlibr   r   r   r   r(   r,   r   r   r   r   Ú<module>   s    
