
    -i                     .    d dl mZ  G d de          ZdS )    )Effectc                   .    e Zd ZdZ	 	 	 	 	 	 	 ddZd ZdS )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.
    Nr   maskc                 h    || _         || _        || _        || _        || _        || _        || _        d S )N)whx_speedy_speedx_starty_startapply_to)selfr   r	   r
   r   r   r   r   s           U/var/www/html/speakWrite/venv/lib/python3.11/site-packages/moviepy/video/fx/Scroll.py__init__zScroll.__init__   s9          c                       j         |j          _          j        |j         _         j        dz
   j         dz
   fd}|                    | j                  S )zApply the effect to the clip.N   c                 r   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3udlU4<!;K5L5L&LMMNNOOAC3udlU4<!;K5L5L&LMMNNOOA9Q<<AJAJ >??r   )r   )r	   r   	transformr   )r   clipr    r   r   s   `  @@r   applyzScroll.apply)   s    6>VDF6>VDF

	@ 	@ 	@ 	@ 	@ 	@ 	@
 ~~ft}~===r   )NNr   r   r   r   r   )__name__
__module____qualname____doc__r   r#    r   r   r   r      sX         ( 
! ! ! !$> > > > >r   r   N)moviepy.Effectr   r   r(   r   r   <module>r*      sK    ! ! ! ! ! !5> 5> 5> 5> 5>V 5> 5> 5> 5> 5>r   