
    a6do                     P   d dl Zd dlZd dlmZ d dlmZ  ej        d          Zd Z	 ej
        d dgddggej                  Ze                    ej                  d	z  Ze                    ej                  Zed
z  Zedz  Zedz   Zg dZd Zd Zd Zd Zd Zd Zd Zd ZdS )    N)io)expected_warningszmatplotlib.pyplotc                  ,    t          j                     d S )N)r   reset_plugins     @lib/python3.11/site-packages/skimage/io/tests/test_mpl_imshow.pysetupr
   
   s    r   @               i  
   )z'tight_layout : falling back to Agg|\A\Zz&tight_layout: falling back to Agg|\A\Zznp.asscalar|\A\Zc                 h    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_ims    r	   
n_subplotsr       s*    & u!!**,,---r   c                  ^   t                                            t          t          dgz             5  t	          j        t                    } d d d            n# 1 swxY w Y   | j        j        dk    sJ | 	                                dk    sJ t          |           dk    sJ | j        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   s    r	   
test_uint8r%   6   s    JJLLL	3:;< 
= 
=  	#               :?f$$$$>>x''''e!!!!>!!!!!   AAAc                  ^   t                                            t          t          dgz             5  t	          j        t                    } d d d            n# 1 swxY w Y   | j        j        dk    sJ | 	                                dk    sJ t          |           dk    sJ | j        J d S )Nr   r   )r   i  r   )r   r   r   r   r   r   im16r!   r"   r#   r   r$   r   s    r	   test_uint16r)   A   s    JJLLL	3:;< 
= 
=    	$                              :?f$$$$>>z))))e!!!!>!!!!!r&   c                  ^   t                                            t          t          dgz             5  t	          j        t                    } d d d            n# 1 swxY w Y   | j        j        dk    sJ | 	                                dk    sJ t          |           dk    sJ | j        J d S )Nr   r   )r   r   r   )r   r   r   r   r   r   imfr!   r"   r#   r   r$   r   s    r	   
test_floatr,   L   s    JJLLL	3:;< 
= 
=  	#               :?f$$$$>>v%%%%e!!!!>!!!!!r&   c                  >   t          t          dgz             5  t          j        t                    } d d d            n# 1 swxY w Y   |                                 t                                          t                                          fk    sJ | j        J d S )N+Low image data range|CObject type is marked)	r   r   r   r   im_lor#   minmaxr$   r   s    r	   test_low_data_ranger2   W   s    	3IJK 
L 
L ! !	%  ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! >>		UYY[[99999>%%%%%s   ?AAc                     t                                            t          t          dgz             5  t	          j        t                    } d d d            n# 1 swxY w Y   |                                 t                                          t          	                                fk    sJ t          |           dk    sJ | j        J d S )Nz,out of standard range|CObject type is marked   )r   r   r   r   r   r   im_hir#   r0   r1   r   r$   r   s    r	   test_outside_standard_ranger6   `   s    JJLLL
 
3JKL 
M 
M ! !	%  ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! >>		UYY[[99999e!!!!>%%%%%r&   c                     t                                            t          t          dgz             5  t	          j        t                    } d d d            n# 1 swxY w Y   |                                 t                                          t          	                                fk    sJ t          |           dk    sJ | j        J d S )Nr.   r4   )r   r   r   r   r   r   im64r#   r0   r1   r   r$   r   s    r	   test_nonstandard_typer9   n   s    JJLLL
 
3IJK 
L 
L    	$                              >>

DHHJJ77777e!!!!>%%%%%r&   c                  d   t                                            t          j        ddgddgg          } t	          t
          dgz             5  t          j        |           }d d d            n# 1 swxY w Y   |                                dk    sJ t          |          dk    sJ |j
        J d S )N      gɿg?g?r   )r;   g      ?r4   )r   r   nparrayr   r   r   r   r#   r   r$   )	im_signedr   s     r	   test_signed_imager?   |   s    JJLLL4,c
344I	3:;< 
= 
= % %	)$$% % % % % % % % % % % % % % % >>{****e!!!!>%%%%%s   A--A14A1)numpyr<   pytestskimager   skimage._shared._warningsr   importorskipr   r
   r=   uint8r    astypeuint16r(   uint64r8   r+   r/   r5   r   r   r%   r)   r,   r2   r6   r9   r?   r   r   r	   <module>rI      s^              7 7 7 7 7 7f-..  
 bhB#s$bh//
zz")s"
zz")	Cid
b   . . .," " "" " "" " "& & && & && & &	& 	& 	& 	& 	&r   