
    -i                     ^    d dl mZ d dlZd dlmZ d dlmZ e G d de                      ZdS )    )	dataclassN)Clip)Effectc                   <    e Zd ZU dZeed<   dZeed<   dedefdZ	dS )FadeOutaK  Makes the clip progressively fade to some color (black by default),
    over ``duration`` seconds at the end of the clip. Can be used for masks too,
    where the final color must be a number between 0 and 1.

    For cross-fading (progressive appearance or disappearance of a clip over another
    clip), see ``CrossFadeOut``
    durationNfinal_colorclipreturnc                      j         t          d           j        j        rdng d _        t	          j         j                   _         fd}                    |          S )zApply the effect to the clip.NzAttribute 'duration' not setr   )r   r   r   c                     j         |z
  j         k    r | |          S dj         |z
  z  j         z  }| | |          z  d|z
  j        z  z   S )Ng      ?   )r   r	   )	get_frametfadingr
   selfs      V/var/www/html/speakWrite/venv/lib/python3.11/site-packages/moviepy/video/fx/FadeOut.pyfilterzFadeOut.apply.<locals>.filter    sa    !dm33 y||# 12T]B		!,F
d>N/NNN    )r   
ValueErrorr	   is_masknparray	transform)r   r
   r   s   `` r   applyzFadeOut.apply   s    = ;<<<#$(L?qqiiiD8D$455	O 	O 	O 	O 	O 	O ~~f%%%r   )
__name__
__module____qualname____doc__float__annotations__r	   listr   r    r   r   r   r   	   s]           OOOK&$ &4 & & & & & &r   r   )	dataclassesr   numpyr   moviepy.Clipr   moviepy.Effectr   r   r#   r   r   <module>r(      s    ! ! ! ! ! !           ! ! ! ! ! ! & & & & &f & & & & &r   