
    gK                     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)SlideOuta  Makes the clip goes 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 : 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 goes. 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.SlideOut(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.SlideOut(1, "right")])])
    durationsideclipreturnc                      |j                   t        d      |j                  \  |j                    j                   z
   fd fd fd fdd}|j                  | j                           S )zApply the effect to the clip.zAttribute 'duration' not setc                 H    t        d| z
   j                  z  z        dfS Nr   centerminr   tselftsws    b/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/SlideOut.py<lambda>z SlideOut.apply.<locals>.<lambda>:   s'    s1aQV9t}}+D&EFQ     c                 F    t        d| z
  j                  z  z        dfS r   maxr   r   s    r   r   z SlideOut.apply.<locals>.<lambda>;   s%    AqQVt}},D'E FQ r   c                 H    dt        d| z
   j                  z  z        fS Nr   r   r   r   hr   r   s    r   r   z SlideOut.apply.<locals>.<lambda><   s'    hAqa"fI4M/N(OP r   c                 F    dt        d| z
  j                  z  z        fS r   r   r   s    r   r   z SlideOut.apply.<locals>.<lambda>=   s%    3q!B$--7O2P+Q R r   )leftrighttopbottom)r   
ValueErrorsizewith_positionr	   )r   r
   pos_dictr    r   r   s   `  @@@r   applyzSlideOut.apply2   sg    == ;<<yy1]]T]]*QQPR	
 !!(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   r2   r   r   <module>r6      s)    !  ! 87v 87 87r   