Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
ia: ã @ 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
ú2/tmp/tmp5hum_rxs/lib64/python/PIL/ImageSequence.pyÚ__init__ s
zIterator.__init__c C s@ y| j j|ƒ | j S tk
r: } zt|‚W Y d d }~X nX d S )N)r r ÚEOFErrorÚ
IndexError)r ZixÚer
r
r Ú__getitem__% s
zIterator.__getitem__c C s | S )Nr
)r r
r
r Ú__iter__, s zIterator.__iter__c C sP y"| j j| jƒ | jd7 _| j S tk
rJ } zt|‚W Y d d }~X nX 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 sd t | tƒs| g} g }x4| D ],}|jƒ }|dd„ t|ƒD ƒ7 }|j|ƒ 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.
c S s g | ]}|j ƒ ‘qS r
)Úcopy)Ú.0Zim_framer
r
r ú
H s zall_frames..c s g | ]}ˆ |ƒ‘qS r
r
)r r )Úfuncr
r r K s )Ú
isinstanceÚlistÚtellr r )r r ZimsZ
imSequenceÚcurrentr
)r r Ú
all_frames8 s
r! )N)r r! r
r
r
r Ú s %