o
    Y+iV  ã                   @   s|   d Z ddlmZmZ ddlmZ ddlmZ ddlmZ eedd„ ƒƒZ	eed	d
„ ƒƒZ
dd„ Zedd„ ƒZedd„ ƒZdS )z°
Here is the current catalogue. These are meant
to be used with clip.fx. There are available as transfx.crossfadein etc.
if you load them with ``from moviepy.editor import *``
é    )Úadd_mask_if_noneÚrequires_duration)Úfadein)Úfadeouté   )ÚCompositeVideoClipc                 C   ó&   | j | j_ |  ¡ }| j t|¡|_|S )z‡ Makes the clip appear progressively, over ``duration`` seconds.
    Only works when the clip is included in a CompositeVideoClip.
    )ÚdurationÚmaskÚcopyÚfxr   ©Úclipr	   Únewclip© r   úX/var/www/html/venv/lib/python3.10/site-packages/moviepy/video/compositing/transitions.pyÚcrossfadein   ó   
r   c                 C   r   )zŠ Makes the clip disappear progressively, over ``duration`` seconds.
    Only works when the clip is included in a CompositeVideoClip.
    )r	   r
   r   r   r   r   r   r   r   Úcrossfadeout   r   r   c                    sN   | j \‰‰‡ ‡fdd„‡ ‡fdd„‡ ‡fdd„‡ ‡fdd„dœ}|  || ¡S )aû   Makes the clip arrive from one side of the screen.

    Only works when the clip is included in a CompositeVideoClip,
    and if the clip has the same size as the whole composition.

    Parameters
    ===========

    clip
      A video clip.

    duration
      Time taken for the clip to be fully visible

    side
      Side of the screen where the clip comes from. One of
      'top' | 'bottom' | 'left' | 'right'

    Examples
    =========

    >>> from moviepy.editor import *
    >>> clips = [... make a list of clips]
    >>> slided_clips = [CompositeVideoClip([
                            clip.fx(transfx.slide_in, duration=1, side='left')])
                        for clip in clips]
    >>> final_clip = concatenate( slided_clips, padding=-1)

    c                    s   t dˆ| ˆ  d  ƒdfS ©Nr   r   Úcenter©Úmin©Út©r	   Úwr   r   Ú<lambda>E   ó    zslide_in.<locals>.<lambda>c                    s   t dˆd| ˆ    ƒdfS r   ©Úmaxr   r   r   r   r   F   r   c                    s   dt dˆ| ˆ  d  ƒfS ©Nr   r   r   r   r   ©r	   Úhr   r   r   G   r   c                    s   dt dˆd| ˆ    ƒfS r!   r   r   r"   r   r   r   H   r   ©ÚleftÚrightÚtopÚbottom)ÚsizeÚset_position©r   r	   ÚsideÚpos_dictr   )r	   r#   r   r   Úslide_in&   s   
ýr.   c                    s`   | j \‰‰| jˆ  ‰‡ ‡‡fdd„‡ ‡‡fdd„‡ ‡‡fdd„‡ ‡‡fdd„dœ}|  || ¡S )aõ   Makes the clip go away by one side of the screen.

    Only works when the clip is included in a CompositeVideoClip,
    and if the clip has the same size as the whole composition.

    Parameters
    ===========

    clip
      A video clip.

    duration
      Time taken for the clip to fully disappear.

    side
      Side of the screen where the clip goes. One of
      'top' | 'bottom' | 'left' | 'right'

    Examples
    =========

    >>> from moviepy.editor import *
    >>> clips = [... make a list of clips]
    >>> slided_clips = [CompositeVideoClip([
                            clip.fx(transfx.slide_out, duration=1, side='left')])
                        for clip in clips]
    >>> final_clip = concatenate( slided_clips, padding=-1)

    c                    s   t dˆ| ˆ  ˆ   ƒdfS ©Nr   r   r   r   ©r	   Útsr   r   r   r   o   ó    zslide_out.<locals>.<lambda>c                    s   t dˆ| ˆ ˆ   ƒdfS r/   r   r   r0   r   r   r   p   r   c                    s   dt dˆ| ˆ  ˆ   ƒfS ©Nr   r   r   r   ©r	   r#   r1   r   r   r   q   r2   c                    s   dt dˆ| ˆ ˆ   ƒfS r3   r   r   r4   r   r   r   r   r   r$   )r)   r	   r*   r+   r   )r	   r#   r1   r   r   Ú	slide_outM   s   
 
ýr5   c                 C   s0   | j }|  t|¡ || ¡}t| |gƒ ||¡S )zœ Makes the clip fade in progressively at its own end, this way
    it can be looped indefinitely. ``cross`` is the duration in seconds
    of the fade-in.  )r	   r   r   Ú	set_startr   Úsubclip)r   Úcross_durationÚdÚclip2r   r   r   Úmake_loopablew   s   r;   N)Ú__doc__Úmoviepy.decoratorsr   r   Úmoviepy.video.fx.fadeinr   Úmoviepy.video.fx.fadeoutr   r   r   r   r.   r5   r;   r   r   r   r   Ú<module>   s     

'
)