§
    7?Äj	  ã                   óJ   — d dl mZ d dlmZ e G d„ de¦  «        ¦   «         ZdS )é    )Ú	dataclass)ÚEffectc                   óN   — 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
dS )
Ú
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                 ód   •‡— ˆfd„Šˆfd„}| dk      ‰| ¦  «        z  | dk     || ¦  «        z  z   S )Nc                 ó    •— dd‰z
  z  | ‰z  z  S )Nç      à?é   © )ÚtÚas    €úLC:\Projects\Historical\venv\Lib\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˜2˜a !™e™9œ9‘}Ð$r   r   r   )r   r   r   r   s     @€r   Ú_fz%AccelDecel._f_accel_decel.<locals>._f8   se   øø€ ð1ð 1ð 1ð 1ð 1ð%ð %ð %ð %ð %ð ˜’G˜r˜r !™uœuÑ$¨¨Sª°B°B°q±E´EÑ'9Ñ9Ð9r   r   )Úselfr   Úold_durationr   r	   r
   r   r   s          @r   Ú_f_accel_decelzAccelDecel._f_accel_decel3   sI   ø€ ð �*Ñˆð	:ð 	:ð 	:ð 	:ð 	:ð ˜b˜b ! lÑ"2°xÑ!?Ñ@Ô@Ñ@Ð@r   c                 óÂ   ‡ ‡— ‰ j         €‰j        ‰ _         ‰ j        dk     rt          d¦  «        ‚‰                     ˆˆ fd„¦  «                             ‰ j         ¦  «        S )zApply the effect to the clip.Nr   z%'sooness' should be a positive numberc                 ó`   •— ‰                      | ‰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   s4   ø€ �d×)Ò)ØØ!œ]Ø!Ô.Øœ?Øœð *ñ ô € r   )r   r   r
   Ú
ValueErrorÚtime_transformÚwith_duration)r   r   s   ``r   ÚapplyzAccelDecel.applyC   sv   øø€ àÔÐ$Ø $¤ˆDÔàŒ=˜1ÒÐÝÐDÑEÔ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ð Að Að Að +ð +ð +ð +ð +r   r   N)Údataclassesr   Úmoviepy.Effectr   r   r   r   r   ú<module>r-      ss   ðØ !Ð !Ð !Ð !Ð !Ð !à !Ð !Ð !Ð !Ð !Ð !ð ðL+ð L+ð L+ð L+ð L+�ñ L+ô L+ñ „ðL+ð L+ð L+r   