
    g                     &    d dl mZ  G d de      Zy)    )Effectc                   ,    e Zd ZdZ	 	 	 	 	 	 	 ddZd Zy)Scrolla  Effect that scrolls horizontally or vertically a clip, e.g. to make end credits

    Parameters
    ----------
    w, h
      The width and height of the final clip. Default to clip.w and clip.h

    x_speed, y_speed
      The speed of the scroll in the x and y directions.

    x_start, y_start
      The starting position of the scroll in the x and y directions.


    apply_to
      Whether to apply the effect to the mask too.
    Nc                 f    || _         || _        || _        || _        || _        || _        || _        y )N)whx_speedy_speedx_starty_startapply_to)selfr   r   r	   r
   r   r   r   s           `/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/Scroll.py__init__zScroll.__init__   s5          c                       j                   |j                    _          j                  |j                   _         j                  dz
   j                   dz
   fd}|j                  | j                        S )zApply the effect to the clip.   c                 b   t        t        dt        j                  t	        j
                  |z        z                     }t        t        dt        j                  t	        j                  |z        z                     } | |      ||j                  z   ||j                  z   f   S )Nr   )
intmaxminr   roundr	   r   r
   r   r   )	get_frametxyr   x_maxy_maxs       r   filterzScroll.apply.<locals>.filter4   s    C3udllU4<<!;K5L&LMNOAC3udllU4<<!;K5L&LMNOAQ<AJAJ >??r   )r   )r   r   	transformr   )r   clipr   r   r   s   `  @@r   applyzScroll.apply)   sd    66>VVDF66>VVDF

	@
 ~~ft}}~==r   )NNr   r   r   r   mask)__name__
__module____qualname____doc__r   r"    r   r   r   r      s(    ( 
!$>r   r   N)moviepy.Effectr   r   r(   r   r   <module>r*      s    !5>V 5>r   