§
    þÜÒjf	  ã                  ód   — 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
d	S )é    )ÚannotationsF)ÚCallable)ÚSelfé   )ÚImagec                  ó2   — e Zd ZdZdd„Zdd	„Zdd„Zdd„Zd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.
    ÚimúImage.ImageÚreturnÚNonec                óŒ   — t          |d¦  «        sd}t          |¦  «        ‚|| _        t          | j        dd¦  «        | _        d S )NÚseekzim must have seek methodÚ
_min_framer   )ÚhasattrÚAttributeErrorr
   ÚgetattrÚposition)Úselfr
   Úmsgs      ú]C:\Users\johnn\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL/ImageSequence.pyÚ__init__zIterator.__init__'   sG   € Ý�r˜6Ñ"Ô"ð 	&Ø,ˆCÝ  Ñ%Ô%Ð%ØˆŒÝ ¤¨°qÑ9Ô9ˆŒˆˆó    ÚixÚintc                óŽ   — 	 | j                              |¦  «         | j         S # t          $ r}d}t          |¦  «        |‚d }~ww xY w)Núend of sequence)r
   r   ÚEOFErrorÚ
IndexError)r   r   Úer   s       r   Ú__getitem__zIterator.__getitem__.   sT   € ð	)ØŒG�LŠL˜ÑÔÐØ”7ˆNøÝð 	)ð 	)ð 	)Ø#ˆCÝ˜S‘/”/ qÐ(øøøøð	)øøøs   ‚ # £
A­?¿Ar   c                ó   — | S ©N© )r   s    r   Ú__iter__zIterator.__iter__6   s   € Øˆr   c                ó¸   — 	 | 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   sh   € ð	,ØŒG�LŠL˜œÑ'Ô'Ð'ØˆMŒM˜QÑˆMŒMØ”7ˆNøÝð 	,ð 	,ð 	,Ø#ˆCÝ Ñ$Ô$¨!Ð+øøøøð	,øøøs   ‚58 ¸
AÁAÁAN)r
   r   r   r   )r   r   r   r   )r   r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r!   r%   r(   r$   r   r   r	   r	      sn   € € € € € ð	ð 	ð:ð :ð :ð :ð)ð )ð )ð )ðð ð ð ð,ð ,ð ,ð ,ð ,ð ,r   r	   Nr
   úImage.Image | list[Image.Image]Úfuncú+Callable[[Image.Image], Image.Image] | Noner   úlist[Image.Image]c                ó&  ‡— t          | t          ¦  «        s| g} g }| D ]b}|                     ¦   «         }	 |d„ t          |¦  «        D ¦   «         z  }|                     |¦  «         ŒI# |                     |¦  «         w xY w‰rˆfd„|D ¦   «         n|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                ó6   — g | ]}|                      ¦   «         ‘ŒS r$   )Úcopy)Ú.0Úim_frames     r   ú
<listcomp>zall_frames.<locals>.<listcomp>V   s    € ÐIÐIÐI¨�H—M’M‘O”OÐIÐIÐIr   c                ó&   •— g | ]} ‰|¦  «        ‘ŒS r$   r$   )r4   r
   r.   s     €r   r6   zall_frames.<locals>.<listcomp>Y   s!   ø€ Ð#Ð#Ð#˜ˆDˆD�‰HŒHÐ#Ð#Ð#r   )Ú
isinstanceÚlistÚtellr	   r   )r
   r.   ÚimsÚ
imSequenceÚcurrents    `   r   Ú
all_framesr>   C   s¹   ø€ õ �b�$ÑÔð ØˆTˆà
€CØð %ð %ˆ
Ø—/’/Ñ#Ô#ˆð	%ØÐIÐIµH¸ZÑ4HÔ4HÐIÑIÔIÑIˆCà�OŠO˜GÑ$Ô$Ð$Ð$øˆJ�OŠO˜GÑ$Ô$Ð$Ð$øøøØ'+Ð4Ð#Ð#Ð#Ð#˜sÐ#Ñ#Ô#Ð#°Ð4s   µA'Á'A>r#   )r
   r-   r.   r/   r   r0   )Ú
__future__r   ÚTYPE_CHECKINGÚcollections.abcr   Útypingr   Ú r   r	   r>   r$   r   r   ú<module>rD      s­   ðð" #Ð "Ð "Ð "Ð "Ð "à€Øð Ø(Ð(Ð(Ð(Ð(Ð(ØÐÐÐÐÐàÐÐÐÐÐð%,ð %,ð %,ð %,ð %,ñ %,ô %,ð %,ðT 9=ð5ð 5ð 5ð 5ð 5ð 5ð 5r   