o
    Y+i                     @   sd   d dl Zzd dlZdZejdkreje_W n   dZY dddZes0ejZ	dddZe	e_dS dS )	    NTz3.0.0Fc                    s0   du r
d d  fdd}|  |S )a  
    Returns a filter that will blurr a moving part (a head ?) of
    the frames. The position of the blur at time t is
    defined by (fx(t), fy(t)), the radius of the blurring
    by ``r_zone`` and the intensity of the blurring by ``r_blur``.
    Requires OpenCV for the circling and the blurring.
    Automatically deals with the case where part of the image goes
    offscreen.
    N      c                    s  | |}|j \}}}t |t|}}td| t| |}}	td| t| |}
}||
 |	| f}t|d}tj|fddtj	d t
dd| g }||
|||	f }t|f}|| d| |  ||
|||	f< |S )	Nr   uint8   )lineTyper   gp?   )shapeintmaxminnpzerosastypecv2circleCV_AAdstackblur)gftimhwdxyx1x2y1y2region_sizemaskorigblurredfxfyr_blurr_zone L/var/www/html/venv/lib/python3.10/site-packages/moviepy/video/fx/headblur.pyfl   s   $zheadblur.<locals>.fl)r,   )clipr&   r'   r)   r(   r,   r*   r%   r+   headblur   s   
r.   c                 C   s   t d)Nzfx painting needs opencv)IOError)r-   r&   r'   r)   r(   r*   r*   r+   r.   6   s   )N)
numpyr   r   headblur_possible__version__LINE_AAr   r.   __doc__docr*   r*   r*   r+   <module>   s    

&

