bitlib_c  0.2.4
Functions
anim.h File Reference
#include <cairo.h>
#include "render.h"

Go to the source code of this file.

Functions

bl_render_config bl_make_render_config (double width, double height, double frames, double fps)
 
void _render_frames (bl_render_config config, char *gif_name, bl_render_callback render, char *tmp, int num_threads)
 
void _convert_frames_to_gif (char *frames_dir, char *file_name, double fps)
 
void _convert_frames_to_video (bl_render_config config, char *frames_dir, char *file_name, double fps)
 

Function Documentation

◆ _convert_frames_to_gif()

void _convert_frames_to_gif ( char *  frames_dir,
char *  file_name,
double  fps 
)

Converts the frames in the temp folder into an animated gif. Internal use only.

Parameters
char*frames_dir Where the frames are stored.
char*file_name The name of the output file.
doublefps. Frames per second for the animation.

◆ _convert_frames_to_video()

void _convert_frames_to_video ( bl_render_config  config,
char *  frames_dir,
char *  file_name,
double  fps 
)

Converts the frames in the temp folder into a video. Internal use only.

Parameters
char*frames_dir Where the frames are stored.
char*file_name The name of the output file.
doublefps. Frames per second for the animation.

◆ _render_frames()

void _render_frames ( bl_render_config  config,
char *  gif_name,
bl_render_callback  render,
char *  tmp,
int  num_threads 
)

Renders each frame of an animation into png files in a folder. Internal use only.

Parameters
bl_render_configconfig Contains information on how to render the frames.
char*gif_name The output file name.
bl_render_callback*render The function that draws each frame.
char*tmp The file to store the frames in. Usually deleted post-render.
intnum_threads How many threads to use to render this animation.

◆ bl_make_render_config()

bl_render_config bl_make_render_config ( double  width,
double  height,
double  frames,
double  fps 
)

Creates animation/image config

Creates an instance of bl_render_config for creating an animation or image.

Parameters
doublewidth The width of the image or animation.
doubleheight The height of the image or animation.
doubleframes The number of frames in the animation. Equal to the fps * seconds of animation.
doublefps Frames per second of the animation.
Returns
bl_render_config