
    W|h                     `    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  \ " S S\5      5       r
g)	    )	dataclass)Clip)Effect)CompositeVideoClip)Cropc                   d    \ rS rSr% SrSr\\S'   Sr\	\S'   Sr
\	\S'   Sr\\S'   S	\S
\4S jrSrg)FreezeRegion	   a  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                    U R                   b}  U R                   u  p#pEUR                  [        U R                   6 /5      R                  U R                  S9R                  UR                  5      R                  X#45      n[        X/5      $ U R                  b  U R                  u  p#pxUR                  [        U R                  6 /5      R                  X#45      n	UR                  U R                  S9R                  UR                  5      n[        Xi/5      $ U R                  bW  UR                  U R                  S9R                  UR                  5      R                  U R                  5      n[        X/5      $ g)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
             W/home/james-whalen/.local/lib/python3.13/site-packages/moviepy/video/fx/FreezeRegion.pyapplyFreezeRegion.apply*   sG   ;;"#{{BC!!4#5"67't}}-x(	  &tn55  ,!00NBB"//t**+,mRH%  &&&0>>t}}MF%v&?@@YY"!!DFF!+t}}-499% 
 &tn55 #     )__name__
__module____qualname____firstlineno____doc__r   float__annotations__r   tupler   r   r   r"   __static_attributes__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>r4      s/    !  ! K & :66 :6 :6r$   