o
    Z#ûaû  ã                   @   sŽ   d Z ddlmZmZ dd„ Zdd„ Zddd„Zdd	d
„Zddd„Zddd„Z	ddd„Z
ddd„Zddd„Zdd„ Zdd„ Zdd„ Zdd„ ZdS )z%Binary input/output support routines.é    )ÚpackÚunpack_fromc                 C   s   | j tu r| S | d S )Nr   )Ú	__class__Úint)Úc© r   ú-/usr/lib/python3/dist-packages/PIL/_binary.pyÚi8   s   r	   c                 C   s   t | d@ fƒS )Néÿ   )Úbytes©Úir   r   r   Úo8   s   r   c                 C   ó   t d| |ƒd S )zª
    Converts a 2-bytes (16 bits) string to an unsigned integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    ú<Hr   ©r   ©r   Úor   r   r   Úi16le   ó   r   c                 C   r   )z§
    Converts a 2-bytes (16 bits) string to a signed integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    z<hr   r   r   r   r   r   Úsi16le(   r   r   c                 C   r   )z³
    Converts a 2-bytes (16 bits) string to a signed integer, big endian.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    z>hr   r   r   r   r   r   Úsi16be2   r   r   c                 C   r   )zª
    Converts a 4-bytes (32 bits) string to an unsigned integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    ú<Ir   r   r   r   r   r   Úi32le<   r   r   c                 C   r   )z§
    Converts a 4-bytes (32 bits) string to a signed integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    z<ir   r   r   r   r   r   Úsi32leF   r   r   c                 C   r   )Nú>Hr   r   r   r   r   r   Úi16beP   ó   r   c                 C   r   )Nú>Ir   r   r   r   r   r   Úi32beT   r   r   c                 C   ó
   t d| ƒS )Nr   ©r   r   r   r   r   Úo16leY   ó   
r"   c                 C   r    )Nr   r!   r   r   r   r   Úo32le]   r#   r$   c                 C   r    )Nr   r!   r   r   r   r   Úo16bea   r#   r%   c                 C   r    )Nr   r!   r   r   r   r   Úo32bee   r#   r&   N)r   )Ú__doc__Ústructr   r   r	   r   r   r   r   r   r   r   r   r"   r$   r%   r&   r   r   r   r   Ú<module>   s   











