o
    Iòh[	  ã                   @  sN   d dl mZ d dlZd dlmZ d dlmZ G dd„ deƒZedd
d„ƒZdS )é    )ÚannotationsN)Ú	lru_cache)Ú
NamedTuplec                   @  sD   e Zd ZU dZded< ded< ded< ded< ded< dd
d„ZdS )ÚModeDescriptorzWrapper for mode strings.ÚstrÚmodeztuple[str, ...]ÚbandsZbasemodeZbasetypeZtypestrÚreturnc                 C  s   | j S )N)r   )Úself© r   ú8/usr/local/lib/python3.10/site-packages/PIL/ImageMode.pyÚ__str__   s   zModeDescriptor.__str__N)r	   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   r   r   r      s   
 r   r   r   r	   c                 C  s   t jdkrdnd}i dd“dd“dddd	|› d
f“dddd|› df“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d!“d"d#“d$d%“}| |v r]||  \}}}}t| ||||ƒS d&d'd&d'd(d)|› d*|› d+d,d-d,d.d/d.d0œ}||  }t| d	dd|ƒS )1z*Gets a mode descriptor for the given mode.Úlittleú<ú>Ú1)ÚLr   )r   z|b1r   )r   r   )r   ú|u1ÚI)r   Úi4ÚF)r   Zf4ÚP)r   r   )r   r   ÚRGB)r   r   )ÚRÚGÚBr   ZRGBX)r   r   )r   r   r    ÚXr   ZRGBA)r   r   )r   r   r    ÚAr   ZCMYK)r   r   )ÚCÚMÚYÚKr   ZYCbCr)r   r   )r%   ZCbZCrr   ZLAB)r   r   )r   r"   r    r   ZHSV)r   r   )ÚHÚSÚVr   ZRGBa)r   r   )r   r   r    Úar   ZLA)r   r   )r   r"   r   ZLa)r   r   )r   r*   r   ZPA)r   r   )r   r"   r   z<u2z<i2z>u2z>i2Úu2Úi2z<u4z>u4z<i4z>i4)zI;16zI;16SzI;16LzI;16LSzI;16BzI;16BSzI;16NzI;16NSzI;32zI;32BzI;32LzI;32SzI;32BSzI;32LS)ÚsysÚ	byteorderr   )r   ZendianÚmodesZ	base_modeZ	base_typer   Ztype_strZmapping_modesr   r   r   Úgetmode#   sl   ýüûúùø	÷
öõôòñïîíìñr0   )r   r   r	   r   )	Ú
__future__r   r-   Ú	functoolsr   Útypingr   r   r0   r   r   r   r   Ú<module>   s   