Ë
    /æj	  ã                  óf   — d dl mZ dZerd dlmZ d dlmZ ddlmZ  G d„ d«      Z		 d	 	 	 	 	 dd
„Z
y	)é    )ÚannotationsF)ÚCallable)ÚSelfé   )ÚImagec                  ó0   — e Zd ZdZdd„Zdd„Zd	d„Zd
d„Zy)Ú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        | j                  dd«      | _        y )NÚseekzim must have seek methodÚ
_min_framer   )ÚhasattrÚAttributeErrorÚimÚgetattrÚposition)Úselfr   Úmsgs      úT/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/PIL/ImageSequence.pyÚ__init__zIterator.__init__'   s7   € Ü�r˜6Ô"Ø,ˆCÜ  Ó%Ð%ØˆŒÜ §¡¨°qÓ9ˆ�ó    c                ó�   — 	 | j                   j                  |«       | j                   S # t        $ r}d}t        |«      |‚d }~ww xY w)Núend of sequence)r   r   ÚEOFErrorÚ
IndexError)r   ÚixÚer   s       r   Ú__getitem__zIterator.__getitem__.   sA   € ð	)Ø�G‰G�L‰L˜ÔØ—7‘7ˆNøÜò 	)Ø#ˆCÜ˜S“/ qÐ(ûð	)ús   ‚&) ©	A²A Á Ac                ó   — | S ©N© )r   s    r   Ú__iter__zIterator.__iter__6   s   € Øˆr   c                óÎ   — 	 | j                   j                  | j                  «       | xj                  dz  c_        | j                   S # t        $ r}d}t	        |«      |‚d }~ww xY w)Nr   r   )r   r   r   r   ÚStopIteration)r   r   r   s      r   Ú__next__zIterator.__next__9   sT   € ð	,Ø�G‰G�L‰L˜Ÿ™Ô'Ø�MŠM˜QÑ�MØ—7‘7ˆNøÜò 	,Ø#ˆCÜ Ó$¨!Ð+ûð	,ús   ‚AA Á	A$ÁAÁA$N)r   úImage.ImageÚreturnÚNone)r   Úintr&   r%   )r&   r   )r&   r%   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r!   r$   r    r   r   r	   r	      s   „ ñ	ó:ó)óô,r   r	   Nc                óF  — t        | t        «      s| g} g }| D ]N  }|j                  «       }	 |t        |«      D �cg c]  }|j	                  «       ‘Œ c}z  }|j                  |«       ŒP |r|D � cg c]
  }  || «      ‘Œ c} S |S c c}w # |j                  |«       w xY wc c} 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_framesr7   C   sš   € ô �bœ$ÔØˆTˆà
€CØò %ˆ
Ø—/‘/Ó#ˆð	%Ø´H¸ZÓ4HÖI¨�H—M‘M•OÒIÑIˆCà�O‰O˜GÕ$ð%ñ (,˜sÖ#˜‰D��HÒ#Ð4°Ð4ùò Jøà�O‰O˜GÕ$üÚ#s"   ¬BºBÁBÁ/BÂBÂBr   )r   zImage.Image | list[Image.Image]r2   z+Callable[[Image.Image], Image.Image] | Noner&   zlist[Image.Image])Ú
__future__r   ÚTYPE_CHECKINGÚcollections.abcr   Útypingr   Ú r   r	   r7   r    r   r   ú<module>r=      sJ   ðõ" #à€ÙÝ(Ýå÷%,ñ %,ðT 9=ð5Ø'ð5à
5ð5ð ô5r   