B ¥.¦^"ã@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 ú5/tmp/pip-install-mwhup7aw/Pillow/PIL/ImageSequence.pyÚ__init__s zIterator.__init__cCs0y|j |¡|jStk r*t‚YnXdS)N)rrÚEOFErrorÚ IndexError)r Úixr r r Ú __getitem__%s  zIterator.__getitem__cCs|S)Nr )r r r r Ú__iter__,szIterator.__iter__cCs@y"|j |j¡|jd7_|jStk r:t‚YnXdS)Né)rrrr Ú StopIteration)r r r r Ú__next__/s zIterator.__next__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrr r r r rs  rNcsdt|tƒs|g}g}x4|D],}| ¡}|dd„t|ƒDƒ7}| |¡qWˆ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 ú Hszall_frames..csg|] }ˆ|ƒ‘qSr r )rr)Úfuncr r rKs)Ú isinstanceÚlistÚtellrr)rrZimsZ imSequenceÚcurrentr )rr Ú all_frames8s  r!)N)rr!r r r r Ús%