o
    ci                     @   s  d dl Zd dlZd dlmZ d dlmZ d dlmZ e	dZ
e
r&e
d ejdd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erbed 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_warnings)is_wasmzmatplotlib.pyplotAggT)autousec                   C   s   t   d S )N)r   reset_plugins r   r   j/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/skimage/io/tests/test_mpl_imshow.py_reset_plugins   s   r
   @               i  
   )z'tight_layout : falling back to Agg|\A\Zznp.asscalar|\A\Zz+The figure layout has changed to tight|\A\ZzDis deprecated since version 0.25.* Please use .* to visualize imagesz-Use imageio or a similar package instead|\A\ZzUPickle, copy, and deepcopy support will be removed from itertools in Python 3.14|\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 tt} W d    n1 sw   Y  | jjdks%J | 	 dks-J t
| dks5J | jd u s<J d S )Ngray)r   r      )pltfigurer   imshow_expected_warningsr   imshowim8cmapnameget_climr   colorbarr   r   r   r	   
test_uint8B      
r#   c                  C   r   )Nr   )r   i  r   )r   r   r   r   r   r   im16r   r    r!   r   r"   r   r   r   r	   test_uint16L   r$   r&   c                  C   r   )Nr   )r   r   r   )r   r   r   r   r   r   imfr   r    r!   r   r"   r   r   r   r	   
test_floatV   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)	r   r   r   r   im_lor!   minmaxr"   r   r   r   r	   test_low_data_range`   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   )r   r   r   r   r   r   im_hir!   r+   r,   r   r"   r   r   r   r	   test_outside_standard_rangeh      r1   c                  C   r.   )Nr)   r/   )r   r   r   r   r   r   im64r!   r+   r,   r   r"   r   r   r   r	   test_nonstandard_typeq   r2   r4   c                  C   s   t   tddgddgg} tt t| }W d    n1 s#w   Y  | dks0J t	|dks8J |j
d us?J d S )N      gɿg?g?)r5   g      ?r/   )r   r   nparrayr   r   r   r   r!   r   r"   )	im_signedr   r   r   r	   test_signed_imagez   s   
r9   )#numpyr6   pytestskimager   skimage._shared._warningsr   "skimage._shared._dependency_checksr   importorskipr   switch_backendfixturer
   r7   uint8r   astypeuint16r%   uint64r3   r'   r*   r0   r   appendr   r#   r&   r(   r-   r1   r4   r9   r   r   r   r	   <module>   s:    







		