a
    ¦ˆc³  ã                   @   sD   d Z ddlmZmZ ddlmZ G dd„ deƒZG dd„ deƒZdS )	z  The interface for a PIL Image. é    )ÚHasStrictTraitsÚInstance)ÚIImagec                   @   s   e Zd ZdZedƒZdS )Ú	IPILImagez7 The interface for a image that wraps a PIL Image.
    úPIL.Image.ImageN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úimage© r   r   úU/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/i_pil_image.pyr      s   r   c                       s<   e Zd ZdZedƒZ‡ fdd„Zd
dd„Zddd	„Z‡  Z	S )Ú	MPILImagezG The base implementation mixin for a image that wraps a PIL Image.
    r   c                    s   t ƒ jf d|i|¤Ž d S )Nr   )ÚsuperÚ__init__)Úselfr   Ztraits©Ú	__class__r   r   r   $   s    zMPILImage.__init__Nc                 C   s   ddl m} ||  |¡ƒS )a{   Creates a bitmap image for this image.

        Parameters
        ----------
        size : (int, int) or None
            The desired size as a (width, height) tuple, or None if wanting
            default image size.

        Returns
        -------
        image : bitmap
            The toolkit bitmap corresponding to the image and the specified
            size.
        r   )Úimage_to_bitmap)Úpyface.util.image_helpersr   Zcreate_image)r   Úsizer   r   r   r   Úcreate_bitmap'   s    zMPILImage.create_bitmapc                 C   s   ddl m} ||  |¡ƒS )a{   Creates an icon for this image.

        Parameters
        ----------
        size : (int, int) or None
            The desired size as a (width, height) tuple, or None if wanting
            default icon size.

        Returns
        -------
        image : icon
            The toolkit image corresponding to the image and the specified
            size as an icon.
        r   )Úbitmap_to_icon)r   r   r   )r   r   r   r   r   r   Úcreate_icon9   s    zMPILImage.create_icon)N)N)
r   r   r	   r
   r   r   r   r   r   Ú__classcell__r   r   r   r   r      s
   
r   N)r
   Z
traits.apir   r   Zpyface.i_imager   r   r   r   r   r   r   Ú<module>
   s   
