§
    7?Äj½  ã                   óF  — d Z ddlZddlZddlZddlmZ ej        d„ ¦   «         Zej        d„ ¦   «         Zej        d„ ¦   «         Zej        d„ ¦   «         Z	ej        d„ ¦   «         Z
ej        d	„ ¦   «         Zej        d
„ ¦   «         Zd„ Zd„ Zd„ Zej        d„ ¦   «         Zd„ ZdS )zDecorators used by moviepy.é    N)Úconvert_to_secondsc                 óF   — |                      ¦   «         } | |g|¢R i |¤Ž |S )zKApplies ``func(clip.copy(), *args, **kwargs)`` and returns ``clip.copy()``.)Úcopy©ÚfuncÚclipÚargsÚkwargsÚnew_clips        úCC:\Projects\Historical\venv\Lib\site-packages\moviepy/decorators.pyÚoutplacer      s6   € ð �yŠy‰{Œ{€HØ€DˆÐ#�DÐ#Ð#Ð#˜FÐ#Ð#Ð#Ø€Oó    c                 óP   — |j         r|                     ¦   «         } | |g|¢R i |¤ŽS )zEIf the clip is a mask, convert it to RGB before running the function.)Úis_maskÚto_RGB©r   r   r	   r
   s       r   Úconvert_masks_to_RGBr      s;   € ð „|ð Ø�{Š{‰}Œ}ˆØˆ4�Ð&�tÐ&Ð&Ð&˜vÐ&Ð&Ð&r   c                 ól   —  | |g|¢R i |¤Ž}t          |dd¦  «        r | |j        g|¢R i |¤Ž|_        |S )zZApplies the same function ``func`` to the mask of the clip created with
    ``func``.
    ÚmaskN)Úgetattrr   r   s        r   Úapply_to_maskr      s_   € ð
 ˆt�DÐ*˜4Ð*Ð*Ð* 6Ð*Ð*€HÝˆx˜ Ñ&Ô&ð =Ø˜˜Xœ]Ð<¨TÐ<Ð<Ð<°VÐ<Ð<ˆŒØ€Or   c                 ól   —  | |g|¢R i |¤Ž}t          |dd¦  «        r | |j        g|¢R i |¤Ž|_        |S )zMApplies the function ``func`` to the audio of the clip created with ``func``.ÚaudioN)r   r   r   s        r   Úapply_to_audior   &   s_   € ð ˆt�DÐ*˜4Ð*Ð*Ð* 6Ð*Ð*€HÝˆx˜ $Ñ'Ô'ð ?Ø˜˜hœnÐ>¨tÐ>Ð>Ð>°vÐ>Ð>ˆŒØ€Or   c                 óF   — |j         €t          d¦  «        ‚ | |g|¢R i |¤ŽS )z,Raises an error if the clip has no duration.NzAttribute 'duration' not set)ÚdurationÚ
ValueErrorr   s       r   Úrequires_durationr   /   s;   € ð „}ÐÝÐ7Ñ8Ô8Ð8àˆt�DÐ*˜4Ð*Ð*Ð* 6Ð*Ð*Ð*r   c                 óf   — t          |d¦  «        r|j        €t          d¦  «        ‚ | |g|¢R i |¤ŽS )z'Raises an error if the clip has no fps.ÚfpsNzAttribute 'fps' not set)Úhasattrr    r   r   s       r   Úrequires_fpsr"   8   sL   € õ �4˜ÑÔð + 4¤8Ð#3ÝÐ2Ñ3Ô3Ð3àˆt�DÐ*˜4Ð*Ð*Ð* 6Ð*Ð*Ð*r   c                 ó|   — t          |d¦  «        r |j        � | ||j        g|¢R i |¤Ž|_        |S  | ||g|¢R i |¤ŽS )zôUse an audio function on a video/audio clip.

    This decorator tells that the function func (audioclip -> audioclip)
    can be also used on a video clip, at which case it returns a
    videoclip with unmodified video and modified audio.
    r   )r!   r   )r   Úeffectr   r	   r
   s        r   Úaudio_video_effectr%   A   sj   € õ ˆt�WÑÔð 3ØŒ:Ð!Ø˜˜f d¤jÐB°4ÐBÐBÐB¸6ÐBÐBˆDŒJØˆàˆt�F˜DÐ2 4Ð2Ð2Ð2¨6Ð2Ð2Ð2r   c                 ó   ‡ ‡— ˆ ˆfd„}|S )zXApplies preprocess_func to variables in varnames before launching
    the function.
    c                 óp   •‡— t          j        | ¦  «        j        Šˆˆˆfd„}t          j        | |¦  «        S )Nc                 ó�   •— ˆˆfd„t          |‰¦  «        D ¦   «         }ˆˆfd„|                     ¦   «         D ¦   «         } | |i |¤ŽS )Nc                 ó<   •— g | ]\  }}|‰v r|� ‰|¦  «        n|‘ŒS )N© )Ú.0ÚargÚnameÚpreprocess_funcÚvarnamess      €€r   ú
<listcomp>zCpreprocess_args.<locals>.decor.<locals>.wrapper.<locals>.<listcomp>Z   sP   ø€ ð ð ð ñ  �S˜$ð  Ð(Ð(¨s¨ð $�O CÑ(Ô(Ð(àð	ð ð r   c                 ó:   •— i | ]\  }}||‰v r ‰|¦  «        n|“ŒS r*   r*   )r+   ÚkwargÚvaluer.   r/   s      €€r   ú
<dictcomp>zCpreprocess_args.<locals>.decor.<locals>.wrapper.<locals>.<dictcomp>b   sH   ø€ ð ð ð á"�U˜Eð °¸(Ð1BÐ1B�� uÑ-Ô-Ð-Èðð ð r   ©ÚzipÚitems)r   r	   r
   Únew_argsÚ
new_kwargsÚargnamesr.   r/   s        €€€r   Úwrapperz/preprocess_args.<locals>.decor.<locals>.wrapperY   sˆ   ø€ ðð ð ð ð õ $' t¨XÑ#6Ô#6ðñ ô ˆHðð ð ð ð à&,§l¢l¡n¤nðñ ô ˆJð �4˜Ð0 ZÐ0Ð0Ð0r   ©ÚinspectÚgetfullargspecr	   Ú	decoratorÚdecorate)r   r;   r:   r.   r/   s     @€€r   Údecorzpreprocess_args.<locals>.decorV   sO   øø€ ÝÔ)¨$Ñ/Ô/Ô4ˆð	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1õ Ô! $¨Ñ0Ô0Ð0r   r*   )r.   r/   rA   s   `` r   Úpreprocess_argsrB   Q   s)   øø€ ð
1ð 1ð 1ð 1ð 1ð 1ð( €Lr   c                 ó,   — t          t          | ¦  «        S )z,Converts the specified variables to seconds.)rB   r   ©r/   s    r   Úconvert_parameter_to_secondsrE   m   s   € åÕ-¨xÑ8Ô8Ð8r   c                 ó6   — t          t          j        | ¦  «        S )z2Converts the specified variables to a path string.)rB   ÚosÚfspathrD   s    r   Úconvert_path_to_stringrI   r   s   € å�2œ9 hÑ/Ô/Ð/r   c                 óP   — |j         €|                     ¦   «         } | |g|¢R i |¤ŽS )z(Add a mask to the clip if there is none.)r   Ú	with_maskr   s       r   Úadd_mask_if_nonerL   w   s;   € ð „yÐØ�~Š~ÑÔˆØˆ4�Ð&�tÐ&Ð&Ð&˜vÐ&Ð&Ð&r   c                 óŠ   ‡ ‡‡— t          j        ‰ ¦  «        j        dd…         Šˆ fd„Šˆˆfd„}t          j        ‰ |¦  «        S )zBWill use ``clip.fps`` if no ``fps=...`` is provided in **kwargs**.é   Nc                 ój   •— |�|S t          | dd ¦  «        r| j        S t          d‰j        z  ¦  «        ‚)Nr    zÎNo 'fps' (frames per second) attribute specified for function %s and the clip has no 'fps' attribute. Either provide e.g. fps=24 in the arguments of the function, or define the clip's fps with `clip.fps=24`)r   r    ÚAttributeErrorÚ__name__)r   r    r   s     €r   Úfind_fpsz)use_clip_fps_by_default.<locals>.find_fpsƒ   sL   ø€ Øˆ?ØˆJÝ�T˜5 $Ñ'Ô'ð 	Ø”8ˆOÝð1ð 48´=ñAñ
ô 
ð 	
r   c                 óš   •‡— ˆˆfd„t          |‰¦  «        D ¦   «         }ˆˆfd„|                     ¦   «         D ¦   «         } | ‰g|¢R i |¤ŽS )Nc                 ó>   •— g | ]\  }}|d k    r ‰‰|¦  «        n|‘ŒS ©r    r*   )r+   r,   r-   r   rR   s      €€r   r0   z<use_clip_fps_by_default.<locals>.wrapper.<locals>.<listcomp>�   sF   ø€ ð 
ð 
ð 
á��dð $(¨5¢= =ˆHˆH�T˜3ÑÔÐ°cð
ð 
ð 
r   c                 ó@   •— i | ]\  }}||d k    r ‰‰|¦  «        n|“ŒS rU   r*   )r+   r2   r3   r   rR   s      €€r   r4   z<use_clip_fps_by_default.<locals>.wrapper.<locals>.<dictcomp>”   sH   ø€ ð 
ð 
ð 
á�˜ð ¨E°UªN¨N�8�8˜D %Ñ(Ô(Ð(Àð
ð 
ð 
r   r5   )r   r   r	   r
   r8   r9   r:   rR   s    `    €€r   r;   z(use_clip_fps_by_default.<locals>.wrapper�   s’   øø€ ð
ð 
ð 
ð 
ð 
å" 4¨Ñ2Ô2ð
ñ 
ô 
ˆð
ð 
ð 
ð 
ð 
à"(§,¢,¡.¤.ð
ñ 
ô 
ˆ
ð
 ˆt�DÐ2˜8Ð2Ð2Ð2 zÐ2Ð2Ð2r   r<   )r   r;   r:   rR   s   ` @@r   Úuse_clip_fps_by_defaultrW      sm   øøø€ åÔ% dÑ+Ô+Ô0°°°Ô4€Hð

ð 

ð 

ð 

ð 

ð
3ð 
3ð 
3ð 
3ð 
3ð 
3õ Ô˜d GÑ,Ô,Ð,r   )Ú__doc__r=   rG   r?   Úmoviepy.toolsr   r   r   r   r   r   r"   r%   rB   rE   rI   rL   rW   r*   r   r   ú<module>rZ      sy  ðØ !Ð !à €€€Ø 	€	€	€	à Ð Ð Ð à ,Ð ,Ð ,Ð ,Ð ,Ð ,ð Ôðð ñ Ôðð Ôð'ð 'ñ Ôð'ð Ôðð ñ Ôðð Ôðð ñ Ôðð Ôð+ð +ñ Ôð+ð Ôð+ð +ñ Ôð+ð Ôð3ð 3ñ Ôð3ðð ð ð89ð 9ð 9ð
0ð 0ð 0ð
 Ôð'ð 'ñ Ôð'ð-ð -ð -ð -ð -r   