| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/PIL/__pycache__/ |
Upload File : |
a
h�a: � @ s G d d� d�Z ddd�ZdS )c @ s0 e Zd ZdZdd� 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.
c C s, t |d�std��|| _t| jdd�| _d S )N�seekzim must have seek methodZ
_min_frame� )�hasattr�AttributeError�im�getattr�position)�selfr � r
�5/usr/lib/python3.9/site-packages/PIL/ImageSequence.py�__init__ s
zIterator.__init__c
C sD z| j �|� | j W S ty> } zt|�W Y d }~n
d }~0 0 d S �N)r r �EOFError�
IndexError)r Zix�er
r
r �__getitem__% s
zIterator.__getitem__c C s | S r
r
)r r
r
r �__iter__, s zIterator.__iter__c
C sT z$| j �| j� | jd7 _| j W S tyN } zt|�W Y d }~n
d }~0 0 d S )N� )r r r r �
StopIteration)r r r
r
r �__next__/ s zIterator.__next__N)�__name__�
__module__�__qualname__�__doc__r r r r r
r
r
r r s
r Nc s` 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.
c S s g | ]}|� � �qS r
)�copy)�.0Zim_framer
r
r �
<listcomp>H � zall_frames.<locals>.<listcomp>c s g | ]}� |��qS r
r
)r r ��funcr
r r K r )�
isinstance�list�tellr r )r r ZimsZ
imSequence�currentr
r r �
all_frames8 s
r$ )N)r r$ r
r
r
r �<module> s %