
    g                     P    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y)    )	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	y)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}j                  |      S )zApply the effect to the clip.z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      a/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/FadeOut.pyfilterzFadeOut.apply.<locals>.filter    sa    !dmm3 |# 12T]]B	!,F
d>N>N/NNN    )r   
ValueErrorr	   is_masknparray	transform)r   r
   r   s   `` r   applyzFadeOut.apply   sc    == ;<<#$(LLqiD88D$4$45	O ~~f%%r   )
__name__
__module____qualname____doc__float__annotations__r	   listr   r    r   r   r   r   	   s+     OK&$ &4 &r   r   )	dataclassesr   numpyr   moviepy.Clipr   moviepy.Effectr   r   r#   r   r   <module>r(      s,    !   ! &f & &r   