o
    h                     @   s   d dl Zd dlZd dlmZ d dlmZ edZdd Z	e
d dgdd	ggejZeejd
 ZeejZed Zed Zed Zg dZdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )    N)io)expected_warningszmatplotlib.pyplotc                   C   s   t   d S )N)r   reset_plugins r   r   [/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/io/tests/test_mpl_imshow.pysetup
   s   r   @               i  
   )z'tight_layout : falling back to Agg|\A\Zz&tight_layout: falling back to Agg|\A\Zznp.asscalar|\A\Zz+The figure layout has changed to tight|\A\Zc                 C   s   t |   S )a  Return the number of subplots in the figure containing an ``AxesImage``.

    Parameters
    ----------
    ax_im : matplotlib.pyplot.AxesImage object
        The input ``AxesImage``.

    Returns
    -------
    n : int
        The number of subplots in the corresponding figure.

    Notes
    -----
    This function is intended to check whether a colorbar was drawn, in
    which case two subplots are expected. For standard imshows, one
    subplot is expected.
    )len
get_figureget_axesax_imr   r   r   
n_subplots!   s   r   c                  C      t   ttdg  tt} W d    n1 sw   Y  | jjdks(J | 	 dks0J t
| dks8J | jd u s?J d S )NCObject type is marked|\A\Zgray)r   r      )pltfigurer   imshow_expected_warningsr   imshowim8cmapnameget_climr   colorbarr   r   r   r   
test_uint87      r!   c                  C   r   )Nr   r   )r   i  r   )r   r   r   r   r   r   im16r   r   r   r   r    r   r   r   r   test_uint16B   r"   r$   c                  C   r   )Nr   r   )r   r   r   )r   r   r   r   r   r   imfr   r   r   r   r    r   r   r   r   
test_floatM   r"   r&   c                  C   sf   t tdg  tt} W d    n1 sw   Y  |  t t fks*J | jd us1J d S )N+Low image data range|CObject type is marked)	r   r   r   r   im_lor   minmaxr    r   r   r   r   test_low_data_rangeX   s   r+   c                  C   ~   t   ttdg  tt} W d    n1 sw   Y  |  t t	 fks.J t
| dks6J | jd us=J d S )Nz,out of standard range|CObject type is marked   )r   r   r   r   r   r   im_hir   r)   r*   r   r    r   r   r   r   test_outside_standard_rangea      r/   c                  C   r,   )Nr'   r-   )r   r   r   r   r   r   im64r   r)   r*   r   r    r   r   r   r   test_nonstandard_typeo   r0   r2   c                  C   s   t   tddgddgg} ttdg  t| }W d    n1 s&w   Y  | dks3J t	|dks;J |j
d usBJ d S )N      gɿg?g?r   )r3   g      ?r-   )r   r   nparrayr   r   r   r   r   r   r    )	im_signedr   r   r   r   test_signed_image}   s   r7   )numpyr4   pytestskimager   skimage._shared._warningsr   importorskipr   r   r5   uint8r   astypeuint16r#   uint64r1   r%   r(   r.   r   r   r!   r$   r&   r+   r/   r2   r7   r   r   r   r   <module>   s*    
	