%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/PIL/__pycache__/ImageSequence.cpython-312.pyc

�

��e���R�ddlmZddlmZddlmZGd�d�Z	d						d
d�Zy)�)�annotations)�Callable�)�Imagec�0�eZdZdZdd�Zdd�Zd	d�Zd
d�Zy)�Iteratora-
    This class implements an iterator object that can be used to loop
    over an image sequence.

    You can use the ``[]`` operator to access elements by index. This operator
    will raise an :py:exc:`IndexError` if you try to access a nonexistent
    frame.

    :param im: An image object.
    c�|�t|d�s
d}t|��||_t|jdd�|_y)N�seekzim must have seek method�
_min_framer)�hasattr�AttributeError�im�getattr�position)�selfr�msgs   �3/usr/lib/python3/dist-packages/PIL/ImageSequence.py�__init__zIterator.__init__$s7���r�6�"�,�C� ��%�%���������q�9��
�c��	|jj|�|jS#t$r}d}t|�|�d}~wwxYw)N�end of sequence)rr
�EOFError�
IndexError)r�ix�ers    r�__getitem__zIterator.__getitem__+sA��	)��G�G�L�L����7�7�N���	)�#�C��S�/�q�(��	)�s�&)�	A�A�Ac��|S�N�)rs r�__iter__zIterator.__iter__3s���rc���	|jj|j�|xjdz
c_|jS#t$r}d}t	|�|�d}~wwxYw)Nrr)rr
rr�
StopIteration)rrrs   r�__next__zIterator.__next__6sT��	,��G�G�L�L����'��M�M�Q��M��7�7�N���	,�#�C���$�!�+��	,�s�AA�	A$�A�A$N)r�Image.Image)r�int�returnr$)r&r)r&r$)�__name__�
__module__�__qualname__�__doc__rrr r#rrrrrs��	�:�)��,rrNc��t|t�s|g}g}|D]M}|j�}|t|�D�cgc]}|j	���c}z
}|j|��O|r|D�cgc]
}||���c}S|Scc}wcc}w)a
    Applies a given function to all frames in an image or a list of images.
    The frames are returned as a list of separate images.

    :param im: An image, or a list of images.
    :param func: The function to apply to all of the image frames.
    :returns: A list of images.
    )�
isinstance�list�tellr�copyr
)r�func�ims�
imSequence�current�im_frames      r�
all_framesr5@s����b�$���T��
�C��!�
��/�/�#�����0D�E�H��
�
��E�E������ �!�(,�s�#��D��H�#�4��4��F��$s�B�.Br)rzImage.Image | list[Image.Image]r0z+Callable[[Image.Image], Image.Image] | Noner&zlist[Image.Image])�
__future__r�typingr�rrr5rrr�<module>r9s?��"#���%,�%,�T9=�5�'�5�
5�5��5r

Zerion Mini Shell 1.0