HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/PIL/__pycache__/ImageSequence.cpython-38.pyc
U

g�
^"�@sGdd�d�Zddd�ZdS)c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�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.
    cCs,t|d�std��||_t|jdd�|_dS)N�seekzim must have seek methodZ
_min_frame�)�hasattr�AttributeError�im�getattr�position)�selfr�r
�3/usr/lib/python3/dist-packages/PIL/ImageSequence.py�__init__s
zIterator.__init__cCs2z|j�|�|jWStk
r,t�YnXdS�N)rr�EOFError�
IndexError)r	Zixr
r
r�__getitem__%s
zIterator.__getitem__cCs|Sr
r
�r	r
r
r�__iter__,szIterator.__iter__cCsBz$|j�|j�|jd7_|jWStk
r<t�YnXdS)N�)rrrr�
StopIterationrr
r
r�__next__/szIterator.__next__N)�__name__�
__module__�__qualname__�__doc__rrrrr
r
r
rrs
rNcs`t|t�s|g}g}|D],}|��}|dd�t|�D�7}|�|�q�r\�fdd�|D�S|S)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.
    cSsg|]}|���qSr
)�copy)�.0Zim_framer
r
r�
<listcomp>Hszall_frames.<locals>.<listcomp>csg|]}�|��qSr
r
)rr��funcr
rrKs)�
isinstance�list�tellrr)rrZimsZ
imSequenceZcurrentr
rr�
all_frames8s	
r")N)rr"r
r
r
r�<module>s%