a
    #Df}                     @   s4   d dl Z d dlZddlmZ dddZd	ddZdS )
    N   )utilsc                 C   s(   t | }t||||||d t |S )a  Draw rectangle on numpy array with Pillow.

    Parameters
    ----------
    src: numpy.ndarray
        Input image.
    aabb1: array-like, (2,)
        Minimum vertex (y_min, x_min) of the axis aligned bounding box (AABB).
    aabb2: array-like, (2,)
        Maximum vertex (y_max, x_max) of the AABB.
    fill: int or array-like, (3,), optional
        RGB color to fill the mark. None for no fill. (default: None)
    outline: int or array-like, (3,), optional
        RGB color to draw the outline.
    width: int, optional
        Rectangle line width. (default: 0)

    Returns
    -------
    dst: numpy.ndarray
        Output image.

    )imgaabb1aabb2filloutlinewidth)r   Znumpy_to_pillow
rectangle_Zpillow_to_numpy)srcr   r   r   r   r	   dst r   b/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/imgviz/draw/rectangle.py	rectangle   s    
r   c                 C   sf   t |tjjrt|}t |tjjr,t|}tj| }|\}}|\}	}
|j|||
|	f|||d d S )N)Zxyr   r   r	   )
isinstancecollectionsabcIterabletuplePILZ	ImageDrawr   )r   r   r   r   r   r	   Zdrawy1x1y2Zx2r   r   r   r
   ,   s    r
   )NNr   )NNr   )r   Z	PIL.Imager    r   r   r
   r   r   r   r   <module>   s   
$