
    g                     H    d dl mZ d dlmZ d dlmZ e G d de             Zy)    )	dataclass)Clip)Effectc                   6    e Zd ZU dZeed<   eed<   dedefdZy)SlideIna  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 : moviepy.Clip.Clip
      A video clip.

    duration : float
      Time taken for the clip to be fully visible

    side : str
      Side of the screen where the clip comes from. One of
      'top', 'bottom', 'left' or 'right'.

    Examples
    --------

    .. code:: python

        from moviepy import *

        clips = [... make a list of clips]
        slided_clips = [
            CompositeVideoClip([clip.with_effects([vfx.SlideIn(1, "left")])])
            for clip in clips
        ]
        final_clip = concatenate_videoclips(slided_clips, padding=-1)

        clip = ColorClip(
            color=(255, 0, 0), duration=1, size=(300, 300)
        ).with_fps(60)
        final_clip = CompositeVideoClip([clip.with_effects([vfx.SlideIn(1, "right")])])
    durationsideclipreturnc                      |j                   \   fd fd fd fdd}|j                  | j                           S )zApply the effect to the clip.c                 F    t        d| j                  z  dz
  z        dfS Nr      centerminr   tselfws    a/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/SlideIn.py<lambda>zSlideIn.apply.<locals>.<lambda>6   s&    s1a1t}}+<q+@&ABHM     c                 F    t        dd| j                  z  z
  z        dfS r   maxr   r   s    r   r   zSlideIn.apply.<locals>.<lambda>7   s&    AqADMM0A,A'B CXN r   c                 F    dt        d| j                  z  dz
  z        fS Nr   r   r   r   r   hr   s    r   r   zSlideIn.apply.<locals>.<lambda>8   s&    hAqA4E4I/J(KL r   c                 F    dt        dd| j                  z  z
  z        fS r   r   r   s    r   r   zSlideIn.apply.<locals>.<lambda>9   s&    3q!q1t}};L7L2M+N O r   )leftrighttopbottom)sizewith_positionr	   )r   r
   pos_dictr    r   s   `  @@r   applyzSlideIn.apply2   s?    yy1MNLO	
 !!(499"566r   N)	__name__
__module____qualname____doc__float__annotations__strr   r)    r   r   r   r      s'    $L O
I
7$ 
74 
7r   r   N)dataclassesr   moviepy.Clipr   moviepy.Effectr   r   r1   r   r   <module>r5      s)    !  ! 47f 47 47r   