§
    aÒ³g˜  ã                  óP   — 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 )é    )Úannotations)ÚCallableé   )Ú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      úO/var/www/html/mpstechhub/venv/lib/python3.11/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c                ó   — | S ©N© )r   s    r   Ú__iter__zIterator.__iter__3   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__6   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 ]G}|                     ¦   «         }|d„ t          |¦  «        D ¦   «         z  }|                     |¦  «         ŒH‰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>S   s    € ÐEÐEÐE H�—’‘”ÐEÐEÐEr   c                ó&   •— g | ]} ‰|¦  «        ‘ŒS r#   r#   )r3   r	   r-   s     €r   r5   zall_frames.<locals>.<listcomp>V   s!   ø€ Ð#Ð#Ð#˜ˆDˆD�‰HŒHÐ#Ð#Ð#r   )Ú
isinstanceÚlistÚtellr   r   )r	   r-   ÚimsÚ
imSequenceÚcurrents    `   r   Ú
all_framesr=   @   sœ   ø€ õ �b�$ÑÔð ØˆTˆà
€CØð !ð !ˆ
Ø—/’/Ñ#Ô#ˆàÐEÐEµ¸Ñ0DÔ0DÐEÑEÔEÑEˆà�Š˜Ñ Ô Ð Ð Ø'+Ð4Ð#Ð#Ð#Ð#˜sÐ#Ñ#Ô#Ð#°Ð4r   r"   )r	   r,   r-   r.   r   r/   )Ú
__future__r   Útypingr   Ú r   r   r=   r#   r   r   ú<module>rA      sŽ   ðð" #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð ð%,ð %,ð %,ð %,ð %,ñ %,ô %,ð %,ðT 9=ð5ð 5ð 5ð 5ð 5ð 5ð 5r   