Ë
    Eü´j	  ã                   ó<   — d dl mZ d dlmZ e G d„ de«      «       Zy)é    )Ú	dataclass)ÚEffectc                   óL   — e Zd ZU dZdZeed<   dZeed<   dZeed<   	 d	d„Z	d„ Z
y)
Ú
AccelDecelad  Accelerates and decelerates a clip, useful for GIF making.

    Parameters
    ----------

    new_duration : float
      Duration for the new transformed clip. If None, will be that of the
      current clip.

    abruptness : float
      Slope shape in the acceleration-deceleration function. It will depend
      on the value of the parameter:

      * ``-1 < abruptness < 0``: speed up, down, up.
      * ``abruptness == 0``: no effect.
      * ``abruptness > 0``: speed down, up, down.

    soonness : float
      For positive abruptness, determines how soon the transformation occurs.
      Should be a positive number.

    Raises
    ------

    ValueError
      When ``sooness`` argument is lower than 0.

    Examples
    --------

    The following graphs show functions generated by different combinations
    of arguments, where the value of the slopes represents the speed of the
    videos generated, being the linear function (in red) a combination that
    does not produce any transformation.

    .. image:: /_static/medias/accel_decel-fx-params.png
      :alt: acced_decel FX parameters combinations
    NÚnew_durationç      ð?Ú
abruptnessÚsoonnessc                 ó:   ‡— d|z   Šˆfd„}| |||z  |z  «      z  S )Nr   c                 óT   •‡— ˆfd„Šˆfd„}| dk   ‰| «      z  | dk\   || «      z  z   S )Nc                 ó    •— dd‰z
  z  | ‰z  z  S )Nç      à?é   © )ÚtÚas    €úY/root/workspace/ytshorts/venv/lib/python3.12/site-packages/moviepy/video/fx/AccelDecel.pyÚf1z1AccelDecel._f_accel_decel.<locals>._f.<locals>.f19   s   ø€ Ø  Q¡Ñ'¨1¨a©4Ñ0Ð0ó    c                 ó    •— d ‰d| z
  «      z
  S )Nr   r   )r   r   s    €r   Úf2z1AccelDecel._f_accel_decel.<locals>._f.<locals>.f2<   s   ø€ Ø™2˜a !™e›9‘}Ð$r   r   r   )r   r   r   r   s     @€r   Ú_fz%AccelDecel._f_accel_decel.<locals>._f8   s4   ù€ ô1ô%ð ˜‘G™r !›uÑ$¨¨S©±B°q³EÑ'9Ñ9Ð9r   r   )Úselfr   Úold_durationr   r	   r
   r   r   s          @r   Ú_f_accel_decelzAccelDecel._f_accel_decel3   s0   ø€ ð �*Ñˆô	:ð ™b ! lÑ"2°xÑ!?Ó@Ñ@Ð@r   c                 óÐ   ‡ ‡— ‰ j                   €‰j                  ‰ _         ‰ j                  dk  rt        d«      ‚‰j	                  ˆˆ fd„«      j                  ‰ j                   «      S )zApply the effect to the clip.r   z%'sooness' should be a positive numberc                 ó€   •— ‰j                  | ‰j                  ‰j                  ‰j                  ‰j                  ¬«      S )N)r   r   r   r	   r
   )r   Údurationr   r	   r
   )r   Úclipr   s    €€r   ú<lambda>z"AccelDecel.apply.<locals>.<lambda>L   s8   ø€ �d×)Ñ)ØØ!Ÿ]™]Ø!×.Ñ.ØŸ?™?ØŸ™ð *ó € r   )r   r   r
   Ú
ValueErrorÚtime_transformÚwith_duration)r   r   s   ``r   ÚapplyzAccelDecel.applyC   s]   ù€ à×ÑÐ$Ø $§¡ˆDÔà�=‰=˜1ÒÜÐDÓEÐEà×"Ñ"ôó
÷ ‰-˜×)Ñ)Ó
*ð	+r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚfloatÚ__annotations__r	   r
   r   r$   r   r   r   r   r      s:   … ñ%ðN €L�%ÓØ€J�ÓØ€HˆeÓð GJóAó +r   r   N)Údataclassesr   Úmoviepy.Effectr   r   r   r   r   ú<module>r-      s)   ðÝ !å !ð ôL+�ó L+ó ñL+r   