animation#
Utility functions for animations.
Functions
|
Decorator to check if the step is a float or int and if it is between 0 and 1. |
|
An ease-in and ease-out quadratic function to generate animation steps (slow to fast to slow). |
|
An ease-in and ease-out sinusoidal function to generate animation steps (slow to fast to slow). |
|
An ease-in sinusoidal function to generate animation steps (slow to fast). |
|
An ease-out sinusoidal function to generate animation steps (fast to slow). |
|
A linear function to generate animation steps. |
|
Stitch frames together into a GIF animation. |
- data_morph.plotting.animation.check_step(easing_function: Callable[[int | float], int | float]) Callable[[int | float], int | float] [source]#
Decorator to check if the step is a float or int and if it is between 0 and 1.
- Parameters:
easing_function (Callable) – The easing function to be checked.
- Returns:
The easing function with the check for the step.
- Return type:
Callable
- data_morph.plotting.animation.ease_in_out_quadratic(step: int | float) int | float [source]#
An ease-in and ease-out quadratic function to generate animation steps (slow to fast to slow).
- data_morph.plotting.animation.ease_in_out_sine(step: int | float) float [source]#
An ease-in and ease-out sinusoidal function to generate animation steps (slow to fast to slow).
- data_morph.plotting.animation.ease_in_sine(step: int | float) float [source]#
An ease-in sinusoidal function to generate animation steps (slow to fast).
- data_morph.plotting.animation.ease_out_sine(step: int | float) float [source]#
An ease-out sinusoidal function to generate animation steps (fast to slow).
- data_morph.plotting.animation.linear(step: int | float) int | float [source]#
A linear function to generate animation steps.
- data_morph.plotting.animation.stitch_gif_animation(output_dir: str | Path, start_shape: str, target_shape: str | Shape, keep_frames: bool = False, forward_only_animation: bool = False) None [source]#
Stitch frames together into a GIF animation.
- Parameters:
output_dir (str or pathlib.Path) – The output directory to save the animation to. Note that the frames to stitch together must be in here as well.
start_shape (str) – The starting shape.
target_shape (str or Shape) – The target shape for the morphing.
keep_frames (bool, default
False
) – Whether to keep the individual frames after creating the animation.forward_only_animation (bool, default
False
) – Whether to only play the animation in the forward direction rather than animating in both forward and reverse.
See also
PIL.Image
Frames are stitched together with Pillow.