
    g                     `    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 e G d de             Z
y)	    )	dataclass)Clip)Effect)CompositeVideoClip)Cropc                   Z    e Zd ZU dZdZeed<   dZeed<   dZ	eed<   dZ
eed<   ded	efd
Zy)FreezeRegiona!  Freezes one region of the clip while the rest remains animated.

    You can choose one of three methods by providing either `region`,
    `outside_region`, or `mask`.

    Parameters
    ----------

    t
      Time at which to freeze the freezed region.

    region
      A tuple (x1, y1, x2, y2) defining the region of the screen (in pixels)
      which will be freezed. You can provide outside_region or mask instead.

    outside_region
      A tuple (x1, y1, x2, y2) defining the region of the screen (in pixels)
      which will be the only non-freezed region.

    mask
      If not None, will overlay a freezed version of the clip on the current clip,
      with the provided mask. In other words, the "visible" pixels in the mask
      indicate the freezed region in the final picture.

    r   tNregionoutside_regionmaskclipreturnc                    | j                   | j                   \  }}}}|j                  t        | j                    g      j                  | j                        j                  |j                        j                  ||f      }t        ||g      S | j                  | j                  \  }}}}|j                  t        | j                   g      j                  ||f      }	|j                  | j                        j                  |j                        }t        ||	g      S | j                  [|j                  | j                        j                  |j                        j                  | j                        }t        ||g      S y)zApply the effect to the clip.N)r
   )r   with_effectsr   to_ImageClipr
   with_durationdurationwith_positionr   r   r   	with_mask)
selfr   x1y1_x2_y2freezex2y2animated_regions
             f/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/FreezeRegion.pyapplyzFreezeRegion.apply*   sY   ;;"#{{BC!!4#5"67't}}-Bx(	  &tVn55  ,!00NBB"//t**+,mRH%  &&&0>>t}}MF%v&?@@YY"!!DFF!+t}}-499% 
 &tVn55 #    )__name__
__module____qualname____doc__r
   float__annotations__r   tupler   r   r   r!    r"   r    r	   r	   	   sC    4 AuLFE NE D$6$ 64 6r"   r	   N)dataclassesr   moviepy.Clipr   moviepy.Effectr   ,moviepy.video.compositing.CompositeVideoClipr   moviepy.video.fx.Cropr   r	   r*   r"   r    <module>r0      s/    !  ! K & :66 :6 :6r"   